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).

Parents
  • 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

Reply
  • 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

Children
  • I understand that anytime I set a break point in the middle of any transport protocol the transport is going to die, but the point is one CAN set a break point and at least analyze what is happening at that time. Currently I cannot set any break point and have it hit (such as in my Ble connection event handler). If I set a break point in the main function before the 'infinite loop' that will get hit.

    There is definitely something wrong in the setup of SES and the port. I have tried various things. Following the instructions for the port of Keil nrf51 projects failed but I am guessing it's because it is out of date with my latest SES download. Some of the interfaces referred to in the instructions no longer exist and some of the links in the instructions led to nothing - so there I had to guess.

    I tried to build some of the provided template projects (latest SDK - 17+)  to see if I could start with that but they failed to build. There were missing include files that I did not bother to chase down.

    However, I have been able to build and run the thermometer example. (I use my own client app which is well tested in the field for many health devices, both proprietary and standard as well as HDP). SO I have been playing with the various combinations of log settings in the SDK_config.h file to see what works and what doesn't. I have gotten NRF_LOG to work across the UART using putty (that's what I did for my Keil project) and I have gotten RTT to work. I have not yet tried setting breakpoints in the middle of the code yet.

    Out of real desperation I may start with this project and port that over to the sd_ only code of the Keil project (it would then be compatible with my pc-ble-driver nrf52840 dongle project like the Keil project is). That is a lot more work than I wanted to do but its how I started in Keil. The ugly thing is the direct port (with some changes in the sd_ APIs - very few) basically works. Something happens when the client tries to write - but I have been unable to debug or print in that project. Seems like I am so close yet frustratingly far.

Related