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

Debugging, NRF_LOG, Segger Embedded Studio Problems

I saw something in the list that might help but I have learned that if I go there I lose all the work I did to get here

I am having major problems with Segger Embedded Studio

  • NRF_LOG_x does not print either through the UART and putty OR RTT in SES [Manually set in the sdk_config.h file] since CMSIS Wizard is not present
  • The CMSIS Configuration Wizard is NOT present in my Tools.xml
  • Debug breakpoints are not hit unless it is in the main() part of main.c and when hit not in the code, only if a debug window to the left of the code
  • I can step line by line if I start and use F10/F11 from the start (do not use F5 and a break point) but never once I use F5 and a break point.

The only thing I can think of is that somehow the installation of SES got really corrupted or I am missing a major step. I have no idea how to fix.

Yet the code I have does partially run - it advertises, gets connected to, responds to service discovery, gets two characteristic descriptors enabled but then when I try and write from the client the write times out. I am not surprised that there are issues with the code as I have ported a SoftDevice only project from nRF51 and Keil.

But being unable to debug or even print to RTT (this is new for me) or via the UART and putty (the latter worked fine in the Keil project) is not helping.

Any help would be great. (Yes I have seen the debugging video and that's how I know my Tools.xml is corrupt).

  • The CMSIS Configuration Wizard is NOT present in my Tools.xml

    You can use Keil uVision to view & edit the sdk_coinfig.h:

    https://devzone.nordicsemi.com/f/nordic-q-a/67256/cmsis-in-segger-embedded-studio-doesn-t-open/275167#275167

    Also, conventional halting debug is not going to work with the SoftDevice:

    https://devzone.nordicsemi.com/f/nordic-q-a/48647/ble-debugging-on-nrf52/193088#193088

  • I can manually edit the sdk_config.h file in SES as well, and I have.My understanding is that the CMSIS Configuration Wizard should be present in my tools.xml file. But it is not. I added it but it did not help.

    I disagree with your statement about softdevice and debugging. I could step through my code in Keil and it is also using SoftDevice. I am NOT trying to debug SoftDevice, however, just my code that uses it.

  • As described in the link, uVision gives you the "graphical" view of the sdk_config.h - IMO, it does it much better than the CMSIS Wizard.

    Also described in the link, I'm suggest to use uVision purely for viewing/editing the sdk_config.h;  nothing else - not using it as your IDE.

    I am NOT trying to debug SoftDevice, however, just my code that uses it.

    That's right: if you halt your code, that halts the entire processor - so the SoftDevice will miss its deadlines, and will crash.

  • Interesting. I can set a break point in the nRF51 project using SoftDevice and I willl hit it (Keil). Of course the BLuetooth communications will fail but that's always the case as the peer timesout.

    This is the exact same code ported to Segger and s140 instead of s130 and Keil. There were a few changes I needed to make in the SodtDevice APIs but they were minor.

    So there is clearly something incorrect in your statement or your understanding. If I can stepwise debug in Keil using s130 I should be able to do the same in SES using s140. But something is seriously broken - I cannot print using NRF_LOG though I can print at the start using printf instead (but not once the Bluetooth runs). I see on my client that I get a connection event and service discovery, enable characteristics but the client times out on the first write. Setting a breakpoint on the connection event in SES does not work, Neither the NRF_LOG or printf statements work in the connection event handler.

    I thought life would be easier in s140 than s130 and SES. Not so.

  • Hi

    What steps did you take when porting your project to SES on your end? Have you checked out this guide explaining the SEGGER Embedded Studios IDE and I.E. how to import a Keil uVision project to SES? 

    I think you and Awneil are misunderstanding each other somewhat regarding debugging the SoftDevice. Yes, you should be able to set a breakpoint to halt the CPU while the SoftDevice is running, but this will as Awneil says, cause the SoftDevice to miss deadlines, and in turn crash the application. Please note that I don't think this is related to the issue at hand though, as I think the problem lies somewhere in the porting process. To ensure that your SES version is running properly, can you try one of the premade SES example projects in a newer SDK version? If not you might have to reinstall SES altogether.

    Best regards,

    Simon

Related