Cannot use esp07s board - Error: Unknown board ID 'esp07s'

Using PlatformIO on Windows10 I have been building a project for the Adafruit Huzzah breakout board which uses an ESP-12 device. Now I want to build it for an ESP-07S device because it has a WiFi antenna connector. The reason is that the on-board antenna is not sensitive enough so I need an external antenna. Otherwise the project works fine on the Huzzah.

So I have created a new environment setting for it by copying the original and replacing the board designator as follows (from my platformio.ini file):

[env:esp07s-serial]
platform = espressif8266@2.5.2
board = esp07s
;board_build.flash_mode = dout
framework = arduino
lib_deps = 
	tzapu/WiFiManager@^0.16.0
	knolleary/PubSubClient@^2.8
	paulstoffregen/OneWire@^2.3.7
	milesburton/DallasTemperature@^3.11.0
	arduino-libraries/NTPClient@^3.2.1
upload_speed = 115200
upload_port = COM4
monitor_speed = 115200
monitor_port = COM4

But what happens is that when I hit build for this environment it complains as follows:

Executing task: C:\Users\Bosse\.platformio\penv\Scripts\platformio.exe run --environment esp07s-serial 

Processing esp07s-serial (platform: espressif8266@2.5.2; board: esp07s; framework: arduino)
-------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Error: Unknown board ID 'esp07s'

I have no idea why this happens, the board is part of the Espressif framework as far as I can understand, so what can I do to get this to work?
Totally baffled bu this unexpected problem. :frowning:

Found out why it did not build:

The platform version (here 2.5.2) is not compatible with the esp07s board, probably it did not yet exist at that time…
So I removed the platform version info altogether and now it does build and I can upload to the board and run the code. :slight_smile:

However there is still a problem here because the ESP-07S has 4M flash and still the build process outputs this:

Building in release mode
Retrieving maximum program size .pio\build\esp07s-OTA\firmware.elf
Checking size .pio\build\esp07s-OTA\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=====     ]  49.1% (used 40240 bytes from 81920 bytes)
Flash: [=====     ]  45.7% (used 477085 bytes from 1044464 bytes)

WHY?
The value on the Flash line is just 1MB (1044464)!
Should it not be 4MB (4194304)???

Ok, I might be wrong here, but, in my /home/norman/.platformio/espressif8266/boards directory, I have files for esp07.json and esp07s.json. The former has this:

  "name": "Espressif Generic ESP8266 ESP-07 1MB",
  "upload": {
    "maximum_ram_size": 81920,
    "maximum_size": 1048576,
    "require_upload_port": true,
    "resetmethod": "ck",
    "speed": 115200
  },

and the latter:

  "name": "Espressif Generic ESP8266 ESP-07S",
  "upload": {
    "maximum_ram_size": 81920,
    "maximum_size": 4194304,
    "require_upload_port": true,
    "resetmethod": "nodemcu",
    "speed": 115200
  },

Note the two different maximum_size settings? I suspect that at some point in your build, you managed to get a 1MB board rather than a 4 MB. I suggest running a full clean of the project using the trash can/dustbin icon on the PlatformIO toolbar in VSCode, or, on the command line with pio run -t clean and then try another build.

I suspect you might have some artefacts lying around from a previous build. Just a though.

Cheers,
Norm.

OK thanks,
I am not very used to PlatformIO and VSCode - this is my first project on this IDE.
A few years back I used the sloeber IDE plug-in to Eclipse IDE.
So I really do not know the way to do what you propose…
Do I enter new information into platformio.ini in my project or do you mean to use one or several of these command links:
image

If so does it in any way change my source files so I have to protect them (by checking into SVN for example)?

The Dustbin you refer to, where is it and what does it do to my project (which has several different environment settings)?

I did as Clean All and then Build on a esp07s device and this is what I was shown:

Linking .pio\build\esp07s-OTA\firmware.elf
Retrieving maximum program size .pio\build\esp07s-OTA\firmware.elf
Checking size .pio\build\esp07s-OTA\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=====     ]  49.1% (used 40240 bytes from 81920 bytes)
Flash: [=====     ]  45.7% (used 477069 bytes from 1044464 bytes)
Building .pio\build\esp07s-OTA\firmware.bin

I still do not understand why there is mention of:
Flash: [===== ] 45.7% (used 477069 bytes from 1044464 bytes)
when the device clearly uses 4MB flash and PlatformIO has not checked the actual device yet…

Hi @bobswede,

Ok, no worries. Things work a little different here than in the Arduino IDE – which does an awful amount of work behind the scenes to “protect” you from having to know stuff, and just lets you get on with your project. This has good and bad points.

No, those links you show in your screen shot are fine. I almost never use those myself, which is why I didn’t mention them. You do not need to change platformio.ini or use a version control system.

The dustbin is on the PlatformIO toolbar at the bottom of the VSCode window, circled in black below. This toolbar will appear whenever you open a folder or workspace where there is a file named platformio.ini.

PlatformIO-toolbar

No, all it does is remove the compiled objects created by the compiler. So all the intermediate files and the final executable. Your source files are safe.

I tried deleting all the ESPRESSIF8266 packages that were installed on my laptop, I created a new sketch, just the blank one with nothing in setup or loop, and used this platformio.ini:

[env:esp07s-serial]
platform = espressif8266
board = esp07s
framework = arduino
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 81920

Using the board_build options, I was able to see that changing maximum_ram_size showed up in the compiler output, however, changing the maximum_size did not. Even making it smaller still resulted in a 1044464 size for Flash RAM – this is 1MB - 4Kb.

I found this post from @maxgerhardt (resident genius) [esp8266] builder tools CheckUploadSize ignores board_upload.maximum_size override in platformio.ini - #3 by maxgerhardt in which he mentions that the flash size is extracted from the compiler’s linker script.

Following that, there was another post, [esp8266] builder tools CheckUploadSize ignores board_upload.maximum_size override in platformio.ini - #5 by boxofrox which mentions:

Unbeknownst to me, while the ESP has 4MB of flash, it is only capable of running a 1MB program

There are a few issues on the web about t his fact, which I was unaware of, but it seems that the hardware is the problem here, it has 4MB RAM on board, but only 1 MB can be used for program code. (Less the size of the bootloader, around 4KB apparently!)

I assume, but I’m not an 8266 guru, that the remaining 3MB can be used for “littlefs” filestore, or its replacement which I forget the name of.

It looks like your problem can’t be resolved with the current state of the hardware I’m afraid. Sorry. :frowning_face:

Cheers,
Norm.

Thanks for the info!
Too bad for me, I have not yet reached half of the 1MB but I am close and I thought that in order to use OTA one needs to have space for the firmware to be stored temporarily and then moved to the active space on the reboot following OTA. If this is the case then only 0.5 MB of flash space is actually available on a 4 MB device!
Is this the same if one uses stock Arduino IDE?

I think the 1Mb limit is for program code. You can have a maximum of 1Mb worth of application code. The remaining 3Mb can be used for “spiffs” or “littlefs” file systems where you should be able to store your OTA updates.

I believe this is true of the Arduio IDE also.

Cheers,
Norm.