this post was submitted on 29 Nov 2026
29 points (100.0% liked)

Programming

29437 readers
123 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS
 

I am new to STM32 and I think I need the STM32 Cube IDE to program this thing. I got a Nucleo board so I don't think I need STLink.

HAL library is apparently BSD-3-clause so I got no issue with that, but I'd prefer to not run the Cube IDE.

Is there any open source toolchain to replace what Cube does?

all 9 comments
sorted by: hot top controversial new old
[–] 5ymm3trY@discuss.tchncs.de 18 points 1 day ago (1 children)

You can just use the ARM GCC with STLink and whatever editor/IDE you like. You don't need CubeIDE or CubeMX. You can add whatever dependency you are comfortable with from there e.g CMSIS headers, libopencm3 or iirc the STM32 HAL. You probably need to be familar with setting up your build system with make, cmake or anything else.

There is a bare metal programming guide that really starts from 0 that is quite interesting. You can find it here: https://github.com/cpq/bare-metal-programming-guide

[–] yogurtwrong@lemmy.world 4 points 18 hours ago

For now, I followed this guide to get some stuff going with CMake and official HAL but I'll give the bare metal guide a shot because it looks very interesting. Ty

[–] Starfighter@discuss.tchncs.de 7 points 1 day ago* (last edited 1 day ago)

I know that the Rust ecosystem has fully independent toolchains for (some) STM32s. I can only imagine that similar things exist for C++ or whatever you want to use.

Keep in mind that using your own combination of tools (IDE, compiler, flasher, etc.) usually means that there are a few more manual steps involved.
For a beginner (even just in the STM ecosystem) this might or might not be worth it depending on what you want to do and learn.

[–] CYBERDEV@programming.dev 3 points 22 hours ago (1 children)
[–] Croquette@sh.itjust.works 5 points 1 day ago

Cube is essentially cross-compiling for your STM32 ARM architecture with gcc.

So you could use the generated linker files as a starting point or create your own and use Make/CMake with gcc to build and the GNU Debugger (gdb) to debug your code.

If you get that far, you can use any IDE or text editor on top of your setup, but you will have to integrate your build and debug actions and anything you need to your IDE/text editor.

It isn't as complicated as it sounds, but I don't know your level of skills.

[–] FizzyOrange@programming.dev 5 points 1 day ago (2 children)

Yes definitely. I've done it with Mbed back in the day. I'm sure Embassy and Probe-rs support it. Here's a template I found in a couple of seconds:

https://github.com/justinlhudson/embassy-stm32-starter

[–] yogurtwrong@lemmy.world 1 points 18 hours ago

I tried rust back in 2019 and was disappointed mostly due to its unpopularity back then.

Been considering learning Rust again, and this amazing project might be the final blow ngl.

[–] Ephera@lemmy.ml 2 points 1 day ago

Yeah, we played around with Embassy+Probe-rs for an STM32 board at $DAYJOB once and it was fairly straightforward. With the guidance of a colleague who had already done it before, it took 15 minutes to write a small program and flash it.