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

how can I debug nrf52832 by step

Hi I have run this example code nrf5_SDK_for_Mesh_v0.10.0-Alpha_src\examples\light_switch\client\light_switch_client_nrf52832_xxAA_s132_5_0_0.emProject

when I operate "Debug -- Go ", then press the button as follow picture, it run well. image description

image description

but when I operate "Debug -- Go", then press "F10" to run by step, it come out a problem of "Softdevice Assert", as follow picture. image description

I get some information from the develop zone : "Once you've enabled the SoftDevice you cannot halt the program as this will break the timing requirements of the SoftDevice and it will Hardfault."

Does this reason occure the problem, how can i debug by step.

Parents
  • Hi mark,

    The mesh stack uses the SoftDevice Timeslot API which requires it to yield its processing context back to the SoftDevice before its timeslot has ended. If you halt the program execution and step normally, the stack will exceed the allocated timeslot without yielding back to the SoftDevice. Upon stepping, the debugger re-enables interrupts and the SoftDevice asserts. A workaround is to step instruction-wise. In GDB this is si, in SEGGER Embedded studio, you click the "step into" button next to the disassembly output:

    image description

    Hope this helps,
    Thomas

Reply
  • Hi mark,

    The mesh stack uses the SoftDevice Timeslot API which requires it to yield its processing context back to the SoftDevice before its timeslot has ended. If you halt the program execution and step normally, the stack will exceed the allocated timeslot without yielding back to the SoftDevice. Upon stepping, the debugger re-enables interrupts and the SoftDevice asserts. A workaround is to step instruction-wise. In GDB this is si, in SEGGER Embedded studio, you click the "step into" button next to the disassembly output:

    image description

    Hope this helps,
    Thomas

Children
Related