Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

DFU via CAN-spi

To update the Application, it is necessary to implement the update via CAN bus. Below is the hardware part, we use a CAN-SPI chip to access the bus.

We´ra using Microchip´s MCP25625 Controller withSerial Peripheral Interface (SPI), connected to nRF52832 in this way:

I saw that there is a serial_dfu in the loader (nRF5_SDK_XXXX \ components \ libraries \ bootloader \ serial_dfu), but this is not exactly what we need, since the serial interface is just a wrapper over the CAN. Could you please share example/ideas of how the easiest way for us to update the application through the CAN?

I understand that this will be a custom solution, but perhaps someone has already done something similar.

in idal, we would like to simplify this process as much as possible and transfer the hex file and not the dfu archive if possible..

SDK17.1.0 and SoftDevice s332_nrf52_7.0.1 are used

  • Hi,

    in idal, we would like to simplify this process as much as possible and transfer the hex file and not the dfu archive if possible..

    The bootloader does not work on .hex files. That is also typically not used by other bootloaders either, as that would mean you would have to decode the .hex file (which is Intel HEX) into a binary etc. What you need to transfer if using something based on the nRF5 SDK bootloader is the application image as a raw binary and the init packet. Those are found as separate files inside the DFU .zip archive.

    Could you please share example/ideas of how the easiest way for us to update the application through the CAN?

    If you base this on the SDK bootloader, then I would take the serial bootloader example and modify it to use CAN bus. The bootloader architecture is quite modular and the transport is separate from the rest of the bootloader. So what you can do is add another serial transport layer, similarly to how UART or USB is allready supported, and use that. You would also have to implement a DFU master on the other end, which transfers the init packet and image over CAN bus using the DFU protocol. Here you may find it useful to refer to other DFU master implementations, for instance in nrfutil for inspiration as well as the DFU protocol documentation.

Related