Difference between revisions of "Modular ESP Firmware - Baseline - Work Environment"
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== platformio.ini == | == platformio.ini == | ||
− | === | + | === Common settings === |
<syntaxhighlight lang="ini" line="1"> | <syntaxhighlight lang="ini" line="1"> | ||
− | [env | + | [env] |
platform = espressif8266 | platform = espressif8266 | ||
; For now, let's stick with the 8266 family MCUs | ; For now, let's stick with the 8266 family MCUs | ||
− | |||
− | |||
− | |||
framework = arduino | framework = arduino | ||
Line 15: | Line 12: | ||
; I like my serial comms fast. (Without this line you get the default of 9600) | ; I like my serial comms fast. (Without this line you get the default of 9600) | ||
− | build_flags = -D DEBUG | + | build_flags = |
− | ; This is just plain handy. | + | -D DEBUG ; This is just plain handy. Use it to turn debugging output on/off... |
+ | ; -D DEBUG0 ; Show extra WiFi Debug info | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === Most ESP8266 Devices === | ||
+ | <syntaxhighlight lang="ini" line="1"> | ||
+ | [env:esp8266] | ||
+ | board = esp07 | ||
+ | ; Pretty much ANY esp8266 board is an esp07 as far as Platformio is concerned | ||
+ | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 22: | Line 28: | ||
<syntaxhighlight lang="ini" line="1"> | <syntaxhighlight lang="ini" line="1"> | ||
[env:esp01] | [env:esp01] | ||
− | |||
board = esp01 | board = esp01 | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 30: | Line 34: | ||
<syntaxhighlight lang="ini" line="1"> | <syntaxhighlight lang="ini" line="1"> | ||
[env:espM3] | [env:espM3] | ||
− | |||
board = esp8285 | board = esp8285 | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | === Notes === | ||
+ | You can put as many <code>[env:]</code> sections in as you like & select one at compile-time based on which particular device you're programming. | ||
+ | |||
+ | You'll also be adding other options to the <code>[env:]</code> blocks. | ||
+ | |||
+ | Things like <code>lib_deps</code> come to mind... | ||
+ | |||
+ | <code>build_flags</code> are a good way to customise compiles from a single codebase onto different devices. | ||
+ | |||
+ | For an in-depth set of documentation, see [https://docs.platformio.org/en/latest/projectconf/# “platformio.ini” (Project Configuration File)]. You can get pretty involved in this file & do a lot to control how things are built. |
Latest revision as of 15:48, 2 January 2021
Contents
platformio.ini
Common settings
1 [env]
2 platform = espressif8266
3 ; For now, let's stick with the 8266 family MCUs
4
5 framework = arduino
6
7 monitor_speed = 115200
8 ; I like my serial comms fast. (Without this line you get the default of 9600)
9
10 build_flags =
11 -D DEBUG ; This is just plain handy. Use it to turn debugging output on/off...
12 ; -D DEBUG0 ; Show extra WiFi Debug info
Most ESP8266 Devices
1 [env:esp8266]
2 board = esp07
3 ; Pretty much ANY esp8266 board is an esp07 as far as Platformio is concerned
esp-01
1 [env:esp01]
2 board = esp01
esp-M3
1 [env:espM3]
2 board = esp8285
Notes
You can put as many [env:]
sections in as you like & select one at compile-time based on which particular device you're programming.
You'll also be adding other options to the [env:]
blocks.
Things like lib_deps
come to mind...
build_flags
are a good way to customise compiles from a single codebase onto different devices.
For an in-depth set of documentation, see “platformio.ini” (Project Configuration File). You can get pretty involved in this file & do a lot to control how things are built.