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

nrf52840 BLE not working

Hi,

We have recently switched from using nrf52810 to nrf52840. Firmware porting went well until we tried using the BLE on nrf52840. No matter what we try the BLE will not start advertising. Even BLE examples in the SDK don't work ( tried ble_app_uart, ble_app_template,ble_app_hrs  ). When I flash softdevice (s140 provided in the sdk) and then the compiled example the BLE will not start. We never had these problems when working with the nrf52810 s112 sd. I have gone over the documentation and can't find any other reason why it will not work. All other peripherals (I2C, SPI, UART, even the proprietary ESB) works fine as long as I don't use the s140. The SDK version we used was 15.3.0. I've tried upgrading to 17.0.2  but the same result. The MCU seems to be unable to start the flashed FW with the s140 sd. Has anyone else ran into this issue?

Our board does not have an external crystal, but nrf52810 BLE worked fine on the internal RC osc. Has that changed?

  • I've double checked that both for our code and for the examples, the values match the ones in the documentation for the s140 sd. I'm at my wits' end.

  • Hi, 

    The MCU seems to be unable to start the flashed FW with the s140 sd.

    The typical reason for this is that the 32.768 kHz crystal is configured but not present. I see you write that you have changed this in sdk_config.h, but can you clarify which changes you have made in sdk_config.h? You should set NRF_SDH_CLOCK_LF_SRC to 0, NRF_SDH_CLOCK_LF_ACCURACY to 1, NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 2 and NRF_SDH_CLOCK_LF_RC_CTIV to 16.

    Have you done any debugging to see what happens? If you make a debug build and put a breakpoint in the start of you main function it would be interesting to see if it is reached. If it is not, the first thing you should double check is that you actually have programmed the  SoftDevice.

  • Hi,

    The MCU seems to be unable to start the flashed FW with the s140 sd.

    The typical reason for this is using the 32.768 kHz as mentioned. In that case you would not be able to initialize the SoftDevice. How did you configure your sdk_config.h? You should set NRF_SDH_CLOCK_LF_SRC to 0, NRF_SDH_CLOCK_LF_RC_CTIV to 16, NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 2 and NRF_SDH_CLOCK_LF_ACCURACY to 1.

    If the clock configuration issue is not the problem it would be interesting to verify if your application runs at all. What happens if you make a debug build and set a breakpoint in the beginning of your main function? Is the breakpoint reached? If not, please double check that you have programmed a SoftDevice. Forgetting to do so is a typical mistake.

    If neither of the above is the problem then we need to dig deeper.

  • I had NRF_SDH_CLOCK_LF_RC_CTIV set to 32 but I tried it with 16 and the same result. I have changed all of the other parameters you mentioned. During debugging the code starts to execute but when it reaches the SD_SOFTDEVICE_ENABLE function it jumps to 0xaca in the memory and stays there until the WDG triggers a reset. If the WDG is disabled it will hang there forever.

  • I see. Which exact SDK example project do you test with (e.g. <SDK17.0.2>\examples\ble_peripheral\ble_app_uart\pca10056\s140\ses\ble_app_uart_pca10056_s140.emProject)? And which exact toolchain version do you use (like SES 5.30a or something else)?

Related