This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52832 DFU over UART

Hello,

I'm using nRF52832 and the SDK version is "nRF5_SDK_17.0.2_d674dde" ,

First I tried DFU over UART using \examples\dfu\secure_dfu_test_images\uart\nrf52832, and it worked fine

but when I tried to rebuild the source code \examples\dfu\secure_bootloader\pca10040_uart\ses and do the same steps as above,then it doesn't work

I can't see my device in nRF Connect anymore, and J-Link RTT Viewer doesn't show any log

what is the different betweet example bootloader hex and the bootloader hex I rebuilt

Parents
  • Hi,

    The pre-built example projects (including bootloader) also includes the SoftDevice or MBR hex if needed, and the serial bootloader depends on the MBR. This has been accomplished by merging all the needed hex files. In this case, in addition to the bootloader you built you also need the MBR from <SDK>\components\softdevice\mbr\hex\. You can either program them separately, or merge them together using mergehex (from nRF Command Line Tools) and then program.

    PS: The Segger embedded studio bootloader projects has the MBR as an additional load file, so if you program from Segger Embedded Studio the MBR will be programmed automatically. This is also the case for projects that depend on the SoftDevice.

  • Hi,

    as you said , what I'm using now is segger embedded studio bootloader projects but after rebuild source code , then i mergeing application , softdevice , bootloader together ,and program into my device , it doesn't work.

    and I also have tried to merging MBR from \components\softdevice\mbr\hex\mbr_nrf52_2.4.1_mbr.hex into hex,then program , it doesn't work too 

  • I see. Can you say more about how it does not work? Please test with the debug bootloader project (\examples\dfu\secure_bootloader\pca10040_uart\_debug), which has RTT logging. As long as you program this and a SoftDevice or MBR, you should get RTT logs from the bootloader which hopefully gives some clues about what is going on.

Reply
  • I see. Can you say more about how it does not work? Please test with the debug bootloader project (\examples\dfu\secure_bootloader\pca10040_uart\_debug), which has RTT logging. As long as you program this and a SoftDevice or MBR, you should get RTT logs from the bootloader which hopefully gives some clues about what is going on.

Children
  • Hi,

    it does not work when I build \examples\dfu\secure_bootloader\pca10040_uart\ses , I can not found my device in nRF connect mobile App.

    and then I tried to build \examples\dfu\secure_bootloader\pca10040_uart_debug\ses, it worked 

    I don't know what happened to the bootloader project without debug

  • Hi,

    Did you flash SoftDevice or MBR? I ask because I did not notice before that you were using BLE in the application, but as you are using nRF connect mobile App and cannot find it there, I assume that is the application using BLE. If so, you need to flash the SoftDevice. The debug project and "normal" project should be more or less the same except for logging, so please double check that. If it does not work, perhaps you can explain in detail step by step how you build, program and test everything?

  • Hi 

    I decided to test the next step with the debug version first,

    I have a problem......

    Here are my test steps

    1. Generate bootloader setting

    2. Merge bootloader with bootloader_setting and the application and the softdevice

    3. Flash the device

    4. Send command to return in the bootloader and to switch in DFU mode

    5. Enter the following command to start the DFU process over the serial link

         nrfutil dfu serial -pkg 1234567.zip -p COM4 -fc 0 -b 115200

    here is the log

    00> <info> app: Inside main
    00> <debug> app: In nrf_bootloader_init
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00> <debug> nrf_dfu_settings: Using settings page.
    00> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00> <info> app: No firmware to activate.
    00> <debug> app: App is valid
    00> <warning> nrf_dfu_settings: No additional <info> app: Inside main
    00> <debug> app: In nrf_bootloader_init
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00> <debug> nrf_dfu_settings: Using settings page.
    00> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00> <info> app: No firmware to activate.
    00> <debug> app: App is valid
    00> <debug> app: DFU mode requested via GPREGRET.
    00> <info> nrf_bootloader_wdt: WDT is not enabled
    00> <debug> app: in weak nrf_dfu_init_user
    00> <debug> app: timer_stop (0x20000024)
    00> <debug> app: timer_activate (0x20000024)
    00> <info> app: Entering DFU mode.
    00> <debug> app: Initializing transports (found: 1)
    00> <debug> nrf_dfu_serial_uart: serial_dfu_transport_init()
    00> <debug> nrf_dfu_serial_uart: serial_dfu_transport_init() completed
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00> <debug> app: Enter main loop

    After the fifth step I got nothing until device auto leaves DFU mode

    Did I miss something?

  • Hi,

    This log shows that the devices entered DFU mode, but it doe snot show that a DFU operation has been started. You write that you attempted to update using the "nrfutil dfu serial -pkg 1234567.zip -p COM4 -fc 0 -b 115200" command, but there is no trace of it in the log. Can you try again, and make sure you do it after you see in the log that the nRF is in DFU mode? What happens then? And what is the output you get from nrfutil?

  • Hi,

    I've finally done DFU over UART, but have some questions I'd like to know,

    after I using the "nrfutil dfu serial -pkg 1234567.zip -p COM4 -fc 0 -b 115200" command, it takes at least 20 seconds before the DFU process starts, no log is displayed during these 20 seconds,I want to know why it takes so long to wait 20 seconds?

Related