Segger Jlink Plus for MTB tracing on Cortex-M0+

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Segger Jlink Plus for MTB tracing on Cortex-M0+

      Hi,

      I am trying to setup traces using our company's cortex-m0+ MCU having MTB capability.
      I have setup the following:

      1. Created MTB.ini file containing the MTB SRAM size and MTB address fields for my device.
      2. Setup Keil MDK with the project to be debugged. I have setup the debug tab with appropriate parameters as displayed below:
      3. Whenever I debug the program it gives me an error "Trace HW not present"

      Can you please tell me what the problem is? I have read up different blogs and forum articles for connecting Jlink with MTB and followed the procedure.
    • Hello,

      Thank you for your inquiry.
      Could you name the exact device description of the target device you are trying to debug?
      Unfortunately Keil documentation is not clear if MTB is supported with third party probes.
      For verification could you use Ozone instead? segger.com/products/debug-probes/j-link/
      Simply load up your Keil output file in Ozone using the project wizard and go to Tools->Trace Settings->Trace Source->Trace Buffer.

      If you now open the instruction trace window you should see trace data.
      Is MTB trace generally working when using Ozone + J-Link?

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/
    • hi,

      Can you please tell me how to initialize the MTB buffer pointer and overflow parameters before the actual program starts?
      In the case of Keil MDK IDE, I was able to set the parameters using the DBG_MTB.ini script, which is loaded by the Jlink debugger before jumping into the reset vector.

      In the case of Ozone, my guess is that the initialization script is written as described in Chapter 6 of the Ozone Manual, and is stored in *.jdebug file.
      How should I configure Ozone to use the modified script file for startup? I did not see any details on using a modified *.jdebug script file, only information is about implementing callback functions.

      Also, can you please tell me how to add a new device in the project? I have tried to add the SVD file in $INSTALL_FOLDER\Config\Peripherals and it does not appear in the drop down list for a new device project.
      I have attached an image for your reference.

      Thank you.
      Best Regards,
      Radhika
      Images
      • MTB5.JPG

        170.49 kB, 1,676×1,022, viewed 10 times
    • Hello,

      radhika.raghavendran wrote:

      Can you please tell me how to initialize the MTB buffer pointer and overflow parameters before the actual program starts?
      Not needed, J-Link does this automatically.

      radhika.raghavendran wrote:

      Also, can you please tell me how to add a new device in the project?
      Simply use the Ozone project wizard. If your device is already supported by J-Link select it from the device list. If not select Cortex-M0+ as the generic device name or add support yourself: wiki.segger.com/Adding_Support_for_New_Devices

      To enable MTB trace all you need to do is Tools->Trace Settings->Trace Source->Trace Buffer.
      If the MTB is correctly shown in the ROM table J-Link will initialize everything automatically.


      Best regards,

      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/
    • Hi,

      I was able to setup Ozone for my MCU and use Jlink with Ozone. After setting up MTB parameters like POSITION, OVERFLOW etc in the "AfterTargetReset ()" function of Ozone project file, I enabled trace using Tools->Trace Settings->Trace Source->Trace Buffer. When I click on the Debug button (Download and Reset on top left hand corner of Ozone IDE), get the error "ETB selected as trace source but current device does not have ETB". I am able to view the MTB setting in the memory window and also check the RAM area in memory window. The RAM area shows the branch and link addresses for the program being debugged. I have attached the images here.

      Our device is a Cortex-m0+ device having MTB capability, but on the left hand side bottom corner, I can see an error message saying "Reading Register 32 failed: Register is not implemented on connect CPU"

      Is there any way in which the trace log can be viewed in Ozone?

      Thank you.
      Best Regards
      Radhika
      Images
      • MTB6.JPG

        290.82 kB, 1,680×1,050, viewed 8 times
      • MTB7.JPG

        295.94 kB, 1,680×1,050, viewed 8 times
    • Hello Radhika,

      quick reminder. This forum is not a support forum. More information can be found in my forum signature.
      If you are looking for assistance to implement debug features for unreleased target devices we recommend contacting us using our official support channels. Especially as you seem to be working for a silicon vendor partner.
      You can file a ticket at segger.com/ticket
      This should simplify the communication process.

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/