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

  • 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

  • Hi Edvin:

      Thanks for you help!!!Comment out this sentence (nrf_dfu_set_adv_name_init) it can run.

    Another new problem:

    Use jlink uart com8.It is successful.I went to measure PC TX pin. TX ouput:09 01 C0 ,09 02 C0...

     

    nrfutil.exe dfu serial -pkg app.zip -p COM8 -b 115200

    But use my uart com5. It failed and I went to measure pc-tx pin without any data output.

    nrfutil.exe dfu serial -pkg app.zip -p COM5 -b 115200

    I'm sure my uart tool hw is OK.

  • Can you please clarify what you mean? 

    Did you try to change the UART pins in the bootloader, and then it is not working anymore?

    How did you change the UART pins? did you change the RX_PIN_NUMBER and TX_PIN_NUMBER in the bootloader's pca10056.h file? And if you changed the UART pins, do you use flow control? If not, did you turn it off using NRF_DFU_SERIAL_UART_USES_HWFC 0 in sdk_config.h in the bootloader project?

    BR,

    Edvin

  • Hi Edvin:

    I mean to monitor TX and Rx of PC.

    If jlink serial port is used, its TX has data.TX ouput:09 01 C0 ,09 02 C0....

    If use my serial port, its TX has no data.

    nrfutil.exe dfu serial -pkg app.zip -p COM8 -b 115200 //jlink serial port
    nrfutil.exe dfu serial -pkg app.zip -p COM5 -b 115200 //my serial port

    I understand that PC will send data to nrf52840, wait for nrf52840 is response, and then conduct FW data.

    So I think changing JLINK to my serial also has data on its TX.

  • COM8 is PCA10056 serial port.

    COM5 is my serial port.

Related