Hello,
This is the first time I'm using the Arduino IDE.
After successuflly compiling a (C) program for use on an ESP32-based board…
- what binary file(s) should I give users, and
- Is there a simple way to flash the new firmware through USB… or is it too involved for non-techies?
Thank you.
1)In the IDE, enable show verbose output during compilation and disable show verbose output during upload. Compile the code and search e.g. for AppData (not sure if this works for every OS) or for .elf (note the dot); the easiest is to copy the output to a text editor.
With that you can find the path where all the work was done and where the executable lives. In that directory, you will find a bin file; that's the file that you're looking for.
"C:\\Users\\sterretje\\AppData\\Local\\Temp\\arduino_build_262539/NTPClient_with_OLED.03.ino.elf"
- Now perform an upload with show verbose output during compilation disabled and show verbose output during upload enabled. You will find the exact commands that are used to perform an upload.
Executable segment sizes:
IROM : 251720 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 27932 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1676 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 1084 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 25616 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 282412 bytes (27%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28376 bytes (34%) of dynamic memory, leaving 53544 bytes for local variables. Maximum is 81920 bytes.
C:\Users\sterretje\Downloads\arduino\arduino-1.8.13-windows\arduino-1.8.13-Wemos\portable\packages\esp8266\tools\python3\3.7.2-post1/python3 C:\Users\sterretje\Downloads\arduino\arduino-1.8.13-windows\arduino-1.8.13-Wemos\portable\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py --chip esp8266 --port COM19 --baud 921600 --before default_reset --after hard_reset write_flash 0x0 C:\Users\sterretje\AppData\Local\Temp\arduino_build_262539/NTPClient_with_OLED.03.ino.bin
esptool.py v2.8
Serial port COM19
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: f4:cf:a2:ed:bc:46
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 286560 bytes to 210179...
Wrote 286560 bytes (210179 compressed) at 0x00000000 in 4.8 seconds (effective 475.9 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
- For non-technical people, you can provide a batch file / shell script (you'll have to write one), the needed tools that can be installed and executed by them and the bin file.