0

In PlatformIO while creating a project , in the board selection there is no ESP-12F in the boards. While there is ESP-12E. I can flash ESP-12F while choosing ESP-12E from the boards without any flashing issue. But there are some runtime issues, the one that I noticed is the LED doesn't blink when flashed from PlatformIO , but works fine, when flashed using Arduino IDE using the same code. So there may be some difference in the configurations.

C:\Users\USER\.platformio\platforms\espressif8266\boards

In this directory I found the esp-12e board which is a JSON format.

{
 "build": {
 "core": "esp8266",
 "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12",
 "f_cpu": "80000000L",
 "f_flash": "40000000L",
 "flash_mode": "dio",
 "ldscript": "eagle.flash.4m1m.ld",
 "mcu": "esp8266",
 "variant": "nodemcu"
 },
 "connectivity": [
 "wifi"
 ],
 "frameworks": [
 "arduino",
 "simba",
 "esp8266-rtos-sdk",
 "esp8266-nonos-sdk"
 ],
 "name": "Espressif ESP8266 ESP-12E",
 "upload": {
 "maximum_ram_size": 81920,
 "maximum_size": 4194304,
 "require_upload_port": true,
 "resetmethod": "nodemcu",
 "speed": 115200
 },
 "url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
 "vendor": "Espressif"
}

How do I add ESP-12F to the PlatformIO boards and flashing without any issue.

asked Sep 18, 2019 at 5:52
2
  • 1
    Ask platformIO... it's their responsibility to keep their boards packages up to date for their platform... Commented Sep 18, 2019 at 8:59
  • @Majenko Thanks for the direction!! :) Commented Sep 18, 2019 at 12:18

1 Answer 1

0

At the PlatformIO community I asked the same question, and pfeerick suggested to add a build flag.

It’s most likely the onboard LED is on GPIO2, not GPIO1 so try adding

build_flags = -D LED_BUILTIN=2 to your platformio.ini ... hopefully that kicks in before the pins_arduino.h defintion.

But It didn't did the trick. And the compiler throws a bunch of warnings. What I did to make it work is to ignore LED_BUILTIN constant and use 2 instead. 😎😎😎😎😎🤣🤣

#include <Arduino.h>
void setup() {
 pinMode(2, OUTPUT);
}
void loop() 
{
 digitalWrite(2,LOW);
 delay(200);
 digitalWrite(2,HIGH);
 delay(200);
}
answered Sep 19, 2019 at 12:14
1
  • 1
    The build flags shouldn't have a space after the "D". build_flags = -DLED_BUILTIN=2 Commented Mar 12, 2021 at 19:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.