I've used ESP8266/ESP32 in a few projects in the past (usually on some Adafruit board); but now I have a small project that has the ESP8266 as a peripheral to another microcontroller (Teensy4.1). I have an 8-pin ESP8266 module wired up to the Teensy, so I can communicate with it over RS232 and I have GPIO pins from Teensy to control RESET and GPIO0 of the ESP8266. All that works just fine, but now I need to be able to flash a new image onto the ESP8266 using the Teensy. I started this project taking for granted that "somewhere" there would be a C program already written for this; however, I have not found anything. Can anyone point me to what I need to be able to update ESP8266 flash using another microcontroller (written in C)?
Thanks,