This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ble_app_template always end at SVC_Handler

Hi !

I'm using an nRF52 on PCA10040 board and nRF5_SDK_11.0.0_89a8197. I want to run the peripheral ble_app_template with SEGGER Embedded Studio v2.20. I correctly set the FLASH (0x1c000) and RAM (0x20002080) START address in the linker options. J-Link correctly downloads both SoftDevice and application (checked with nRFgo Studio).

After it reaches ble_stack_init() the program hangs in SVC_Handler.

I tried both s132_nrf52_2.0.0_softdevice.hex and s132_nrf52_2.0.1_softdevice.hex with the same results.

  • Where exactly in ble_stack_init() does the program hang? There are several function calls in there that might return an error and halt your application. I tried the example in SES and also ended up in SVC_Handler. After running the debugger I found out that the solution was to set RAM START address at 0x20001FF8, not 0x20002080.

  • Hi ! thanks for helping me, here is the call Stack :

    1. ble_stack_init()
    2. softdevice_handler_init()
    3. sd_softdevice_enable()
    4. SVC_Handler()

    How do I know the softdevice's RAM requirement ? InfoCenter only give the minimum value

    (I tried 0x20001ff8, same result)

  • Based on your call stack my guess is that something is wrong with your 32 kHz clock configuration. sd_softdevice_enable() takes a parameter that needs to be populated with information about your clock. Are you using a devkit? If you are working on a custom board do you have an external crystal? There are lots of cases here on devzone regarding code hanging in sd_softdevice_enable(). Most often the issue is wrong clock configuration.

    Regarding the RAM requirement; it is a little tricky, but the SDK has implemented a debug feature using either SEGGER RTT or UART. If you use this feature the RAM settings will be printed out to your terminal.

  • I'm using the DevKit PCA10040

    SEGGER RTT is enabled but I get nothing (I tried to output a helloworld to test the debug feature with NRF_LOG() and it works fine)

  • What PCA10040 version do you have? Can you compare the kit version, with the IC version and check if you use a compatible SDK and SD?