nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Flashing the code to nRF52832 BLE module.

Hi, I need some help on flashing the code to nRF52832 BLE module.
I would like to mention that I am flashing the code to nRF module using ST-link v2 debugger with the help of open-OCD tool.
Whenever, I flash the example hex file provided by nordic (i.e. ble_app_uart_pca10040_s112.hex file), it is flashed successfully and I could see "Nordic_UART" while scanning for BLE.
However, when I try to flash my custom nRF application, only on repetitive flashing I could see the BLE advertisement.
May I know why it occurs this way? i.e. only after flashing the same code multiple times, it's working?
Please help. Thanks in advance.

Parents Reply Children
  • Perhaps you are not flashing the softdevice? I don't know what softdevice your application is using, but I guess it is either S132 or S112 (you should be able to tell from your project settings. If not, let me know what example your application started from).

    Try flashing the softdevice before flashing your application. The softdevices are found in (depending on which one you are using):

    SDK\components\softdevice\s132\hex\s132_nrf52_7.2.0_softdevice.hex

    SDK\components\softdevice\s112\hex\s112_nrf52_7.2.0_softdevice.hex

    (the softdevice version, which is 7.2.0 may differ from your case, depending on what SDK version you are using. These names are from SDK17.1.0).

    Best regards,

    Edvin

  • Thank you for the response. 

    Yes, I'm using S112 softdevice, and SDK17.1.0 only.  I'm using ble_app_uart example. 

    As you suggested, I tried flashing the softdevice from SDK\components\softdevice\s112\hex\s112_nrf52_7.2.0_softdevice.hex and then flashed my application. But no changes were seen. It shows chip is programmed and target has been reset but BLE broadcasting is not seen.

  • Did you do any modifications to the application (ble_app_uart)? How do you flash the .hex files? And where exactly do you find the .hex file for the application?

    And you are sure that the flash is not erased between flashing the softdevice and the application? 

  • Hi, thank you for your response.

    Yes, modifications are made in ble_app_uart application. I am flashing the hex file to nRF52832 module using ST link v2 debugger with the help of open OCD tool. 

    In nRF5SDK, I'm taking the hex file from the location: examples\ble_peripheral\ble_app_uart\pca10040\s112\ses\Output\Release\Exe

    And you are sure that the flash is not erased between flashing the softdevice and the application? 

    I am not sure how to verify this, may I know how can I ensure that the flash is not erased?
    Thank you!

  • Sorry for the late reply. I was out of office last week. 

    I am not familiar with the open OCD tool, but I guess you don't actively erase the chip between programming the softdevice and the application. 

    Have you tried debugging the application? Is your main() function reached? Do you see any log output? I guess RTT Logging isn't supported over ST Link by default.

    What UART pins is your application using? Are the UART pins connected to anything? If not, perhaps you can try to comment out uart_init() and see if the behavior changes. (The application may crash if the UART's RX pin is left floating). 

    Please let me know if you have access to debugging and/or any logs.

    BR,
    Edvin

Related