Build/upload source code with PlatformIO

Status
Not open for further replies.

ikravets

Well-known member
Hi,

I want to introduce another way to build single source code for different embedded platforms. This happens due to cross-platform code builder named PlatformIO. It doesn't has any dependencies or requirements. The only 1 requirement is Python Interpreter. It works on Mac/Window/Linux 32/64 & Linux ARM arch. Here is the simple Wiring-based example.

Is anyone interested in using Teense board with PlatformIO?

I don't see the big problems to create a new ARM-based platform named "pjrcteensy3" (existing platforms). PlatformIO has already "gcc-arm-embedded" package (tools chain). The one thing that need to do is "builder script". For example, this is the builder script for TI Tiva C Series ARM MCUs.

And yes... Then we could have used it on different OS in the next manner:
Code:
$ platformio install pjrcteensy3

# cd to project directory
$ platformio run -t upload

# end for seri a debugging...
$ platformio serialports monitor /dev/ttyTEENSY...


Thanks a lot for comments/propositions!
 
Where is summary of what it does, screen shots, etc.

As for summary: I didn't want duplicate this information here, because sometime people think that it is spam :( You can read more clear info on main page of documentation http://docs.platformio.ikravets.com/

As for screenshots:

This is summary of common commands and how do they look:
platformio-examples.jpg
And
console-result.png

Also, each example from All Examples contains an image of the result. Just wait, because some image is large.
 
How does this improve upon using an IDE like AtmelStudio/VisualMicro, or, Eclipse?
With AS/VM, if I have code that can run on an AVR or a Teensy2 or a Teensy 3 (of which I have lots), I simply use a pull-down menu to choose the target MCU type and download port and hit compile and download. Takes 5 seconds. Changes what libraries are used based on MCU type.

Maybe the merits of PlatformIO come from library management?
 
Last edited:
How does this improve upon using an IDE like AtmelStudio/VisualMicro, or, Eclipse?
Platformio isn't replacement to any IDE. It's addition to alternative IDE/Text Editors which haven't source building mechanism and etc. For example: VIM, Sublime Text and etc.. Although, the main audience of PlatformIO are people which like to build source code from the CLI. But the main target of PlatformIO is the same behaviour on different OS (Mac, Win, Linux). You don't need install any tools chain and etc. PlatformIO has already pre-built all things for popular platforms. On new host machine it will only install it (download->copy->use).

With AS/VM, if I have code that can run on an AVR or a Teensy2 or a Teensy 3 (of which I have lots), I simply use a pull-down menu to choose the target MCU type and download port and hit compile and download. Takes 5 seconds. Changes what libraries are used based on MCU type.
PlatformIO also allows your to control your devices/boards via environments. Let's review this example. You can build specific environments:

Code:
$ platformio run -e launchpad_lm4f120 -e arduino_pro5v

Maybe the merits of PlatformIO come from library management? Not sure.
Library Manager - in progress. I'm working on it in separated branch. More details about this feature is here

P.S: Also PlatformIO is well for beginners. Because with it & simple text editors (NotePad, NotePad++ and etc...) people can start playing with embedded for the few seconds. It sounds funny and "not professional" but this works.

P.S.S: I've received thanks from the one of universities(Switzerland) recently. They like PlatformIO because it allows them to "get" "platformio.ini" from the class and then reproduce it on the own different machines.
 
It doesn't has any dependencies or requirements. The only 1 requirement is Python Interpreter.

How does it compile code? I don't see any toolchains.

How does it upload? I see avrdude mentioned in platforms/atmelavr.py, but I don't see any copy of avrdude. Likewise platforms/titiva.py mentions lm4flash, but I don't see any copy of TI's tools.

I've probably misunderstood what "dependencies or requirements" means. In fact, I still don't even know what this project is really about?
 
How does it compile code? I don't see any toolchains. How does it upload?

It compiles/uploads code according to build scripts. More info here https://github.com/ivankravets/platformio/tree/develop/platformio/builder/scripts

I see avrdude mentioned in platforms/atmelavr.py, but I don't see any copy of avrdude. Likewise platforms/titiva.py mentions lm4flash, but I don't see any copy of TI's tools.

Tools are not located in GitHub repo. They require a lot of disk space. See __pkgmanifesturl__


I've probably misunderstood what "dependencies or requirements" means. In fact, I still don't even know what this project is really about?

Under "dependencies or requirements" I mean "host OS dependencies". Like: make, unpacker, system package managers, install separated soft for different OS, customisation of system files and etc. You don't need to know what does mean "compile or upload process". Just "platformio install %PLATFORM%" and then "platformio run". PlatformIO uses ~/.platformio/ location for platform-depended tools chains & frameworks. In feature, here will be located installed libraries for different platforms (like, Arduino libs, MSP430 libs and etc.)
 
Last edited:
Status
Not open for further replies.
Back
Top