cancel
Showing results for 
Search instead for 
Did you mean: 

Does STM32CubeIDE generate a target arch macro?

Konami
Senior II

I'm looking for something like __TARGET_ARCH_6_M or __ARM_ARCH_6M__ from my G0 project but don't see anything. Is this done by the IDE based on the selected target hardware, or would I need to add a preprocessor macro manually to my project?

2 REPLIES 2
Peter BENSCH
ST Employee

CubeIDE is based on CMSIS and CMSIS is in turn managed by ARM.

__TARGET_ARCH_6_M and other defines are handled in CMSIS, which also derives other defines from them, here e.g. __ARM_ARCH_6M__.

You don't have to add this to your project as CubeIDE usually already knows which target you are using.

If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

That's what I would have thought as well, but it seems like neither __TARGET_ARCH_6_M nor __ARM_ARCH_6M__ are defined in my project (any code wrapped in these #defines is removed)