New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.0.x] Platformio - automate build & environment selection #10503
[2.0.x] Platformio - automate build & environment selection #10503
Conversation
8706c93
to
2551e0c
Compare
Very cool. I'll give it a test in macOS later today. I'll also investigate whether we can get the same out of VSCode, which is preferred by some over Atom. |
2551e0c
to
9d1d1fb
Compare
I've added a commit to bring this up to date with the latest
|
9d1d1fb
to
b44eaca
Compare
@Bob-the-Kuhn I'm going to combine the LPC1768_debug_and_upload and LPC1768 environments if that's ok, there is no difference anyway other than specifying your debug server parameters, I'm in the middle of trying to tidy up the LPC176x platform a bit, but I got held back by trying to debug odd sd card issues some people have on MKS SBase that I can't reproduce (would probably help if I had a mks sbase ^^) |
Initial macOS test indicates I need to install some extras into my Python virtual environment:
|
531f73c
to
b44eaca
Compare
This guy only runs under Python 2.7. By chance are you running 3.x? |
I don't use the PlatformIO debug tool so |
The major version reported by the script is 2, so it's probably the same 2.7.10 reported in the shell by I investigated whether we could just use an extra environment in I also looked at whether the script invoked by All of which is to say, this solution seems to be the most straightforward, and invoking pio in this manner from the shell gives us complete control over build options. So, other settings in the Marlin configs could also be used to modify build flags if we ever needed to do that. |
Just changed to the streaming version of auto_build.py |
@JohnnyTheOne - you were involved in adding the optiboot option to platformio.ini - maybe you can answer some questions. Is optiboot only on upgraded boards? Can it be installed on any 644 or 1284 board? @benlye - we're trying to understand the upload speed options/requirements for the 644 & 1284 boards. My impression is that they all upload at 115.2k except for the Melzi & Anet boards that have not been upgraded to the Optiboot bootloader. The goal is to develop a list of the boards and the correct environment for them. My current thinking is that all the 644 & 1284 boards upload at 115.2k except for the following (where we'll have to ask what baudrate to use):
The pins files indicates that ANET_10 and MELZI_MAKR3D are 1284 boards. Are the other four also 1284 only boards? |
a613439
to
f4c76b9
Compare
I do not have enough knowledge to answer you. ANET_10 board is 1284P and used this for Bootloader upload |
Yes, this is for the lazy ones.
This PR automates selecting the build/environment in PlatformIO (when used within Atom).
With just 2 or 3 mouse clicks you can kick off a PlatformIO build rather than scrolling through the build options looking for the one you want.
The Atom package process-palette is used to provide a new menu which kicks off a Python script. This script grabs the motherboard from Configuration.h and then searches pins.h for the motherboard. The command line version of PlatformIO is kicked off using the gathered info and its output is sent to a Python window.
Rather than complicating the script & having to modify it as boards are added, the pins.h file has been modified to include the CPU(s) and environments(s) used by each motherboard. The added info is in the comment portion of each motherboard's include line.
ENVIRONMENT SETUP
process-palette will automatically read the file process-palette.json in the project's top directory and add the new menu.
USER INSTRUCTIONS
1 Edit the Marlin files as usual.
2. Open the project in PlatformIO
3. Click the Auto Build menu. It is immediately to the right of the PlatformIO menu.
4. Click on the type of build (build, clean, upload, ...)
5. If the motherboard (and Marlin) supports more than one CPU then a popup will appear that asks you to click on the correct CPU. Click the CONFIRM button to proceed.
6. A progress bar pops up indicating that something is actually happening. Be patient - PlatformIO can take minutes to complete.7. A window pops up showing the PlatformIO output stream plus the motherboard name, build type and environment used.
The output window is actually a mini-editor. It can be moved and resized. The text can be scrolled, selected, copied and saved to a file.
In step 5 there are four pop ups:
TESTING
This has been tested in Windows and in Ubuntu. It has not been tested in OSX.
TO DO
- Take another look to see if can stream the PlatformIO output rather than wait for it to complete.- Need to back out some test oriented code.- Need to add comments and fix up the whitespace/formatting.