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

Softdevice

Hi 

For some reason I get stuck in the softdevice. I manage to capture the sequence of the addresses 

J-Link>s
0001B028:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
0001B02A:  18 47              BX      R3
J-Link>s
000008C4:  01 4B              LDR     R3, [PC, #+0x04]
J-Link>s
000008C6:  1B 68              LDR     R3, [R3]
J-Link>s
000008C8:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
000008CA:  18 47              BX      R3
J-Link>s
0001AFE0:  04 20              MOV     R0, #4
J-Link>s
0001AFE2:  71 46              MOV     R1, LR
J-Link>s
0001AFE4:  08 42              TST     R0, R1
J-Link>s
0001AFE6:  1B D1              BNE     #+0x36
J-Link>s
0001B020:  06 98              LDR     R0, [SP, #+0x18]
J-Link>s
0001B022:  05 99              LDR     R1, [SP, #+0x14]
J-Link>s
0001B024:  06 4B              LDR     R3, [PC, #+0x18]
J-Link>s
0001B026:  1B 68              LDR     R3, [R3]
J-Link>s
0001B028:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
0001B02A:  18 47              BX      R3
J-Link>s
000008C4:  01 4B              LDR     R3, [PC, #+0x04]
J-Link>s
000008C6:  1B 68              LDR     R3, [R3]
J-Link>s
000008C8:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
000008CA:  18 47              BX      R3
J-Link>s
0001AFE0:  04 20              MOV     R0, #4
J-Link>s
0001AFE2:  71 46              MOV     R1, LR
J-Link>s
0001AFE4:  08 42              TST     R0, R1
J-Link>s
0001AFE6:  1B D1              BNE     #+0x36
J-Link>s
0001B020:  06 98              LDR     R0, [SP, #+0x18]
J-Link>s
0001B022:  05 99              LDR     R1, [SP, #+0x14]
J-Link>s
0001B024:  06 4B              LDR     R3, [PC, #+0x18]
J-Link>s
0001B026:  1B 68              LDR     R3, [R3]
J-Link>s
0001B028:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
0001B02A:  18 47              BX      R3
J-Link>s
000008C4:  01 4B              LDR     R3, [PC, #+0x04]
J-Link>s
000008C6:  1B 68              LDR     R3, [R3]
J-Link>s
000008C8:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
000008CA:  18 47              BX      R3
J-Link>s
0001AFE0:  04 20              MOV     R0, #4
J-Link>s
0001AFE2:  71 46              MOV     R1, LR
J-Link>s
0001AFE4:  08 42              TST     R0, R1
J-Link>s
0001AFE6:  1B D1              BNE     #+0x36
J-Link>s
0001B020:  06 98              LDR     R0, [SP, #+0x18]
J-Link>s
0001B022:  05 99              LDR     R1, [SP, #+0x14]
J-Link>s
0001B024:  06 4B              LDR     R3, [PC, #+0x18]
J-Link>s
0001B026:  1B 68              LDR     R3, [R3]
J-Link>s
0001B028:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
0001B02A:  18 47              BX      R3
J-Link>s
000008C4:  01 4B              LDR     R3, [PC, #+0x04]
J-Link>s
000008C6:  1B 68              LDR     R3, [R3]
J-Link>s
000008C8:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
000008CA:  18 47              BX      R3
J-Link>s
0001AFE0:  04 20              MOV     R0, #4
J-Link>s
0001AFE2:  71 46              MOV     R1, LR
J-Link>s
0001AFE4:  08 42              TST     R0, R1
J-Link>s
0001AFE6:  1B D1              BNE     #+0x36
J-Link>s
0001B020:  06 98              LDR     R0, [SP, #+0x18]
J-Link>s
0001B022:  05 99              LDR     R1, [SP, #+0x14]
J-Link>ss
Unknown command. '?' for help.
J-Link>s
0001B024:  06 4B              LDR     R3, [PC, #+0x18]
J-Link>s
0001B026:  1B 68              LDR     R3, [R3]
J-Link>s
0001B028:  DB 68              LDR     R3, [R3, #+0x0C]
J-Link>s
0001B02A:  18 47              BX      R3
J-Link>s
000008C4:  01 4B              LDR     R3, [PC, #+0x04]
J-Link>s

I am using s132_nrf52_2.0.1_softdevice board pca10040 

Can you tell me why is that happening. Thanks in advance. 

  • Hi,

    You're stuck in the assert handling routine in the softdevice.

    Note that if you are in debug mode, and hit a breakpoint, single stepping through will cause a timing related assertion in the softdevice.

     

    If this is an assertion that occurs when running the firmware as normal, you can add the define "DEBUG" to your project and recompile/flash to enable blocking assertions so that you can get more detailed information on what and where the issue occurs.

    Best regards,

    Håkon

  • Maybe I'm missing something but... if we can't step through the program how are we supposed to debug it?

    All we can do is set breakpoints and inspect the program state. It's better than nothing but... this sounds like a big deal.

  • In debug mode: when you're hitting a breakpoint, you're halting the CPU, but not the peripherals running in the background. This means that all your timers, RTCs, UART, SPI, etc. are all still running and can potentially set events that leads to interrupts.

    This is what the softdevice does as well. it has it's own timekeeping to ensure things happen in a certain order, and if the order is mixed up; the softdevice will thrown an assertion to the application.

     

    There's quite a few threads on this subject already. Search for "debug softdevice" in the forum.

     

    Best regards,

    Håkon

Related