Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

OTA over serial failure| sdk 15.2

Hello Everyone,

I am using nrf52832 and sdk 15.2 for ota over serial. I have made bootloader for OTA over UART and tested same with nrfutil using my dfu package file. firmware is upgraded successfully and  working fine.

Now I need to upgrade firmware using host MCU. I tried sending dfu package file( .zip ) to nrf52832 over UART using slip librairy to upgrade firmware but it is not working.

Is there any compulsion to send Ping packet, PNR, MTU Packet, init packet, application and bootloader separately over UART?

Can we send directly dfu package created through nrfutil to nrf52832 from other MCU over UART?

Kindly suggest me right approach.

Parents Reply
  • Hello Somesh,

    I have looked at your log and compared it to a log from nrfutil (attached)

    I am not sure whether the characters from your log are coming from your terminal or not, but e.g. the execute command is ended by 0xc0, whereas from nrfutil it uses only 04 (and not 04 c0). I see that it also doesn't reply to the CRC request. 

    Have you tried the pca10040_uart_debug project? In that project you can enable logging in the bootloader project. Have you tried to monitor that log to see whether it outputs any useful information? Alternatively to see whether it receives the CRC check event and the execute event?

    Best regards,

    Edvin

Children
  • Hi edvin,

    the command ended by 0xc0 is slip encoded thats why showing end byte. if we decode it results 0x04.

    I have not gone through pca10040_uart_debug project. the code size is greated than 32KB so not compiled in keil. I'll try on SES.

  • Sorry, I attached the wrong attachment in the previous reply. Attached the correct one now (but you have probably seen something similar when testing yourself.

    6305.nrfutil_dfu_log.txt

    Ok. Did you do any changes to the bootloader project that may affect the behavior of the CRC and EXECUTE commands? Or any other changes that can affect the bootloader?

  • Yes, I changed NRF_DFU_SERIAL_UART_RX_BUFFERS  to 10.

    Please check attached 5305.sdk_config.h file.

  • Did you test the pca10040_uart_debug bootloader with the logging turned on? 

    What does the bottom of the log from the bootloader say? (The log uses RTT Backend)

    In the case where I used nrfutil, it looks like this:

     0> <debug> app: Shutting down transports (found: 1)
     0> <info> nrf_dfu_serial_uart: Allocated buffer 2000311C
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x00033900, pending 0
     0> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
     0> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00033940, src=0x20003018, len=8 bytes), queue usage: 1
     0> <debug> app: Shutting down transports (found: 1)
     0> <info> nrf_dfu_serial_uart: Allocated buffer 2000311C
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x00033940, pending 0
     0> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
     0> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (data)
     0> <debug> nrf_dfu_req_handler: Offset:26952, CRC:0xC312551E
     0> <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
     0> <debug> nrf_dfu_serial: Sending Response: [0x3, 0x1]
     0> <debug> app: Shutting down transports (found: 1)
     0> <info> nrf_dfu_serial_uart: Allocated buffer 2000311C
     0> <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (data)
     0> <debug> nrf_dfu_req_handler: Whole firmware image received. Postvalidating.
     0> <debug> nrf_dfu_validation: Hash verification. Firmware start address: 0x2D000, size: 0x6948
     0> <debug> nrf_dfu_validation: Invalidating old application in bank 0.
     0> <debug> nrf_dfu_serial: Sending Response: [0x4, 0x1]
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 0
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, src=0x20002D48, len=348 bytes), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
     0> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007E000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007E000, pending 0
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007E000, src=0x20002EB4, len=348 bytes), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007E000, pending 0
     0> <debug> nrf_dfu_req_handler: All flash operations have completed. DFU completed.
     0> <debug> app: Shutting down transports (found: 1)
     0> <debug> app: Resetting bootloader.
     0> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
     0> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
     0> <info> app: Inside main
     0> <debug> app: In nrf_bootloader_init
     0> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
     0> <debug> nrf_dfu_settings: Settings OK
     0> <debug> app: Enter nrf_bootloader_fw_activate
     0> <debug> app: Valid App
     0> <debug> app: Enter nrf_dfu_app_continue
     0> <info> nrf_bootloader_wdt: WDT is not enabled
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x00026000, len=7 pages), queue usage: 0
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x00026000, pending 0
     0> <debug> app: Copying 0x2D000 to 0x26000, size: 0x6948
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00026000, src=0x0002D000, len=26952 bytes), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x00026000, pending 0
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 0
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, src=0x20002D48, len=348 bytes), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
     0> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007E000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007E000, pending 0
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007E000, src=0x20002EB4, len=348 bytes), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007E000, pending 0
     0> <debug> app: Setting app as valid
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 0
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, src=0x20002D48, len=348 bytes), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
     0> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007E000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007E000, pending 0
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007E000, src=0x20002EB4, len=348 bytes), queue usage: 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007E000, pending 0
     0> <debug> app: Resetting bootloader.
     0> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
     0> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
     0> <info> app: Inside main
     0> <debug> app: In nrf_bootloader_init
     0> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
     0> <debug> nrf_dfu_settings: Settings OK
     0> <debug> app: Enter nrf_bootloader_fw_activate
     0> <info> app: No firmware to activate.
     0> <debug> app: Enter nrf_dfu_app_is_valid
     0> <debug> app: Return true. App was valid
     0> <warning> nrf_dfu_settings: No additional data erased
     0> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
     0> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
     0> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
     0> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
     0> <debug> app: running irq table set
     0> <debug> app: After running irq table set
    

    It would be interresting to see what that log says in your case.

    Best regards,

    Edvin

Related