Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Using IAR's SWO trace functionality on nRF52840

Hello. I have been stuck with this issue for a few days and now approaching a deadlock.

Basically, I want to achieve the following:

https://www.youtube.com/watch?v=s8M6B6uGbfQ

We at BAT are working on Nordic products for a quite a while and did not have SWO pin exposed. We do have it now on some custom dev boards. Of course we use RTT viewer as well but that is for print logs. Since our main IDE is IAR, we would like to achieve its full functionality.

To achieve code profiling, ITM (Instruction trace macrocell), and SWO trace, the SWO pin is enough. I have managed to send some data using ITM_SendChar(); and I can see the data on SWO Viewer. I cannot see anything on IAR'ss terminal window or the timeline window where I am expecting to see some graphs.

I have searched online but hardly found any tutorials for Jlink, but only I-jet. To get down to basics, I am now using the nRF52840 Dev board, and using its on board programmer. For sure SWO works, otherwise I could not see the data on SWO Viewer. 

i am using the simple blinky freeRTOS out of the box example. As you can see in screenshot, I do not see anything in SWO Trace Timeline:



For the SWo configuration, I am using the following values:


In the bottom left, I have tried a number of combinations, even what the SWO viewer tells me by default which is 64 MHz core clock and 6000 KHz SWo frequency:



I feel like I have exhausted my options would benefit from an expert from your side to help me out on this matter. We have some urgent issues to debug and we want to get past the traditional debugger pause and play as we have a dev board we can use SWO on.

Kind Regards

Ali

  • Hi Muhammad, 

    First of all, we are not so familiar with IAR compare to other IDE such as SES or KEIL. I'm having a trouble installing it because of some licensing issues. 

    Since the SWO interface works but not in the IAR trace debugging window, have you tried to contact IAR about the issue ? 

    I did a quick test here with Segger Embedded Studio and SWO trace seems to work for me. 



    I was testing with the chip on the DK. What I did was to add ENABLE_SWO to the preprocessor symbols 

    And select SWO in the target trace. 


    Do you have SES installed ? Could you quickly try this with the DK first and then if it works try with your custom board ? 

    If it works on SES I would think it should be very similar to set up on IAR. 

    I attached the project here, it's built with SDK v17.1 

    8814.blinky_rtc_freertos_SWO.zip

Related