Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Build/upload source code with PlatformIO

  1. #1

    Build/upload source code with PlatformIO

    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!

  2. #2
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Where is summary of what it does, screen shots, etc.

  3. #3
    Quote Originally Posted by stevech View Post
    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:
    Click image for larger version. 

Name:	platformio-examples.jpg 
Views:	199 
Size:	119.5 KB 
ID:	2530
    And
    Click image for larger version. 

Name:	console-result.png 
Views:	190 
Size:	125.7 KB 
ID:	2531

    Also, each example from All Examples contains an image of the result. Just wait, because some image is large.

  4. #4
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    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 by stevech; 08-11-2014 at 06:59 PM.

  5. #5
    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.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,259
    Quote Originally Posted by ikravets View Post
    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?

  7. #7
    Quote Originally Posted by PaulStoffregen View Post
    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/platf...uilder/scripts

    Quote Originally Posted by PaulStoffregen View Post
    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__


    Quote Originally Posted by PaulStoffregen View Post
    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 by ikravets; 08-12-2014 at 06:56 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •