For testing, I have uploaded a simple, already existing Arduino sketch. In the sketch, only a secure logon to the local network, a query of the time at the local NTP and the output of the time in the serial monitor should take place.
Code: Select all
void setup(){
// Initilize hardware serial:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
//Connect to the WiFi network
connectToWiFi(ssid, pass);
}
void loop(){
//only send data when connected
if(connected){
//Send a packet
udp.beginPacket(udpAddress,udpPort);
udp.printf("Seconds since boot: %lu", millis()/1000);
udp.endPacket();
}
//Wait for 1 second
delay(1000);
}
A check to see if the board really has 4MB of flash was positive.
Code: Select all
T:\Entwicklung\Espressif\MicroPython\ESP-C3-12F-Kit Ai-Thinker\GENERIC_C3>c:esptool --chip auto --port COM27 flash_id
esptool.py v3.2
Serial port COM27
Connecting....
Detecting chip type... ESP32-C3
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 84:f7:03:3a:19:c4
Uploading stub...
Running stub...
Stub running...
Manufacturer: 20
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
As with Arduino IDE, this was again trouble-free.
Code: Select all
T:\Entwicklung\Espressif\MicroPython\ESP-C3-12F-Kit Ai-Thinker>c:esptool --chip esp32c3 --port COM27 --baud 460800 write_flash -z 0x0 esp32c3-20210902-v1.17.bin
esptool.py v3.2
Serial port COM27
Connecting....
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 84:f7:03:3a:19:c4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00168fff...
Compressed 1475488 bytes to 855215...
Wrote 1475488 bytes (855215 compressed) at 0x00000000 in 25.7 seconds (effective 458.5 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Code: Select all
Device is busy or does not respond. Your options:
- wait until it completes current work;
- use Ctrl+C to interrupt current work;
- use Stop/Restart to interrupt more and enter REPL.
Code: Select all
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0x4 (DOWNLOAD(USB/UART0/1))
waiting for download
I found out that there are options for the Arduino IDE that affect the monitoring of RTS and DTR.
C:\Users\mike\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\boards.txt
Code: Select all
...
esp32c3.serial.disableDTR=true
esp32c3.serial.disableRTS=true
...
Code: Select all
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x420
load:0x403ce000,len:0x90c
load:0x403d0000,len:0x236c
SHA-256 comparison failed:
Calculated: ccb0d00bac7e84e1d90a12e4f75f4ab6c5f7e71bb209afd5819c4c9557a6db71
Expected: c9cf160580940ec7801c73b16423824e72ad12055c732e83ce66332240af42a7
Attempting to boot anyway...
entry 0x403ce000
I'll probably open issues on MicroPython, Thonny and Mu Editor in GitHub later today, but I'm not sure if abandoning DTR/RTS can be implemented without side effects.