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

How to get started creating a TWI bootloader

I need to update firmware in an nRF52 via TWI. It seems like it would be fairly easy to modify the serial bootloader/DFU provided with the SDK, but I'm not finding the code that actually communicates over the serial port. 

Is there a guide to modifying the transport layer? If not, can you point me to low level code that reads and writes the serial port?

I'm looking at the open bootloader because I don't need the security features.

Thanks,

Bill

Parents
  • Hi Bill, 

    Is there a guide to modifying the transport layer? If not, can you point me to low level code that reads and writes the serial port?

     I am afraid that we do not have a guide on how to add a custom transport layer to our Secure Bootloader. The code that receives the data over the serial interface is found in nrf_dfu_serial_uart.c. This is where the DFU_TRANSPORT_REGISTER macro is used to register the transport layer and define the init and close functions for said transport layer.  The received commands/data is processed by on_rx_complete() which decodes the slip packet and passes it to nrf_dfu_serial_on_packet_received() in nrf_dfu_serial.c, which processes the request inside the slip packet and passes it on to the nrf_dfu_req_handler_on_req().

    So in short, its only the nrf_dfu_serial_uart.c/h files that you would have to replace with  nrf_dfu_serial_twi.c/h.

    Best regards

    Bjørn

Reply Children
Related