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
    
  • EDIT: I found it. From the install directory /usr/lib/python2.7/site-packages/nordicsemi (in my case), run

    pip install -r setup.py
    pip install -r requirements.txt
    

    Then run the build command as described from the same directory.

    Hi Bjorn, I've just installed nrfutil version 3.4.0 on my embedded linux system using "pip install nrfutil". I've made the edits required, but when I try "python setup.py build", I get an error that no setup.py file exists. Has that file name changed, or do I need to find it somewhere...? Please advise.

Reply
  • EDIT: I found it. From the install directory /usr/lib/python2.7/site-packages/nordicsemi (in my case), run

    pip install -r setup.py
    pip install -r requirements.txt
    

    Then run the build command as described from the same directory.

    Hi Bjorn, I've just installed nrfutil version 3.4.0 on my embedded linux system using "pip install nrfutil". I've made the edits required, but when I try "python setup.py build", I get an error that no setup.py file exists. Has that file name changed, or do I need to find it somewhere...? Please advise.

Children
No Data
Related