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

  • 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.

  • 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.

  • My serial port com5 cannot be used."Serial port could not be opened on COM5. Reason: None".

    PCA10056 serial port com8 can be use,"No ping response after opening COM port".

  • Can you please explain what is connected to COM5? Is it the other USB cable on the DK, or is it an external UART to USB device? Or did you plug the TX and RX pin of the DK directly into your computer (Of course I understand that you didn't, but I want to emphasize what I do not understand).

    Perhaps you can show me a photo of what you have connected between the DK and the computer? If you are using the other USB port on the DK, that will not work, because that is not connected to the UART. 

    Best regards,

    Edvin

  • I try to use the COM5 connection PIN30/31 for DFU.

    Like this:

Reply Children
  • Have you successfully been able to use this UART device (the USB dongle plugged into COM5 with UART previously in another application?

    Since it only says that it is not able to open the COM port, it sounds like it is not really an nRF issue. Are you sure that this 3rd party module is working correctly? Are you sure that COM5 is not opened in any other application?

    BR,
    Edvin

Related