Electronic – use just plain GCC to compile program for Nucleo

gccmicrocontrollernucleostm32

I have a ST Nucleo F446RE. It's an ARM board which provides quite an interesting interface for uploading programs – it presents itself as USB storage device and the program can be copied on it, which causes Nucleo to reset and launch the program.

As such, I'm kinda reluctant to even bother installing (yet another) development toolchain. I'd rather just use GCC compiler, some makefile for compiling and flashing and probably some required Nucleo header libraries.

Is there a way to setup lightweight environment like this for Nucleo? It's probably worth mentioning that I'm a newbie to emdedded development.

Best Answer

As for any other processor, you will need a compiler that targets the CPU you're using.

In other words, yes, you should/can use the GCC, but: you can't use the gcc that targets your PC, but need to use a GCC that targets the processor.

In this case, the compiler would be called arm-none-eabi-gcc (for ARM ISA, with no OS, with the extended application binary interface), and you'd need to tell the linker (which must also target the same platform) how much memory you have in which address spaces (that's the job of a linker script). Then you'd probably also want an arm-none-eabi-gdb; in essence, you need a complete arm-none-eabi toolchain.

But this toolchain is pretty easy to get; on my systems (Fedora Linux), that'd be as complicated as using dnf search arm-none-eabi to find the packages I want and then dnf installing those.

Often, you can use your existing editor/IDE environment pretty smoothly for embedded development simply by telling it that it has to prefix each executable name (gcc, as, ld, …) with arm-none-eabi; done.

Related Topic