Skip to main content
Konami
Senior
September 22, 2021
Question

Does STM32CubeIDE generate a target arch macro?

  • September 22, 2021
  • 1 reply
  • 654 views

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?

This topic has been closed for replies.

1 reply

Peter BENSCH
Technical Moderator
September 23, 2021

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.
Konami
KonamiAuthor
Senior
September 23, 2021

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)