CreativeRobotics / EnactiveTorchRT2b

Enactive Torch hardware revision b
MIT License
0 stars 0 forks source link

Updated the ESP32 boards with code changes #8

Open kercos opened 4 years ago

kercos commented 4 years ago

Something which is not entirely clear to me is how to updated the ESP32 boards with the changes in the code.

kercos commented 4 years ago

Reply from Creative Robotics Tech Support

The ESP32 is tricky because I discovered during development that using the main microcontroller as a USB to serial bridge for programming the ESP32 would not work. Apparently it is something to do with the USB peripheral firmware and the ESP32 bootloaders need for very tight timing of data during code uploads. The only way I could get the ESP32 to accept software was through a programming header I included on the main PCB.

For the revision B hardware I used an ESP32 with 16Mb flash memory and included provision in the code for over the air updates which can be triggered via a command. I haven't documented the commands required to initiate it properly but I did test it before I shipped the devices and I was able to upload new code to the ESP32 using a web browser.

My existing code that handles interactions between the ESP32 and the rest of the system is extremely poor and consequently a lot of it doesn't work properly. I am revising this as part of the updated code to make it work better - the main change will be to use a digital pin connection that exists between the two devices as a way of signalling whether serial data sent to the ESP32 is a command for the ESP32 to execute, or data that should be transmitted. (This digital connection is normally used to enable bootloader mode on the ESP32 as it powers up)

I will try and get you an explanation of the ESP32 upload process soon.