nrf52840 bootloader(UART)+Buttonless+s140_nrf52_7.2.0_softdevice.hex cannot work

Hi:

Use sdk nRF5_SDK_17.1.0_ddde560, Borad PCA10056

1,

Bootloader(pca10056_uart_debug)+App(ble_app_buttonless_dfu)+s140_nrf52_7.2.0_softdevice.hex cann't work.

2,

Bootloader(pca10056_s140_ble_debug)+App(ble_app_buttonless_dfu)+s140_nrf52_7.2.0_softdevice.hex It can work.

Attachments include dfu_public_key.c and private.pem, etc...

uart_dfu.zip

Parents
  • Hello,

    Try to comment out the line saying:

    ret_val = nrf_dfu_set_adv_name_init();

    in ble_dfu_unbonded.c

    What this function does is that it tells the bootloader to use a specific advertising name. The problem is that when your bootloader doesn't use DFU this function call will cause the application to crash. 

    It should be fine after you remove this line. But please remember that you removed it, in case you are building a BLE bootloader later, because removing this may cause the BLE bootloader to not work properly on iOS devices. 

    The reason that the ble_app_buttonless_dfu example doesn't work with the UART bootloader out of the box is that it is intended to be used with a BLE bootloader, so that you don't physically need to interact with it (press a button).

    When you are using the UART bootloader, you can either put it in bootloader mode by pressing the Button4 (NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN from bootloader project's sdk_config.h) while resetting the device.

    Typical use cases for UART DFU is either that you have an external MCU that will transfer the UART packets, or that you use a serial connection to the computer. In the first case, you could wire up another pin from the external MCU to the reset pin. In either case, an alternative method could be to use a special UART command to reset the device and set it in DFU mode.

    But if you want to use the buttonless_dfu service, that is just fine. Just remove the nrf_dfu_set_adv_name_init() function.

    Best regards,

    Edvin

Reply
  • Hello,

    Try to comment out the line saying:

    ret_val = nrf_dfu_set_adv_name_init();

    in ble_dfu_unbonded.c

    What this function does is that it tells the bootloader to use a specific advertising name. The problem is that when your bootloader doesn't use DFU this function call will cause the application to crash. 

    It should be fine after you remove this line. But please remember that you removed it, in case you are building a BLE bootloader later, because removing this may cause the BLE bootloader to not work properly on iOS devices. 

    The reason that the ble_app_buttonless_dfu example doesn't work with the UART bootloader out of the box is that it is intended to be used with a BLE bootloader, so that you don't physically need to interact with it (press a button).

    When you are using the UART bootloader, you can either put it in bootloader mode by pressing the Button4 (NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN from bootloader project's sdk_config.h) while resetting the device.

    Typical use cases for UART DFU is either that you have an external MCU that will transfer the UART packets, or that you use a serial connection to the computer. In the first case, you could wire up another pin from the external MCU to the reset pin. In either case, an alternative method could be to use a special UART command to reset the device and set it in DFU mode.

    But if you want to use the buttonless_dfu service, that is just fine. Just remove the nrf_dfu_set_adv_name_init() function.

    Best regards,

    Edvin

Children
Related