cancel
Showing results for 
Search instead for 
Did you mean: 

Macro visibility on a CubeMX new project

Posted on June 12, 2018 at 00:32

Hi all!

I use a

https://community.st.com/tags♯/?tags=stm32f4xx

 MCU and I've created a very simple project in

https://community.st.com/tags♯/?tags=cubemx

‌ for

https://community.st.com/tags♯/?tags=atollic%20truestudio

‌. While 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):

&sharpelif defined ( __GNUC__ )

&sharpdefine __ASM                   __asm                                   /*!< asm keyword for GNU Compiler */

&sharpdefine __INLINE               i nline                                     /*!< inline keyword for GNU Compiler */

&sharpdefine __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?

#atollic-truestudio #cubemx #stm32f4xx
0 REPLIES 0