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

SDK 13.0.0: Secure serial DFU without flow control

I am using a bootloader based on the secure serial DFU bootloader example in SDK 13 and tested it on a development kit. I noticed that hardware flow control is enabled in both the bootloader code and the nrfutil Python code. However, the custom hardware of the project does not have hardware flow control lines connected. A few tests showed that disabling the CTS input on the chip is not a problem, but disabling its RTS output caused nrfutil to fail regardless of whether hardware flow control is enabled in the nrfutil Python code.

How can the bootloader and/or nrfutil be adapted so that only the serial protocol is used to time the transmissions, without breaking the firmware upload process?

Parents
  • It should be possible to modify both the serial bootloader and nrfutil to not use HWFC aslong as the baudrate is not to high.

    In the experimental_bootloader_secure_serial project you will have to modify the serial_dfu_transport_init() function in nrf_serial_dfu.c to not enable HWFC and set the baudrate to 9600, i.e.

    nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG;
    
    uart_config.pseltxd            = TX_PIN_NUMBER;
    uart_config.pselrxd            = RX_PIN_NUMBER;
    uart_config.pselcts            = CTS_PIN_NUMBER;
    uart_config.pselrts            = RTS_PIN_NUMBER;
    uart_config.hwfc               = NRF_UART_HWFC_DISABLED;
    uart_config.baudrate           = 2576384; // Corresponds to 9600 baud
    uart_config.p_context          = &m_dfu;
    

    Similarly you will have to modify the DfuTransportSerial class in nordicsemi\dfu\dfu_transport_serial.py in the nrfutil source

    class DfuTransportSerial(DfuTransport):
    
        DEFAULT_BAUD_RATE = 9600 #115200
        DEFAULT_FLOW_CONTROL = False #True
    

    Make sure that you run the setup.py script after you have modified the nrfutil source, i.e.

    python setup.py build
    
  • Hi tvdstaaij, I am trying to do the same using a custom board with no luck It. I followed the steps by Bjørn to disable the hardware flow control and still it is not working :(

    I am using just TX/RX connected a nRF52832. I repeat all the process using the DK module and it works but not in the custom board (it was working fine the only issue is with the Serial DFU)

Reply Children
No Data
Related