Page 1 of 1

OTA via ESP32 to STM32 with CAN

Posted: Sat May 19, 2018 9:32 am
by jeaoks
Hi,

I am using two STM32's in two devices. One is in sort of "motherboard" and another in "control panel". They are connected via CAN. In the control panel I have also ESP32, which is also in the same CAN as these two STM32's. ESP32 itself is easy'ish to update OTA. And the two STM32 can already be updated by dropping the bin-file to CAN bus. But...

...the question is:

How to put ESP32 to take the bin-file over the air, and dumb it to the CAN?

At the moment i am flashing the STM32's with UART USB, and the CAN update already works, so if i would be able rather easily to put ESP32 to store the flashing file to it's memory and be able to send it to CAN then it would be super nice as all of the three micros would be able to updated.


Thanks, 
Jussi

Ps. I accidentally put this question to Arduino topic, sorry.

Re: OTA via ESP32 to STM32 with CAN

Posted: Sat May 19, 2018 1:10 pm
by kolban
From what I am hearing, it sounds like you want to receive your STM32 images over the WiFi network owned by the ESP32 and then stream that over the CAN bus to the STM32s. This would mean using some networking protocol logic on the ESP32 to either pull a new image or listen for pushes of a new image and then, when received push it out to the STM32s.

Re: OTA via ESP32 to STM32 with CAN

Posted: Sun May 20, 2018 6:09 am
by jeaoks
Yes, exactly.

I am about use REST interface between my ESP and the Server which pushes/sends the image. This is still the part what i understand how to do it. And for the safety feature i am thinking to push the STM image through the bluetooth so by then i am safe from the possible hackers. As bluetooth's range is local. This is anyway the "easy" part.

The hard part for me is how to handle STM image in ESP. When it is downloaded to ESP how to push it to the CAN and how to kind of set the ESP into mode to only push the data into CAN, and not listen that CAN while the STM is upgrading itself. The ESP should still "understand" when to reset the STM and when pull the reset pin up after theå STM's update has been done.

The next challenge is that when the STM's have been updated. How to tell to STM's that now it is your turn to not to listen CAN as it is ESP's turn to update itself. ESP updating was again the "easy" part, but this STM's force sleep is harder.

And to be clear the ESP talks via one STM to another STM. So they are not in a same board.