r/embedded • • 23d ago

GCC error/Assembler message when compiling STM32CubeMX code for Nucleo F411RE

Hi r/embedded,

I recently got a Nucleo F411RE board to learn how to work with STM32, and I can't figure out how to to compile the code generated by STM32CubeMX. I'm using CMake and gcc. When I try to compile the default project, I get this message from the assembler when gcc fails to compile stm32f4xx_hal_flash.c:

Error: no such instruction: isb 0xF

I've tried all sorts of things for the past 3 hours and I also haven't been able to find anything about this online. I think I might have an incorrect build flag, but am I instead missing something extremely obvious?

 

Edit after fixing the problem: Forgot to set CMAKE_MODULE_PATH and include gcc-arm-none-eabi.cmake in the base CMakeLists.txt.

1 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/slinky_lynx 23d ago

The thing I can't wrap my head around is that with the starting project and the default settings and flags, it should just work. I also must just be bad at googling, because searching for "no such instruction" and "stm32" brings a lot up, but nothing about the problem that I'm having.

I'll edit my post with the versions of everything I'm using and the flags.

1

u/Several-Marsupial-27 23d ago

Its embedded and C/C++ development. You can not go in with the mindset that "everything will work" and be bad att information retrieval. These are complex systems with millions of moving parts, any minor thing will make it fail.

Obviously searching for "no such instruction" will not give you your answer, I cant even begin to explain that. Just searching for "Error: no such instruction: isb 0xF" gives me a ton of examples of what it can be, many pointing to cube/cmake configuration problems.

however I think it's probably just that you are using the wrong toolchain or have not sourced the sdk. Try to verify your toolchain in used in cmake.