Hello,
I am using an Arduino UNO R3 to program an ESP8266 using a black version ESP-01. I found this guide: How to Program ESP8266 with Arduino UNO - Iotguider
Compilation information from Arduino IDE 1.8.10:
Executable segment sizes:
IROM : 227612 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26776 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1252 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 672 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 24880 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 256312 bytes (26%) of program storage space. Maximum is 958448 bytes.
Global variables use 26804 bytes (32%) of dynamic memory, leaving 55116 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM7
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:c2:d0:6d
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Compressed 260464 bytes to 190651...
Writing at 0x00000000... (8 %)
Writing at 0x00004000... (16 %)
Writing at 0x00008000... (25 %)
Writing at 0x0000c000... (33 %)
Writing at 0x00010000... (41 %)
Writing at 0x00014000... (50 %)
Writing at 0x00018000... (58 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (75 %)
Writing at 0x00024000... (83 %)
Writing at 0x00028000... (91 %)
Writing at 0x0002c000... (100 %)
Wrote 260464 bytes (190651 compressed) at 0x00000000 in 16.9 seconds (effective 123.2 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
I only have some experience using Arduino UNO and it's my first time using an ESP-01 so i don't know if the code compilation and upload was successful. There was no LED blinking on the ESP-01 module. I'm not even sure if there is a built-in LED on this ESP-01? So, i uploaded the blink sketch from the Arduino examples and connected an LED between GPIO_2 pin of ESP-01 and ground, but the LED stays on and does not blink.
Edit: I found my mistake. GPIO_0 was initially grounded to enable the programming mode of ESP8266. So, i disconnected the GPIO_0 pin and unplugged the Arduino UNO from its USB port and reconnected. The external LED now blinks. But still, no blinking built-in LED on the ESP-01 module.
Edit: I did a search and found this useful thread: New ESP-01 modules use different pin for LED_BUILTIN · Issue #3165 · esp8266/Arduino · GitHub
I changed the code to make it compile. I uploaded the sketch, disconnected pin GPIO_0 from ground and disconnected the power and reconnected. The built-in (blue) LED on the ESP-01 now blinks!
// Blink the built-in LED for ESP-01 black model
#define ESP_LED 1 // GPIO_1
void setup()
{
pinMode(ESP_LED, OUTPUT);
digitalWrite(ESP_LED, HIGH); // Off - confirmed for built-in LED
//digitalWrite(ESP_LED, LOW); // On - confirmed!
}
void loop()
{
digitalWrite(ESP_LED, LOW); // On
delay(500);
digitalWrite(ESP_LED, HIGH); // Off
delay(500);
}
I hope this helps others!