- Fri Jul 24, 2020 2:20 am
#88030
JamesDeehan wrote:I get it now.
Arduino IDE replaces the entire firmware
https://forum.arduino.cc/index.php?topic=531542.0
Any flash upload should / will replace the entire binary. We need to be very careful when we talk about "upload". If the flashed program is designed to take a script which it then executes, such as LUA or MicroPython, then that is a different process and the binary stays intact.
I like to think of the latter as "sending data" to the binary interpreter. The fact we know the "data" is "code" to be interpreted doesn't really matter, but it helps to reinforce that we are NOT flashing a compiled binary.
So, using ArduinoIDE which compiles C++ and C code into a binary executable, we will totally replace what was in there before. If that is a newer version of the interpreter (I'd bet a lot of money that any interpreter that ESP8266 can run is written in C/C++) then you can still upload scripts for it to run. If its your own compiled code - then only that code will run.
If you wanted to go back to scripting language, you.d need to re-flash the interpreter firmware to overwrite your own code.
In summary then,
1)
All MCU can only ever run compiled code. To get that code into the MCU you FLASH it.
2) The original language the compiled code is written in is irrelevant - it is the compiled binary that gets FLASHED
3)
Some compiled binaries act as script interpreters and once loaded can read "uploaded" scripts and execute them.