Hi, in one of our projects, we need to update the application firmware on our nRF5340 via CAN bus (using an MCP2515 interface which I will commision within the coming weeks, Zephyr driver seems to be available).
It is possible to update the firmware via UART or USB (CDC_ACM), but from an abstract point of view, there is only a bytestream which is forwarded to and received from MCUmgr.
As far as I know, MCUmgr cannot be used natively with CAN, which would also be tricky as only a fraction of the CAN messages would have to be handled by the MCUmgr. One straightforward way for using a CAN connection would be to create a fake uart device driver which does not access hardware, but provides a software interface which is used to receive and provide UART data (or a bytestream, like mentioned above). But probably this approach is overkill. Isn't there a simple generic software interface for MCUmgr available that can receive and send data without using drivers? E.g.
void mcumgr_data_in(uint8_t* buffer, uint32_t size); // Send uart data from buffer to mcumgr uint32_t mcumgr_data_in(uint8_t* buffer, uint32_t size); // Receive uart data from mcumgr into buffer, returns amount of bytes transferred
This way, I could just filter my CAN packets and forward the uart payload to mcumgr. And if mcumgr provides some data, I can poll it and wrap it into CAN messages and send it out.
Is it possible to use MCUmgr in this way? If yes, which configuration values do I have to set?
Best regards,
Michael