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

debug session doesn't stop at main

Hi

I am trying to debug the "ble_app_hrs" example from SDK 6.1.0 (using keil IDE), on 51822 chip. The IROM1 is defined to start at 0x16000 (meant to be used with softdevice). when I start the debug session, the debugger doesn't stop at "main" (even with a breakpoint). The only solution I have found is to set IROM1 to 0x0, and than debugger stops at main and I am able to single step.

Is there a way to debug without changing IROM1 definitions?

  • Hi.

    Did you remember to program the actual SoftDevice onto your board?

    If yes, what softdevice did you use? When using SDK 6.1.0 you can chose to use softdevice 7.0.0 or 7.1.0 as described in the Compatibility matrix.

    If you didn't and you have never done it before you can have a look at this tutorial to learn how: Setting up an example project on the nRF51 DK

    EDIT:

    If you are going to run a ble example you cannot change the IROM1 settings. If you set it to 0x0 Keil will try to overwrite the softdevice when programming your application to your board. You can easily see what IROM1 value you should use using nRFgo Studio as seen in this image: image description

    If there is a mismatch between these values you will either get an error when Keil tries to overwrite you SoftDevice or your ble example won't work at all. So I assume you have double checked these values?

    If you run your ble_app_hrs example as usual (i.e. without stopping it in debugging mode) does it work as expected?

  • Hi Martin.

    First, thanks for the quick response. I am aware that I cannot change the IROM1 settings in order to run a ble example , but that is not the issue. I want to be able to single step inside the debugger in order to better understand certain functions. I do not need the actual ble service (and that's why I don't need to load the softdevice).

    I just wondered if there is a way to do this without changing IROM1 settings. Thanks again Yaron

  • I'm sorry for the confusion. So if I understand you correctly:

    • You want to debug the code in the ble_app_hrs example, but you want to do it without running the bluetooth stuff?
    • Are there any functions in particular that you want to understand?
    • You can set breakpoints in your code, but the debugger runs past them? Or is the problem that the debugger never reach them?
  • Hi Martin

    "You want to debug the code in the ble_app_hrs example, but you want to do it without running the bluetooth stuff?" - correct

    "You can set breakpoints in your code, but the debugger runs past them? Or is the problem that the debugger never reach them?" - I can set breakpoints, but it seems that the debugger never reaches tham

  • Hi If you don't want to change the IROM settings you will need to have the SoftDevice installed. But you can comment out all ble related stuff in main() and then you should be able to step through the code in debug mode. You can also, as you have already tried, remove the SoftDevice and set the IROM address to 0x0.

Related