We have a reference project that uses PSoC 5 to demonstrate CAN bootloader operation. Please use the link below:
The above project uses PSoC Creator 3.3 with old CAN Component so I've attached a updated version of the same project with this response. This can be easily ported to PSoC 4 device since the CAN component is the same in both the cases.
I've tried to show a high-level block diagram of what the project does.
The host acts as the I2C to CAN bridge that converts the I2C bootloader commands from the Bootloader Host GUI to CAN messages.
The receiving node implements a custom bootload interface using CAN.
PSoC 4 Custom Bootloader - KBA229075
All the nodes in the network except the host (host is only a I2C to CAN bridge) will have both the bootloader and bootloadable project .Therefore, the receiving node will have two projects, one project with bootloader component that receives bootloader CAN commands and the other project (new image) contains the bootloadable component.
Based on the command received (in case of CAN this can be differentiated with the CAN Identifier) it will perform the bootloading operation on the respective node. Remember that both bootloader and bootloadable project resides in the flash. The bootoader receives the new image from the host and performs flash writes on the area reserved for the bootloadable application. After successful bootloading and validation, the control switches to the bootloadable region of flash and the new image is executed.
Since Cypress provided host tool can work only with I2C, SPI and UART protocols, we need to have a I2C to CAN bridge or similar bridges to translate the I2C commands received from the host to CAN messages that is understandable by the nodes in the CAN network.
You have two options other than this :
- 1. Develop bootloader host GUI to support CAN interface
- 2. Develop a Embedded host (one microcontroller bootloads other micro controller)
In case you want to use an embedded host, you can do so by referring to the following app note which explains a UART based PSoC Embedded host for bootloading. You can use this as reference to update the HOST side of the above project to send out CAN bootload commands instead of UART.
Updated.rar 1.7 MB
Thank you so much for this reply. This is exactly what I am doing. I believe I will just port this project and use it in my application. One last question I have:
The bootloader host is only on Windows as seen in this post:
PSoC® USB HID Bootloader for linux
Do you think I'll be able to make something like a Docker image or virtual machine on my linux to run the bootloader host to send the I2C commands to the host and it will in turn convert to CAN?
Thank you for all your support and swift help.