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

Extend Serial DFU

Hi,

as i mention in https://devzone.nordicsemi.com/f/nordic-q-a/44924/dfu-serial-failed i have f ramming error now and then when i do DFU over serial.

My idea was to write some code in nrf_dfu_serial_uart.c to make a better validation of data that was received, request a replay if the data was corrupted or send CRC back to the master and when the data is OK send it to the application. So in the uart_event_handler i would collect data and when the data is OK i would pass it to on_rx_complete.

That works fine. The issue i am having is:

  • on_rx_complete expects nrf_dfu_serial_t *p_transport which i don't have any more if i collect and validate the data in another part of the code. A workaround would be to save the last context in a global variable and send it to the function when the data is ready. Is this OK?
  • if the data is corrupted i would want to report this to the master but i could not send the message from uart_event_handler, i got error 17 from nrf_drv_uart_tx
  • I tried to implement UART driver with FIFO but then i have no UART context to send to on_rx_complete and nrf_dfu_serial_on_packet_received
  • if i would want to report the error from the main context i don't know where the application is at the point of the UART interrupt to send the message
  • if i use nrf_drv_uart_tx with buffer bigger then 1 and don't use nrf_delay_ms in between i get wrong bytes on the other end.

Do you have any suggestions?

I'm using nrf52840 with sdk15.2 and uart without HWFC.

Thanks

.

Parents Reply
  • Yes, this part works. But i have another issue. I was using pca10056_uart_debug and FOTA successfuly passed but the main application hangs on boot (i just got few lines from the main application in log). But when i use pca10056_ble_uart_debug the bootloader is to big and it didn't fit into the FLASH. So i turned off the LOG and then i could compile and flash the bootloader and the main application works. But i'm not happy that i have no logs. So i tried to turn off pca10056_ble_uart_debug becase i don't use ble in this project so i had to remove nrf_dfu_ble.c and nrf_dfu_settings_svci.c and set NRF_DFU_TRANSPORT_BLE to 0 i sdk_config.h but then i got the same result as with pca10056_uart_debug, the main application after few lines hangs. Any suggestions?


Children
Related