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

UART bootloader fails at 1000000 baud with HWFC

I tried with the DK and my own USB-serial adapter and both fails at 1M with HWFC with this error:

nrfutil dfu serial -pkg bltest.zip --baud-rate 1000000 --flow-control 1 -p COM38

pc_ble_driver_py.exceptions.NordicSemiException: Did not receive checksum response from DFU target. If MSD is enabled on the target device, try to disable it ref.

I see many people saying it fails at 1M.  460800 works on the DK.  Is 1M supposed to work?  I set NRF_DFU_SERIAL_UART_RX_BUFFERS to 250 already.  In a test app I don't see any data corruption at 1M doing a loopback test.

Parents
  • The queue size should correspond to MTU and object size. In DFU object size is usually same to flash page size (4096B). 
    For example if your MTU == 64B the amount of buffers in queue needed is 4096/64 = 64 or more. This will buffer all DFU packets in RAM untill Object execute command received and DFU will have time to write all buffers to flash. Another solution could be playing with PRN and sending GetCRC requests by DFU host to give more time DFU target to sync. 
    If SD used in bootloader the NRF_FSTORAGE_SD_QUEUE_SIZE also should be increased to make DFU work on high baudrates. 
    For my case: 
    MTU = 128 B
    #define SCHED_QUEUE_SIZE  36

    #define NRF_DFU_SERIAL_UART_RX_BUFFERS 36

    #define  NRF_FSTORAGE_SD_QUEUE_SIZE 36


    The future plan is to find way to activate RTS from upper layer when few free buffers left and deactivate RTS when once all buffers processed. This will should work good on devices with limited RAM.  

Reply
  • The queue size should correspond to MTU and object size. In DFU object size is usually same to flash page size (4096B). 
    For example if your MTU == 64B the amount of buffers in queue needed is 4096/64 = 64 or more. This will buffer all DFU packets in RAM untill Object execute command received and DFU will have time to write all buffers to flash. Another solution could be playing with PRN and sending GetCRC requests by DFU host to give more time DFU target to sync. 
    If SD used in bootloader the NRF_FSTORAGE_SD_QUEUE_SIZE also should be increased to make DFU work on high baudrates. 
    For my case: 
    MTU = 128 B
    #define SCHED_QUEUE_SIZE  36

    #define NRF_DFU_SERIAL_UART_RX_BUFFERS 36

    #define  NRF_FSTORAGE_SD_QUEUE_SIZE 36


    The future plan is to find way to activate RTS from upper layer when few free buffers left and deactivate RTS when once all buffers processed. This will should work good on devices with limited RAM.  

Children
No Data
Related