3 Replies Latest reply on Jun 16, 2020 10:06 PM by BragadeeshV_41

    Remote MCU Flashing


      Hello again everyone,


      I am writing a network of microcontrollers that connect via CAN. These microcontrollers will be deployed on a system somewhere very very far from me and it would be costly to move back and forth for firmware maintenance. As a remedy I've decided to figure out a way to remotely flash them.


      I've come across the Bootloader and bootloadable projects. I've tried them on a pre-fabbed board we have from psoc with a c78c414azi-s433 semi conductor. I was able to use these two projects. Mainly, the bootloader just programs the the microcontroller with the bootloader host instead of using the PSOC programmer, and bootloadable is the project that I wanna "bootload" or program the device with. My question is, how can this be implemented across 2 microcontrollers? Do both of them have to have the bootloader application on them, and the host has the bootloadable application and programs the other one?


      I'm doing the work with I2C for now since it is done for me. But later on, i will have to implement this over CAN as this is how my microcontrollers are connected and I understand that the bootloader supports a custom communication component which I hope to implement CAN on. I understand i have to implement 5 functions to do this via the custom component but if you have any additional info on this would be greatly appreciated . If I can get this to work hopefully i'll give to PSoC so there can be an additional premade interface that uses CAN instead of I2C or SPI.



        • 1. Re: Remote MCU Flashing

          Hi OmAb_4672891


          We have a reference project that uses PSoC 5 to demonstrate CAN bootloader operation. Please use the link below:

          CAN Bootloader , Bootloadable Project


          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. 1. Develop bootloader host GUI to support CAN interface
          2. 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.






          • 2. Re: Remote MCU Flashing



            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.


            • 3. Re: Remote MCU Flashing

              Hi OmAb_4672891,


              Yes, you should be able to use Virtual box running windows on your Linux system to use the bootloader host tool as suggested in the thread.