AnsweredAssumed Answered

Macro visibility on a CubeMX new project

Question asked by Massimiliano Francone on Jun 12, 2018

Hi all!

 

I use a stm32f4xx MCU and I've created a very simple project in cubemx foratollic truestudioWhile browsing in the project's code and files I run into a strange issue when I tried to use the __INLINE, __STATIC_INLINE or__ASM macros in the main.c file.

 

Let's me explain better.

 

Since I use the  CortexM4 CPU, the reference file for such as macros is the core_cm4.h one. In fact, if I try to call a macro like __CORTEX_M it regularly "belongs" to such as file (if I open its declaration) and it appears in the drop-down menù of the TrueStudio code editor. On the other hand, the aforementioned macros are not available in the drop-down menù. In addition, they got flagged as 'syntax error' and underlined in yellow if I disregard this defect and write them entirely. As a result, the compilation does not report any message or warning!

 

The interested code's lines of the core_cm4.h file are (__GNUC__ is defined):

#elif defined ( __GNUC__ )
#define __ASM                   __asm                                   /*!< asm keyword for GNU Compiler */
#define __INLINE               i nline                                     /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Even though I move the macros' declation out of conditional statements the effect is the very same one. It seems they are not visible to TrueStudio absolutely, not even starting from a CubeMX project from scratch.

 

Is this a bug or I'm overlooking something?

Attachments

Outcomes