This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RTT viewer sometimes works, sometimes does not. No determinism?

I am using RTT to debug my application and it's fine when it's working. The problem is that it seems to be flaky as hell. Sometimes it just stops working without any apparent reason, I can't see a single print in the SEGGER J-Link RTT Viewer.

By testing random combinations of reseting the target, power cycling it, reprogramming the firmware etc the RTT sometimes starts working again. Whenever I do small change in my app and need to reprogram the fw, there is about 50/50 chance that the RTT will go mute. 

This makes development and debugging really, really painful. Does anybody have any tips how to make sure that RTT is not screwed? Is there some known order how things need to be started to make it more stable?

My J-Link RTT Viewer is version V5.12f. Sometimes hitting F2 / F3 to connect / disconnect repeatedly seems to help, but currently I can't get anything out of the RTT no matter what I try.

I have also tried debugging in Segger Embedded Studio (V4.18). Debugging and flashing seems to work quite OK, so I don't think there's anything wrong in my debugger connection. The cabling and J-Link drivers etc should be ok (I'm working with a custom board based on nRF52832).

There does not seem to be any usable RTT viewer integrated into SES. If you open J-Link Control Panel inside SES then there is the RTT tab that seems completely useless. See screenshot below:

 

The RTT viewer in SES has a tiny textbox that can barely fit one line of text. And it cannot be resized?! Seems like completely useless tool for any real work.

I hope I am just missing some trick in my build/program/debug cycle that is preventing the RTT to work properly. The error should not be in the firmware itself, because sometimes the RTT prints are working and sometimes not. 

Any help appreciated!

Parents
  • Here's one practical example of odd behavior:

    I have a working project in SES that is based on the FreeRTOS HRS example from SDK. I programmed the example to my custom board as follows:

    1) do full chip erase (nrfjprog -e)

    2) program the soft device (nrfjprog -f nrf52 --program s132_nrf52_7.0.1_softdevice.hex )

    3) program the app (nrfjprog -f nrf52 --program ble_app_hrs_freertos_pca10040_s132.hex )

    4) finally, did a pin reset (not sure if necessary) nrfjprog -f nrf52 --pinreset

    All commands passed without any errors. But the RTT viewer is not showing anything. And I can't see the device advertising, so I doubt that the fw is running properly.  (I updated to RTT viewer V6.50b but that did not help at all)

    Now the weird part: if I launch the program in debug mode via SES, everything seems to work normally. I don't get what is wrong with the first attempt, when I program the softdevice and application manually using nrfjprog. I'm using same hex files as in the SES project. 

    Because the project works fine when launched via SES in debug mode, I think that the fw itself must be OK. But there is something wrong in the sequence when I want to flash and run the program from command line, using nrfjprog. 

Reply
  • Here's one practical example of odd behavior:

    I have a working project in SES that is based on the FreeRTOS HRS example from SDK. I programmed the example to my custom board as follows:

    1) do full chip erase (nrfjprog -e)

    2) program the soft device (nrfjprog -f nrf52 --program s132_nrf52_7.0.1_softdevice.hex )

    3) program the app (nrfjprog -f nrf52 --program ble_app_hrs_freertos_pca10040_s132.hex )

    4) finally, did a pin reset (not sure if necessary) nrfjprog -f nrf52 --pinreset

    All commands passed without any errors. But the RTT viewer is not showing anything. And I can't see the device advertising, so I doubt that the fw is running properly.  (I updated to RTT viewer V6.50b but that did not help at all)

    Now the weird part: if I launch the program in debug mode via SES, everything seems to work normally. I don't get what is wrong with the first attempt, when I program the softdevice and application manually using nrfjprog. I'm using same hex files as in the SES project. 

    Because the project works fine when launched via SES in debug mode, I think that the fw itself must be OK. But there is something wrong in the sequence when I want to flash and run the program from command line, using nrfjprog. 

Children
No Data
Related