Morning @Monsterthews – hope you are safe and well.
I’ve not yet started with ESP stuff, but I have a box of three “Blue Pills” (STM32F103C8T6), a couple of WEMOS D1 Mini boards and a Nucleo-F103RB develpment board to play with – none of which I’ve plugged in and tested yet I’m afraid. This is due to a family medical problem, Covid19 and my wife thinking that I should “get a life”
I’m also writing my second Arduino book at the moment – when I’m “allowed” some free time by SWMBO. (She Who Must Be Obeyed!
)
My Uno and Duemilanove, on the other hand, I have used frequently in the Arduino IDE and in the PlatformIO IDE system in VSCode.
I’m puzzled here. Why would you want to delete stuff from the platformio.ini
file when you are ready to finalise the program? Surely, only stuff that’s relevant to the final program would be in your ini file?
Moving on.
The INI file
The ini file is documented at “platformio.ini” (Project Configuration File) — PlatformIO latest documentation and covers basic stuff about the file. Project examples can be found at Examples — PlatformIO latest documentation where there appears to be a couple for the ESP platform.
Regarding your ESP boards, there is a list of boards at Boards — PlatformIO latest documentation and if you find your board in the list in the contents sidebar (left side) then click it to open that page. My D1 Mini board is covered at WeMos D1 R2 and mini — PlatformIO latest documentation.
On that page you will see lots of specific information regarding that one board:
-
Hardware which tells you about the hardware itself;
-
Configuration - shows you what you should be using to configure the board in the ini file;
-
Uploading - tells you which protocols etc are available to upload programs to this board;
-
Debugging - covers debugging, if available, for the board. The WEMOS D1 Mini has no debugging abilities;
- [Frameworks] - Which frameworks can/will be used when you initialise a project for this board.(WeMos D1 R2 and mini — PlatformIO latest documentation)
Debugging
If debugging is available for your board, the debugging section will tell you how to use it. There are lots of docs at Debugging — PlatformIO latest documentation on basic debugging.
Be aware that some platforms allow proper hardware debugging, while others, like the Arduino, have simulated debugging which doesn’t work in all situations. The Uno, for example, has all it’s debugging information under the details of the board at Arduino Uno — PlatformIO latest documentation. You can see that there are two options for debugging. When I’ve needed it, I used simavr
. So I had to add things to the ini file to cover that. What things? Click on the simavr
link and you will find out at simavr — PlatformIO latest documentation
debug_tool = simavr
Easy peasy. If you want to use the default debugger, avr-stub
then you need to go here instead avr-stub — PlatformIO latest documentation but this option requires a bit more setup.
Other Stuff
When you find something that helps you out, in a posting, bookmark it for later reference. Click the ...
at the bottom of the particular post, then select the bookmark icon – which on my browser is between the "penciland the
bin` (Trash can?).
How to find your bookmarks? Click your own avatar/image/icon at the top of the page, click “Activity” at the top, click “Bookmarks” on the left. The right side will be populated with your bookmarked posts.
Well, that depends. Mostly for my Uno/Duemilanove stuff I usually just add in the serial monitor stuff that I need to replicate the Arduino IDE’s Serial Monitor utility. For me, I’m usually at 9600 baud and I like to be able to type a string of characters before the Arduino board’s USART starts grabbing them! This is what I use:
monitor_speed = 9600
monitor_filters = send_on_enter
monitor_flags =
--echo
--eol
CRLF
These settings work perfectly for me in Putty (on Linux), Miniterm, in the PlatformIO Monitor utility – which I thing is also MiniTerm – and also, CoolTerm.
Sometimes I remove stuff from the ini file. While a lot of my Arduino code is written using the Arduino framework, I often write stuff in plain AVR C++ as it is invariable quicker, smaller and, ahem, better! (When my next book comes out you’ll find a lot of AVR C++ code in there!) To avoid having PlatformIO always compiling the unwanted Arduino core software. I comment out the framework line in the ini file:
; framework = arduino
That way, I can easily add it back in if necessary.
Hope this helps in a small way.
Cheers,
Norm.