PlatformIO

Go To Last Post
30 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is anyone using PlatformIO?

 

I really don't want to learn yet another IDE/Compiler/Debugger so if I'm going to have to I may as well learn one that supports a range of chips/toolchains/boards.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not having any support for the xplained boards was a deal killer for me, would also like to see support for pic18 too.

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

User @Paulvdh has been a major proponent here - though doesn't seem to be active at the moment.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
User @Paulvdh has been a major proponent here
+1

 

To read his posts you'd think it was the reinvention of sliced bread !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

There are pretty good support for a wide range of ATmegas through the third party Arduino packages MightyCore, MiniCore and MegaCore. If you don't want to use the Arduino framework you can simply just remove setup() and loop(), and add int main(void) instead.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your work and effort on that.

Have noticed that PlatformIO's Arduino framework was split into those.

Packages | Atmel AVR · Platforms · PlatformIO

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
I really don't want to learn yet another IDE/Compiler/Debugger ...
When one is in the SMB/SME ISV role then one can choose; otherwise, the customer very likely has already made that choice (one is in a role providing a service to a third party)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Last year I also worked together with the PlatformIO developers to implement what they call Dynamic fuse settings. Basically, if you use MightyCore, MiniCore or MegaCore you can make PlatformIO itself calculate the fuse values (and load the correct bootload hex file) based on a few parameters specified in the platformio.ini configuration file:

 

Here's the configuration for a project I've done with a 324PB. With these parameters set I can simply run pio run --target fuses to only set fuses, or pio run --target bootloader to set fuses and load the bootloader. More info about how platformio.ini is set up can be found here: https://github.com/MCUdude/MiniCore/blob/master/PlatformIO.md

; PlatformIO Project Configuration File for MightyCore
; https://github.com/MCUdude/MightyCore/
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed, and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options
; https://github.com/MCUdude/MightyCore/blob/master/PlatformIO.md
; https://docs.platformio.org/page/projectconf.html


; ENVIRONMENT SETTINGS
[env:MightyCore]
platform = atmelavr
framework = arduino

; TARGET SETTINGS
; PlatformIO requires the board parameter. Must match your actual hardware
board = ATmega324PB
; Clock frequency in [Hz]
board_build.f_cpu = 8000000L

; HARDWARE SETTINGS
; Oscillator option
board_hardware.oscillator = external
; Hardware UART for serial upload
board_hardware.uart = uart0
; Brown-out detection
board_hardware.bod = 2.7v
; EEPROM retain
board_hardware.eesave = yes

; UPLOAD SETTINGS
; Upload serial port is automatically detected by default. Override by uncommenting the line below
upload_port = COM4
; Upload baud rate
board_upload.speed = 250000

; BUILD OPTIONS
; Current pinout
board_build.variant = standard
; Comment out to enable LTO (this line unflags it)
build_unflags = -flto

; Upload using programmer
;upload_protocol = usbasp
; Aditional upload flags
;upload_flags = -Pusb

; SERIAL MONITOR OPTIONS
; Monitor and upload port is the same by default
monitor_port = COM4
; Serial monitor baud rate
monitor_speed = 250000

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

PlatformIO is pretty much my ‘goto’ ide these days.

I play around with a number of different micros, so it is a one stop shop.

It is also pretty painless to install and get productive. The editor ( visual studio code)has pretty much all the mod-cons you expect and plug-ins for just about everything. You want a markdown editor with pdf generator? Done.

 

Frequently I’ll have a project with c/c++, html, javascript and md(markdown) and VSCode handles that no problems in as much as it has syntax checking, highlighting etc. there’s also formatters to clean up your code in a click. Nothing too new there.

 

The platformio sauce manages the loading of the various tools, frameworks and libraries.

 

Recently when I bought an obscure Chinese RISC-V board, it was supported in platformio. Opened a new project, clicked on the board name, selected Arduino framework and before long all the compiler tools etc were loaded. Write the usual ‘hello world’ in Arduino speak, press upload and hello world is what I got on the built in serial terminal. It was that smooth. That’s pretty much the experience with any micro it supports.

 

It also manages Arduino libraries for you. Think it of the Arduino tools with a far superior editor. But it’s not Arduino centric- depending on the chip and its frameworks, there’s other choices like bare metal, freertos etc. The downside for me is the debugger. It’s cheap n cheerful. Not quite the AS7, IAR or Keil experience.

And it runs on Mac and linux as well. It loads a whole ton faster than the behemoth that is AS7. I’d recommend it.

Last Edited: Wed. Feb 5, 2020 - 10:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Frequently I’ll have a project with c/c++, html, javascript and md(markdown) and VSCode handles that no problems in as much as it has syntax checking, highlighting etc. there’s also formatters to clean up your code in a click.
fyi, can mix C/C++ into the documentation in a Jupyter notebook.

Kartman wrote:
It loads a whole ton faster than the behemoth that is AS7.
Atmel Studio has the advantage of the Visual Studio ecosystem if one's PC or workstation can stand its weight wink

VisualGDB is a Visual Studio extension that's one way to add GDB to Visual Studio; its AVR GDB is via AVaRICE.

 


Project Jupyter | Home

[1/3 page]

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. ...

via Jupyter kernels · jupyter/jupyter Wiki · GitHub :

 

Search this site - Developer Help (Microchip, Jupyter)

 

VisualGDB - Serious cross-platform support for Visual Studio

Debugging Arduino AVR boards with Visual Studio – VisualGDB Tutorials

BSPTools/DebugPackages at master · sysprogs/BSPTools · GitHub (Sysprogs, VisualGDB)

 

https://marketplace.visualstudio.com/search?term=tag%3AGDB&target=VS&category=All%20categories&vsVersion=&sortBy=Relevance

 

P.S.

Visual Studio has a built-in file scope linter :

-analyze (Code Analysis) | Microsoft Docs

along with several (many?) linters as extensions.

Likewise with Visual Studio Code extensions.

 

edit :

https://marketplace.visualstudio.com/search?term=Jupyter&target=VSCode&category=All%20categories&sortBy=Relevance

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Feb 5, 2020 - 09:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's been a while since I've used AS7, or AS anything, for that matter. I do use Arduino quite extensively, as it is ridiculously fast for testing a concept, or building a one-off tool.

I've used Eclipse(and the NXP/Freescale branded version of same) for some Nordic nRF stuff, some Freescale stuff, some Java I "wrote"(without understanding much of it...),  and some MinGW code.

What I like about Eclipse is being able to right click on a function etc. and bring up the declaration, as opposed to Arduino, under which it seems to be almost impossible to find a library function. Does PlatformIO have anything like that?

I'd dearly love to be able to use one IDE for (almost)all targets if possible, but like the OP, I worry about learning yet another platform. Some of the Eclipse configuration is so opaque(to me, at any rate) that it becomes a case of once it works, just don't touch anything.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
What I like about Eclipse is being able to right click on a function etc. and bring up the declaration

I'd see that as an absolutely basic requirement for any IDE!

 

Even CodeWright does that.

 

 

Some of the Eclipse configuration is so opaque(to me, at any rate)

No, it's not just you!

 

This is part of the reason why NXP et al go to all the effort of making a "targetted" version for their particular product range - because the effort of getting a fully working IDE from a "vanilla" Eclipse is beyond most people.

Been there; done that

 

There are people whose entire job is building & supporting IDEs "built on Eclipse"

 

 

 

that it becomes a case of once it works, just don't touch anything.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PlatformIO uses visual studio code, so right click on a var brings up a box and you can goto the declaration amongst other options. As I said earlier, it's got just about all the mod-cons you want.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

Not having any support for the xplained boards was a deal killer for me, would also like to see support for pic18 too.

 

Support for 8-bit AVR boards does seem a bit limited to compile and load. Debugging via one of the *DBG option would be nice.

 

 

gchapman wrote:

When one is in the SMB/SME ISV role then one can choose; otherwise, the customer very likely has already made that choice (one is in a role providing a service to a third party)

 

Luckily, as CEO/CTO/CFO/teaboy/bottle-washer I get to call the shots.

 

 

Kartman wrote:

I’d recommend it.

 

Thanks, I've just bought a couple of XMC non-Microchip boards which appear to be fully supported so I'm going to give it a go.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I may wait until the CubeCell modules I'm using currently are supported. Supposed to be soon, but the situation in China will probably affect the timing.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
CubeCell modules 

These:  https://heltec.org/cubecell/ ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

John_A_Brown wrote:
CubeCell modules 

These:  https://heltec.org/cubecell/ ?

Yes.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
I may wait until the CubeCell modules I'm using currently are supported

So what does "supported" mean here ?

 

According to the site, it's a PSoC with a Cortex-M0; so can't you just use the standard PSoC tools and get on with it - rather than have to wait around on "support" in PlatformIO ?

 

ie, what value does the PlatformIO "support" add ?

 

The big advantage of the manufacturer-provided IDEs is that they are "ready to go" - no hanging about for 3rd parties to get their "support" together.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What 'value' does PlatformIO add? Obviously, it depends on what you want/need/expect. For me, it is a 'one stop shop' - having a zillion different IDEs loaded onto your machine becomes a drag, not all work under MacOs and so on. If you only use a narrow set of parts, then going the conventional route is probably best and you most likely get a better debug experience. Since I don't put bugs in my code, the debugger is not much use to me anyways.......

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Since I don't put bugs in my code, the debugger is not much use to me anyways.......

laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh laugh 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

John_A_Brown wrote:
I may wait until the CubeCell modules I'm using currently are supported

So what does "supported" mean here ?

 

According to the site, it's a PSoC with a Cortex-M0; so can't you just use the standard PSoC tools and get on with it - rather than have to wait around on "support" in PlatformIO ?

 

ie, what value does the PlatformIO "support" add ?

 

The big advantage of the manufacturer-provided IDEs is that they are "ready to go" - no hanging about for 3rd parties to get their "support" together.

I'm currently using the Arduino IDE, which the manufacturers kindly supply.

I have no idea how I would go about using "the standard PSoC tools", whatever thay might be.

As I understand it, Heltec have integrated a Cortex M0 and the Semtech Lora hardware on to the PSoC. The documentation is extremely basic ATM, and I don't believe all the source code is available.

 

But turning the question on its head, why would I want to learn "the standard PSoC tools", when I have a perfectly functional solution using the Arduino framework?

 

As I said, I have stuff in Arduino, and stuff in Eclipse(and branded Eclipse). My interest in PlatformIO was triggered by a desire to find a common platform.

 

Maybe my comment was misleading: I wasn't saying that I would postpone or suspend all effort with the CubeCell modules until PlatformIO support was in place, rather I was saying that I might wait until the CubeCell PlatformIO support was in place before I considered switching to PlatformIO.

 

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
it depends on what you want/need/expect

Indeed - so wondering what wants / needs / expectations it fulfils.

 

For me, being able to start right away is key - without having to wait around for 3rd parties to fit "support" into their schedules.

 

And there's always the trouble with 3rd-party IDEs when things don't work - who will sort it out?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"For me, being able to start right away is key - without having to wait around for 3rd parties to fit "support" into their schedules. "

 

Read what I wrote. I'm not waiting around.

 

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Think of it like the Arduino tools with a decent editor, debugger and git integration.

 

Arduino supports a zillion different boards/cpus now.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah - your other post (#22) hadn't appeared when I started writing #23.

 

#22 does, indeed, clarify.

 

John_A_Brown wrote:
I have no idea how I would go about using "the standard PSoC tools", whatever thay might be.

That'll be a key differentiator in driving our different  wants / needs / expectation, then !

 

wink

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it international smugness day?

How did I miss that?

 

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
... non-Microchip boards ...
the Microchip boards with a built-in debugger :

  1. Atmel SAM · Platforms · PlatformIO
  2. Debug pull-down menu, select On-board

The available debuggers per the information bubble :

  • CMSIS-DAP (a part of EDBG)
  • Atmel-ICE
  • Blackmagic
  • SEGGER J-Link

 

Home · blacksphere/blackmagic Wiki · GitHub

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
would also like to see support for pic18 too.
fyi, the PIC32 debugger issue :

Debugging feature · Issue #9 · platformio/platform-microchippic32 · GitHub

J-32 is a GDB server; might not take much work and effort to add J-32 to PIO Unified Debugger.

 

J-32 Debug Probe

https://www.avrfreaks.net/forum/microchip-madness-pic32-locked-j-link-more-expensive-unlocked-seggger?page=1#comment-2841781

PIO Unified Debugger — PlatformIO 4.2.0rc1 documentation

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Think of it like the Arduino tools with a decent editor, debugger and git integration.

So how does the new Arduino "Pro" IDE compare ?

 

https://www.avrfreaks.net/forum/arduino-pro-ide-alpha-now-available

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...