This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

bootloader uart TX problem in DFU mode

Hi Nordic team,

I am trying to implement DFU over uart in nRF52832 using SDK 17.0.0. My device has nRF52832 and main MCU in it, and I would like to do DFU from main MCU. I managed to make nRF52832 enter to DFU mode and tried ping from main MCU. The nRF52832 gets the ping request packet and seems to send response back to main MCU but main MCU doesn't get the response. When I scoped the uart tx line, it doesn't appear any change in the hw line, while rx line works well as expected. But bootloader log says nrfx_uart_tx success.

I used /examples/dfu/secure_bootloader/pca10040_uart_debug project, and made some changes in sdk_config.h like this:

(1) NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED : 1 -> 0
(2) NRF_CRYPTO_BACKEND_NRF_SW_ENABLED : 1 -> 0
(3) NRF_CRYPTO_BACKEND_OBERON_ENABLED : 0 -> 1

Here's bootloader logs:

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

---- first ping from main MCU ----

<info> nrf_dfu_serial_uart: uart_event_handler
<info> UARTE: Transfer rx_len: 1.
<info> UARTE: Function: nrfx_uarte_rx, error code: NRF_SUCCESS.
<info> nrf_dfu_serial_uart: uart_event_handler
<info> UARTE: Transfer rx_len: 1.
<info> UARTE: Function: nrfx_uarte_rx, error code: NRF_SUCCESS.
<info> nrf_dfu_serial_uart: uart_event_handler
<info> UARTE: Transfer rx_len: 1.
<info> UARTE: Function: nrfx_uarte_rx, error code: NRF_SUCCESS.
<debug> nrf_dfu_serial: Received ping 1
<info> nrf_dfu_serial_uart: Allocated buffer 200016F0
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_PING
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x9, 0x1]
<info> nrf_dfu_serial_uart: rsp_send
<info> UARTE: nrfx_uarte_tx
<info> UARTE: Transfer tx_len: 5.
<debug> UARTE: Tx data:
<debug> UARTE: 60 09 01 01 C0 |` ...
<info> UARTE: nrfx_uarte_tx done. err_code=0x0
<info> UARTE: Function: nrfx_uarte_tx, error code: NRF_SUCCESS.

---- ping again a couple of seconds later ----

<info> nrf_dfu_serial_uart: uart_event_handler
<info> UARTE: Transfer rx_len: 1.
<info> UARTE: Function: nrfx_uarte_rx, error code: NRF_SUCCESS.
<info> nrf_dfu_serial_uart: uart_event_handler
<info> UARTE: Transfer rx_len: 1.
<info> UARTE: Function: nrfx_uarte_rx, error code: NRF_SUCCESS.
<info> nrf_dfu_serial_uart: uart_event_handler
<info> UARTE: Transfer rx_len: 1.
<info> UARTE: Function: nrfx_uarte_rx, error code: NRF_SUCCESS.
<debug> nrf_dfu_serial: Received ping 1
<info> nrf_dfu_serial_uart: Allocated buffer 200016F0
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_PING
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x9, 0x1]
<info> nrf_dfu_serial_uart: rsp_send
<info> UARTE: nrfx_uarte_tx
<warning> UARTE: Function: nrfx_uarte_tx, error code: NRF_ERROR_BUSY.
<error> nrf_dfu_serial: Failed to send data over serial interface! err=0x11

Please advise.

Thanks

Related