Anyone switched from STM32CubeIDE (Eclipse) to VS Code with CubeMX extensions? - Page 1
Forum section: electronics / general

author: jnz
author_rank: Frequent Contributor
timestamp: August 15, 2022, 09:44:23 pm
content: Looking for the pain points.After years of ignoring VS Code for VS reasons, I needed a markdown editor I didn't hate and.... actually really like VS Code. It's lighter than Atom and the plugins are pretty damn good so far.So it got me thinking... Why am I still using Eclipse / CDT / STM32CubeIDE? There is an extension (stm32-for-vscode) that seems to add most of the CubeMX tie-in features. I haven't looked into Debug options, but it looks as good as any OpenOCD or GDB alternatives.Has anyone gone through it?Major issues like it's still makefile based. And while there is an Eclipse project importer, I'm sure there will be something that doesn't scale over correctly.Then again, I've had a hard enough time with Eclipse doing weird things with imported files that I'm willing to give it a try.Advice?

author: agehall
author_rank: Frequent Contributor
timestamp: August 15, 2022, 10:07:26 pm
content: I’d suggest looking at PlatformIO and VSC. There are tools to take the output from the configuration tool (CubeMX?) and turn it into at PIO project so you can still use the GUI tool to configure everything.Was really convenient the last time I had to work on an STM32, especially since I can’t stand Eclipse-based IDEs.

author: thm_w
author_rank: Super Contributor
timestamp: August 15, 2022, 10:12:38 pm
content: Link:https://marketplace.visualstudio.com/items?itemName=bmd.stm32-for-vscodePlatformIO:https://marketplace.visualstudio.com/items?itemName=platformio.platformio-idehttps://github.com/jbaumann/pio_and_stm32cubeideOr if you don't care about lightweight, and can use VS:https://visualgdb.com/?features=embedded

author: jnz
author_rank: Frequent Contributor
timestamp: August 16, 2022, 02:37:06 am
content: I don’t know a ton about PIO, but I was under the impression it was like arduino and has its own formats and systems for building, I don’t think I want to add any Platform stuff to my code.This isn’t a hobbiest project I’m working on. I’m sure someone “real” is using that framework, but I haven’t really seen anything to that level.Is there some way to use and get benefit from those tools without making it a “platform.io project”?

author: agehall
author_rank: Frequent Contributor
timestamp: August 16, 2022, 01:09:17 pm
content: Do NOT campare Arduino and PIO. That is like comparing a broken bike to a brand new race car - not really the same thing.You can set PIO up to build using anything you like. There is a bit of setup for the project if you don’t want the defaults, but it is easy.

author: betocool
author_rank: Regular Contributor
timestamp: August 17, 2022, 11:11:33 am
content: If it works, I think it's a really good idea. I've been using VS Code for almost everything except Jupyter... but still a bit. VHDL, Python, you name it, it goes through VS code. The Quartus editor is so bad, it's better to work on VS Code and just click on the "compile" button.Back on topic, I briefly tried PIO on Windows, and I found it difficult to just get a microcontroller (STM32L4 I think, with custom hardware) up and running. Lots of dev kits though. But I didn't immediately dislike it, just didn't look into it enough.I believe CubeMX does generate a Makefile project if necessary. Just add your own sauce I guess... but I never tried.Cheers,Alberto

author: tooki
author_rank: Super Contributor
timestamp: August 19, 2022, 05:58:58 am
content: Quote from: jnz on August 16, 2022, 02:37:06 amNot all. PIO supports a number of frameworks, of which Arduino is one, and CubeMX is another. For a project in PIO, you select the framework you want to use, provided it’s available for the selected board/MCU. (You cannot, for example, use CubeMX with an Arduino board.)Whether PIO is superior to the CubeMX IDE I can’t say, I haven’t used it. (At school, we had to use Keil to program STM32. I hate its editor, but man, does it compile and upload quickly!!) PIO is popular in the Arduino crowd, especially using ESP32, precisely because it’s a billion times better an IDE than Arduino’s own.

author: jnz
author_rank: Frequent Contributor
timestamp: August 20, 2022, 04:19:15 am
content: Right… so… I spent some time trying to get SMT32-for-VSCode extensions up and it works alright but it’s not really as IDE as I am used to. I want to build; and if there is an error see it in the output window, see it highlighted on that line of code if the file is open, and get a list in the problems panel with links to the code. I want how much memory is remaining, etc. It seems to work and is developed well, but I want a whole turnkey solution.So… I tried some MCU IDE extension written in Japanese or Chinese. No go there either.I’ll try platform.io in the morning. I need a real IDE but have a couple immediate problems:I feel like I’m going backwards a bit. I hated Keil. I grew to hate Segger Studio (Rowley crossworks). I really don’t mind STMCubeIDE/Eclipse but it’s just not as nice as VS Code. So now going to PlatformIO I feel like… like I haven’t seen professional products made in it, and it concerns me. Probably dumb, but perception could be reality. I know tons of “real” products are done in Keil and man I hated that whole system.I don’t love their “you get one folder for source one for includes” thing. But honestly it makes sense and is probably something I would do if I made an IDE. It makes building and linking so much easier if you can enforce a rule like that.I’m looking forward to a way to test. It seems great to have that properly built into the IDE. But this is a lock-in concern.

author: darkspr1te
author_rank: Frequent Contributor
timestamp: August 20, 2022, 07:21:02 am
content: I'am user of what works best for any situ, some times i use arduino just for speed and sometimes platformio +cubemx when i want to build something similar to the device am reverse engineering.The one thing i like about platform io is that i can create a cubemx folder, export the folder, add the platformio.ini with me settings in it and hit ctrl+shift+u to compile and upload. I also have the choice of debug type from openocd, black magic probe,jlink etcsee my github repo for examples of simple and complicated platformio file that allow all sorts of compile types.https://github.com/darkspr1tedarkspr1te