No video
PlatformIO - A True Alternative to the Arduino, MBED, and STM32 IDEs
There are hundreds of microcontroller boards available. And sometimes it seems that there is just as many frameworks and IDEs. The Arduino IDE is great in that it abstracts away a lot of the nitty gritty details about each and every board. But PlatformIO does all that and more , but not just for Arduino but also for MBED, STM32Cube, Zephyr, CMSIS, and more!
Introduction to Android app development: www.dgitacadem...
Let Me Explain T-shirt: teespring.com/...
Twitter: / garyexplains
Instagram: / garyexplains
#garyexplains
Пікірлер: 146
Definitely a big fan of PlatformIO for development.
@ramimehyar481
Жыл бұрын
Not if you have an stm32 and use the stmduino stuff! A trivial program will overflow your flash... blinking is all you can do with such huge build sizes.
@ScottLahteine
Жыл бұрын
@@ramimehyar481 FWIW - The build size for Marlin Firmware with a graphical display on a common STM32 board using STM32duino comes to around 150KB. Enabling several features may bring the build size over 256K, but most configurations result in a binary size under 256KB.
Platformio is a great example of the awesomeness that open source can make possible. A coherent suite that wouldn't be possible without GCC and a bunch of specialist open source programming, upload and debugging tools for different platforms
@IsaacBG84
5 ай бұрын
Well yes , we would be stuck on one IDE per mcu manufacturer. One for ESP, another for microchip, etc.
12:15 Failure to upload automatically (requiring manually holding the BOOT button) is usually due to the EN line not being held low long enough, causing it to boot before the IO0 line has been pulled low. The fix is easy: add a 1 μF - 10 μF capacitor between EN and ground.
Thanks Gary for your video. Based on that, I tried PlatfromIO for stm32 L031K6 with Arduino library, and the postive surprise was real. Debugging option still complements that configuration. It's really great that you made that video where that shows most important (well RP2040 is missing) microcontrollers that can be used under Arduino model.
@GaryExplains
Жыл бұрын
Thanks. The Pico wasn't out when I made the video, I guess a refresh might be in order!
Seeing Gary have Platform IO running so seemingly smoothly, it is making me want to go back and give it one more chance today. I'm not sure if it will have me abandon Visual Micro, but I would like it to. I have a lot of hopes for the PIO project.
Vscode and the PlatformIO plugin does it for me! Thanks for the vid.
Usually I change the range of processors less frequently than the time that these kind of platforms survive.
I used PlatformIO to write some test code for a STM32 board and found it very straightforward to install and program via STLink. However, the system I was working on had an add on WiFi interface that would allow you to flash new code with a BIN file (convenient when the dev board is part of a system on another work bench). I could not work out how to configure PlatformIO to generate HEX or BIN files when using libopencm3 on STM32; It seemed I needed to edit a configuration file, but I did not seem to have that fie in the location described.
Was jaded and left tech for good... But your videos brought me back and I rediscovered my love for tech and programming.
@GaryExplains
3 жыл бұрын
Great to hear!
Glad it just works for you, been trying to use it for nodemcu esp32 for a while and keep getting compile errors. While searching I see people complaining for almost a year and no solution. Arduino IDE compiles fine.
@TimeFadesMemoryLasts
3 ай бұрын
what's wrong specifically? I never had problems with nodemcu and all ESP32 boards I used (but didn't use it in the last few years)
This is simply the best explanation about platformio on yt, bar none !!!
@soulife8383
3 жыл бұрын
void Bar(int i); void Bar(Bar* b); void Bar(bool b); main() { Bar(0); Bar(NULL); // same as Bar(0) }
Thanks for the great tutorial ! I just went thru the same process as you with 3 different boards (Arduino Uno, ESP32 Devkit and Nordic nRF52-DK) and it took less than an hour to get them all working.
@GaryExplains
3 жыл бұрын
Glad it helped
@wizardy6267
2 жыл бұрын
Good for you, I am using VSC on Ubuntu22.04, with nRF52480-DK on the MBed platform, the project intialize time is over 1 hour and there is no message so far I have no idea what is going on, and I re-tried for few times.
FIRST!!!!
@yusufcosgun4769
3 жыл бұрын
Second!!
@clue0001
3 жыл бұрын
Thanks for the video Gary! 👍 Very interesting indeed. I have yet to test PlatformIO with the STM32Cube framework and debug via SWD. Until now, I've only used it for the expressif framework with ESP32s.
@1MarkKeller
3 жыл бұрын
LOL!
@Hasan...
3 жыл бұрын
You just got lucky, you happened to run KZread just the time Gary upl.. oh wait
Using it since serveral years. Long before they switchs to VS-Code even. Their automatic, uncancelable updates have TWICE destroyed my working development environment that I just left alone for a year before needing to make some tweaks to production firmware. First time it took me 4 DAYS, second time 2 days to get back on track. The uninstaller DOESN'T UNINSTALL a hundret MB of broken code that f*** up the build system after a full uninstall + reinstall. It doesn't work with code on network drives (Character encoding crashes). It doesn't handle basic exceptions anywhere even if it's issues that are easy to handle gracefully or at least provide additional information to find the culprit (e.g. add the filename of a file that contains an undecodable character to the Exception).
I have downloaded this but haven't used it because it seemed daunting but this explains heaps. Thanks mate.
Thanks for this Gary, really good tutorial please follow up on more examples using PlatformIO
It's very good to listen and learn this from you
@1MarkKeller
3 жыл бұрын
The Professor professes professionally and proficiently.
further update - I used PIO for a while - it can be good as per my other post here, but currently (2023) there is no stable/ working solution for code upload to AVR4809, and support can't sort it. So I'm using JTAG2UPDI in arduino and VScode as an editor. (JTAG2UPDI does not work in PIO)
I use PlatformIo for my projects. But always have problems with my USB Ports. Sometimes my other USB Devices got unpluged on the upload process. I dont know why but i think in the arduino IDE i had no problems like this
@b89john
3 жыл бұрын
I had problems with USB ports on my installation. I was running Platformio on linux. The default version of Python was 2.7. After upgrading to the latest version of Python (3.7 I think) the USB ports functioned correctly. It may be worth a check to see if this has any relevance to your problem.
*GARY!!!* *Good morning Professor!* *Good morning fellow classmates!* Stay safe out there everyone!
@GaryExplains
3 жыл бұрын
MARK!!!
I had some trouble using some AdaFruit libraries with an Arduino build using PIO. I'm still just getting my feet wet so I probably just did something wrong with it. But I really love the idea of using VS Code instead of the Arduino IDE.
This has been so helpful. Thanks so much Gary, subscribed ❤
Platform IO has given me NOTHING but headaches in the past. And for the past 4 months, a paid copy of Visual Micro, which is an extension for Microsoft Visual Studio (NOT VScode)! It sets up the Arduino infinite loop. But it gives you the full power of Visual Studio to manage folders, libraries and you have it. And it works flawlessly every time. I need to check if it can do all of the other frameworks, but even if not. One can still start from scratch and write their own Main program and write in a loop.. And if done properly, will save A LOT of space.
@larrybud
8 ай бұрын
How does it work with 3rd party library downloads?
This Channel is awesome. Thanks Gary!
9:30 Huh?!? I’ve never had to prepare an ESP32 to program it from either Arduino IDE or PlatformIO. This includes on custom boards onto which I installed virgin ESP32 modules (not dev boards). Programming doesn’t use a bootloader (or rather, I guess it’s built into the ESP32). It’s just straight UART with the boot select pins (IO0 and IO2) and reset pin (EN) sequenced appropriately, which the USB-serial adapter does.
Wonderful PlatformIO introduction, I also think is the best IDE for program microcontroller boards.
Great video, lots of info I didn't know, platformio is extremely powerful and smart, and much faster than the Arduino IDE.
Thanks for the info - I hope I remember the existence of PlatformIO when I finally get some time to play around with my MSP430 Launchpads again!
Nice explanation. Being an C++ programmer, I wanted to try Platform IO but reading lot of comments mentioning various issues, I would go back to Arduino IDE and STM Cube Ide....
@soulife8383
3 жыл бұрын
Borland is best
Vsc is a nice IDE. It helps specially in projects with many code lines. In that cases, it reduces a lot of coding time, compared with Arduino IDE. The downside is.. when i use more than one connected boards, its impossible to set up the right port and the monitor speed. It just ignore platformio.ini. Also, it often needs a restart, othewhise it wont build and upload the right project. This happen when you have more than one project at the same workspace
@wizardy6267
2 жыл бұрын
The only problem Arduino IDE is, it is for Arduino. Arduino is good for learning things in concept not practial works. When you working on a commercial product you are highly likely using mbed, freeRTOS or Zephyr but not Arduino.
Thanks Gary, Greate video
That was great! More, please!
Thank You! From Frisco, TX
Do yourself a favor and change the "upload" to an "upload and monitor" shortcut. This way if you have a while(!serial) statement in your setup (waiting for the serial port to be ready), it will open the terminal window right after upload. I wish they made this for visualstudio. VS is so much faster than VScode.
mbed is the easiest and most convenient because of its online compiler. There’s nothing to install. Just logon, write your code on the web page, click compile and if all’s well and then file copy the binary to your mbed and reboot it mbed to run your program QED
@ernestuz
3 жыл бұрын
I was going to say that the problem appears when the application grows and you have to start debugging using breakpoints, but apparently mbed supports it now, so THUMBS UP!
I recently switched to VSCode and PlatformIO and love it. But I see the next Arduino IDE beta is based on VSCode. Interesting to see how that compares.
@Autotrope
3 жыл бұрын
Based on? I hope that doesn't mean they're forking vscode and they're just building on it like with platformIO. Last thing we need in 10 years is an Arduino IDE that's ten years behind vscode.
Make a video on custom targets for platforms like MBED, I had a heck of a time trying to get my weact blackpill v2 (stm32f411ceu6) working in MBED. I found a github repo with some of the custom target jsons needed but it took some time to figure out all the things you need to do to get it to work.
Thanks for the information, have not heard of it before but I will test it
Thanks Gary, very informative I will use Platformio very soon.
Interestinly enough - I just deleted this extension in vs code. Shame, because it's my preferred editor...but PlatformIO was causing a problem in that it'd crash vs code or even my PC when I was working offline. Happened a few times before I realised what was causing it, apparently PlatformIO needs a constant internet connection or it gets grumpy. Note, this was happening just using vs code and not using PlatformIO, was workingon other projects and it kept happening. Should be able to work offline without stupid stuff like that happening. Definitely PIO causing it, hasn't happpened again since I uninstalled.
I can't get my st-link v2 connected to platform io. Does anyone know how to fix it?
Hey, Can you explain how can i use platformio with stm32
Wow, thanks for this Information. I will definitiv give it a try
May I suggest VScodium?
Alternative? Not really. PlatformIO blows other IDEs out of the water. Arduino IDE is good for total newcomers and their Blinky projects. Anyone more serious than that will benefit tremendously from using PlatformIO and even beginners should be actively steered towards PlatformIO for their own good.
@GaryExplains
3 жыл бұрын
You say it isn't an alternative and then go into detail about how it is an alternative. 🤔
@user-xv4id9xx7u
3 жыл бұрын
Not really alternatives, though. More like different products targeting different groups of users. Arduino IDE is good for Blinky-like projects, PlatformIO for everything more complex. Their features do overlap but they are not exactly alternatives.
@GaryExplains
3 жыл бұрын
@@user-xv4id9xx7u The Oxford English Dictionary defines alternative as "one of two or more available possibilities." I think that defines PlatformIO, in the context of Arduino, perfectly.
200.000 soon :) well deserved
How do I use platformio for STM32F030
Well done!!!
I have an Anycubic Mega Zero that I installed a heated bed mod on. I don't know what board this has. I have looked but I can't find an answer to this question. I have installed VS and PlatformIO. I don't know what other files I may need? I just can't figure out how to flash the new firmware that incorporates the heated bed? I found all kinds of files on github, but I have no clue which ones I need. Any help you can give would be most graciously appreciated.
PlatfromIO seems nice, but then i discovered it's c/c++ tooling doesn't have refactoring features (not major ones that is)
This is great..until it gets some kind of error, then you have no clue on how to fix it since you never had to understand dig in to the underlying tools. Even with arduino I find myself having to debug why things don't work. Will PIO make it better?
how do you use libraries and ino examples?
Well done. I enjoyed your video. Please show moe examples. This time please use RPI PICO board also.
No mention of the potential privacy issues with VSCode? Or the version that has all the telemetry removed, for those who care about that sort of thing? :(
@GaryExplains
3 жыл бұрын
No, no mention of that, since this video isn't about that.
@Autotrope
3 жыл бұрын
vscode is a product for which Microsoft is relatively open - even candid - about the information they collect from you, why and let you disable it. If you're not convinced, then vscodium is for you. But you should know that in comparison to other major Microsoft products, *particularly Windows 10*, vscode is the least of your concerns. Expand that to include pretty much any service or software from the likes of Google, or Dropbox, etc. Google Chrome alone is a big offender. If you use a Linux system bereft of any product from a company known to monitor user actions, then it would make sense to be concerned about vscode. But if you're running such a system, *why would you be using vscode*?
Very cool stuff, thank you for the "explain".
Nice!! :) I am considering using PlatformIO as a replacement for my MPLAB IDE for PIC32 micros. This is for coding of our custom PCBs (NOT standard dev kits). Few quick questions: 1) Is it possible to replace the ENTIRE MPLAB IDE with PlatformIO? 2) How easy (or not) is it to set it up specifically for the PIC32 family? 3) is there anything that MPLAB does that PlatformIO does not and/or that I should be aware of if switching over? Thank you
@marcioandreyoliveira
8 ай бұрын
Did you get the answers to the questions? In affirmative case, could you share them? Thanks.
I've been using PlatformIO in Clion, and it is definitely the way to go.
@17marijn71
3 жыл бұрын
Never thought about using Clion instead of vscode😶 Great idea!
@quantumhorizon
3 жыл бұрын
@@17marijn71, I've had a lot of luck with it so far. Plus I'm already familiar with Pycharm and the interfaces are nearly identical.
how to rename a platformio project ? thanks !
Could anybody inform please what is size of PlatformIO plugin for VS Code?
What about remote debugging? I've an stm32f401 board with usb C and stm link, visual studio is so much better than Arduino ide, how about platformio?
@tookitogo
Жыл бұрын
I haven’t used it extensively, but I have tested debugging in PlatformIO on a Nucleo board (at my old job, I don’t remember exactly which model) and it worked perfectly. I’ve used the PlatformIO debugger on ESP32 on a few real projects, and while still useful, it is much more fickle, requiring fiddly configuration on Windows. And on some sketches, it just won’t work at all. The Nucleo debugger just worked. I’ve been meaning to pick up some Nucleo boards, and the good debugger is a big reason why.
Hey brother thanks this great to know. One ? How do i restart vsc. Im new to this.
Interesting. Thanks !
Why the framework name needs to be repeated for each new board in .ini file?
Thank You for this great video :)
this is simply great
Almost 200k subscribers!
Our board zoos look so similar - men's fashion from the cupboard.
Can anyone please tell me if it supports STM32F103RB board?
@tookitogo
Жыл бұрын
You can check both from within PlatformIO as well as on the PlatformIO website.
Awesome!!!
Fun! If it worked - I tried to install it on two computers, and both installs failed with the same error. I even put time to find and do something to solve it. Seems like Python code is not the coolest nor safest. So 100% failure!! Totally ...ehrmm... bad, I was going to say bad *mmmm* Nice vid though! But the platform really needs some rework noneless. I got it working by uninstalling everything with Python and "remove the alias for Python installer" in Windows. then start the VSC and let it install the PIO again.
youre just amazing
thanks
unfortunately, if something happens with the configuration, it will no longer work again
Thanks - good stuff :)
Not sure ! Is it portable ?????
Professor Gary how about covering how custom ROMs are developed?
@GaryExplains
3 жыл бұрын
I did that over 4 years ago kzread.info/dash/bejne/a22At8yRZpaymLg.html
looks very interesting tool
Nice Job.
Awsome!
Great character and content quality, glad I've clicked! The subject/product however is, well, for the blinky engineers only ;-) ps. rather important to remain updated with manufacturers' ide and tools/drivers more than anything (for e.engineers).
It's never worked for me. It can't find any .h files. I'll have to give it another try.
@GaryExplains
3 жыл бұрын
Works fine for me, as I showed in the video. It seems unfair to call it junk, maybe the fault is yours not the tool?
I finally found a way to program my bluepill! STM32 software won't work... (I received the fake chip without knowing about it!). Thank you!
What a shame the libraries facility wasn't covered.
It can upload hex file to direct atmega328 chip- itself, instead of arduino bord?
@tookitogo
Жыл бұрын
Yes, using an AVR programmer or an Arduino with the appropriate program loaded on it.
How does it scale with gpio pin numbers As all boards have different pin numbers available for use
@0LoneTech
3 жыл бұрын
PlatformIO manages installation of toolchains like compilers and uploaders, and some libraries for peripherals, but your code is still basically designed for one of the packaged frameworks. E.g. Arduino uses its own idea of numbers for IO pins, so may just have more or less on different boards. You can use defined variables to differentiate your build configurations, e.g. ESP32-CAM builds get compiled with -DBOARD_ESP32CAM_AITHINKER.
@GaryExplains
3 жыл бұрын
I don't think I say anywhere in the video that the abstraction is at a code level or an API level. So, I don't think I misdescribed anything.
@0LoneTech
3 жыл бұрын
@@GaryExplains I apologize. I somehow got the impression it was described as abstracting away interfaces to peripherals and such. I've gone over the beginning of the video again and concluded I was mistaken.
I wish I could make it work.
I'm gonna argue this one. Arduino IDE is stupid simple to use and learn. The ultimate beginner's IDE where everything works right out of the box. PlatformIO in VScode is extremely powerful, but is a nightmare to learn and things don't "just work" out of the box. It just isn't simple and straightforward to learn and be successful as a beginner. FYI, I am using PIO, but it has been a fight uphill the entire way. The Arduino IDE was much faster to learn and was fun doing it. PIO has not been fun at all.
@larrybud
8 ай бұрын
The arduino IDE is fine for very simple, one file programs. But once you start with multiple files and classes, PIO is the way to go, but there's definitely a learning curve to those who don't know C++.
Platform IO add so much pain. I Could not configure it correctly
@GaryExplains
3 жыл бұрын
Sorry to hear that, I have found it super helpful.
@cronchcrunch
3 жыл бұрын
Hi. What is the problem you are experiencing with it?
@cronchcrunch
3 жыл бұрын
If you are at college or university you could be a free licence to use CLion from JetBrains. Often times when I'm having trouble with PlatformIO on VS Code, the PlatformIO plugin on CLion works perfectly for me.
@yahyakhalid6599
3 жыл бұрын
I second this! PlatformIO at this stage is anything but stable. Lots of hassle during configuration, new update comes and boom!!....now your last night working code isn't working anymore. Was using it for ESP-IDF but had to shift due to its never ending problems. It's great and have good builtin functionality but it's not stable yet..... Atleast not for all boards and definitely not ESP-IDF which I've personally used. However, i tried arduino with it too but haven't encountered a problem. Maybe it's just some boards and frameworks that needs refining. Who knows....
seems like its built specifically to separate developers from programmers.......
VSCodium, it's VSCode without Microsoft garbage... You just have to download the extensions to install them manually, but that's worth it personally...
@Autotrope
3 жыл бұрын
You do know vscode is a Microsoft product do you? If you remove all the Microsoft stuff from vscode you end up with nothing. Vscodium just disables some of the telemetry by default instead of requiring you to do it in settings.
The microcontroller world is worse than the 70's and 80's PC environment ... it is scatterbrrain territory ... and don't call me dude. $0.02
@digitalinversion9500
3 жыл бұрын
dude not cool
госпади, ну какая бредятина ))) прости их души .. жду дня когда самолёты полетят на ардуино
Shame its not 100% ArduinoIDE compatible and totally fails to build any ArduinoIDE library that relies on being able to detect hardware / board type etc using standard, well-known, long-established Arduino #defines. For reasons know only to the PIO build team they simply invented their own, instead of using the exisiting correct ones, thus guaranteeing that many cross-platfrom libraries will break and thus cannot be used in PIO. Kinda dumb eh? Even dumber when you know they have known about this for four or five years and chose to continue using their own home-grown / no-earthly-reason / guaranteed code-breaking / 100% incompatible what-t-f-were-they-thinking non-standard #defines. Go Figure.
@user-hs2co3we4o
3 жыл бұрын
Can you elaborate a little bit?
@MarcusWolschon
3 жыл бұрын
Yes, it uses proper, clean C and does not do any of the C-incompatible stuff the Arduino IDE allows you to wrote. (search path for files, things must be defined before they are used,...)
Interesting up until you said Microsoft. No thank you.
@GaryExplains
3 жыл бұрын
Out of interest, which Linux distribution are you using?
@rnoma6898
3 жыл бұрын
@@GaryExplains I need the clock cycles in my FFT's. KDE is clean enough to run it.
Nice ripoff of the DroneBot Workshop video content. His exact video but with a British accent. Good job mate! Have any original thoughts or ideas? Give any credit to DroneBot Workshop?