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

Porting nRF52833 code to BL653

Hi,
I have a firmware that runs well on nRF52833 dev kit (SDK 17.02) and I am trying to port it to a Laird BL653 dev kit.
The firmware has a bootloader and it can perform DFU over Bluetooth.

The main difference between the nRF52833DK and the BL653 board is that the BL653 module does not use a crystal so I changed the following in sdk_config.h:


NRF_SDH_CLOCK_LF_SRC 0
NRF_SDH_CLOCK_LF_RC_CTIV 16
NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
NRF_SDH_CLOCK_LF_ACCURACY 1
NRFX_CLOCK_CONFIG_LF_SRC 0
CLOCK_CONFIG_LF_SRC 0

If I apply these changes to the nRF52833DK it works fine.


After loading bootloader and softdevice on BL653, I can connect to DFU_Targ and send the ZIP package.
It all works fine until I power cycle the board, then Bluetooth stops advertising (but the microcontroller still executes my code).
The only way to restore the Bluetooth is by pressing the reset button.
Can anyone suggest where I should focus my attention?


I am quite new to Nordic devices so for this first project I hired a developer which did a good job but has not been able to help me with this issue.

Parents
  • Can anyone suggest where I should focus my attention?

    Use the debugger to step through your code and see where it's going wrong.

    As you have a working and a non-working version, you can compare the two - see where they differ...

    I apply these changes to the nRF52833DK it works fine

    Have you checked that it isn't still actually using the crystal ?

  • Hi awneil, thanks for your answer.

    Use the debugger to step through your code and see where it's going wrong.

    As soon as I start the debug session, Bluetooth comes back to life.

    So I decided to save the err_code generated by nrf_sdh_enable_request()

    static void ble_stack_init(void) {
      ret_code_t err_code;
      err_code = nrf_sdh_enable_request();
      ERROR_LOG = err_code; // Storing err_code in a global variable
      APP_ERROR_CHECK(err_code);


    And send it out trough the serial port

    NRF_LOG_RAW_INFO("%d", ERROR_LOG)

    When I power the board, this is what comes out from the serial: 0000000000

Reply
  • Hi awneil, thanks for your answer.

    Use the debugger to step through your code and see where it's going wrong.

    As soon as I start the debug session, Bluetooth comes back to life.

    So I decided to save the err_code generated by nrf_sdh_enable_request()

    static void ble_stack_init(void) {
      ret_code_t err_code;
      err_code = nrf_sdh_enable_request();
      ERROR_LOG = err_code; // Storing err_code in a global variable
      APP_ERROR_CHECK(err_code);


    And send it out trough the serial port

    NRF_LOG_RAW_INFO("%d", ERROR_LOG)

    When I power the board, this is what comes out from the serial: 0000000000

Children
No Data
Related