cancel
Showing results for 
Search instead for 
Did you mean: 

Now I am using STM32F407ZGT6,In all files ,I cann't find "# define STM32F40_41xxx",but in many places ,it need to use "#if defined (STM32F40_41xxx)" as MACRO .Why ?

LZhen.5
Associate II
10 REPLIES 10
KnarfB
Principal III

What compiler / IDE? Did you generate the code?

The MCU type like STM32F40_41xxx is defined in the complier command line, not in the source code.

hth

KnarfB

LZhen.5
Associate II

I use Keil5 and J-link platform,the programme can run normally,I'm learning the rules about the MCU now.according my understanding,the "#define STM32F40_41xxx" Macro must be writed in a head file(.h file),why is not there in whole project files?

LZhen.5
Associate II

0693W00000KamihQAB.jpg

LZhen.5
Associate II

0693W00000KamoVQAR.jpg

LZhen.5
Associate II

Is the selection below can instead of the  "# define STM32F40_41xxx" Macro?0693W00000KamtpQAB.jpg

LZhen.5
Associate II

Mr. KnarfB,thank you for your reply. excuse me ,do you speak Chinese, because my English is poor.

I don't use Keil, but maybe this is the information you are looking for https://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm

JW

Pavel A.
Evangelist III

@LZhen.5​ Are you sure that this macro is defined? If you cannot find where it is defined, perhaps it simply is not. Try this:

#ifndef STM32F40_41xxx

#error

#endif

Thank you for your reply.Now I understand the reason ,just like you gived the "arm keil" issue. At 2022-03-01 02:38:03, "ST Community" wrote: What IDE are you using? Maybe this is the information you are looking for https://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm JW waclawek.jan (Community Member) What IDE are you using? Maybe this is the information you are looking for https://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm JW or reply to this email Replying to LZhen.5 (Community Member) asked a question. Sunday, February 27, 2022 11:27 PM Now I am using STM32F407ZGT6,In all files ,I cann't find "# define STM32F40_41xxx",but in many places ,it need to use "#if defined (STM32F40_41xxx)" as MACRO .Why ? waclawek.jan (Community Member) What IDE are you using? Maybe this is the information you are looking for https://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm JW Monday, February 28, 2022 10:38 AM You're receiving emails when someone "Comments on my posts." To change or turn off ST Community email, log in as lzstry@163.com.st. Are notifications about this post getting annoying? Reply to this email with the word " mute ". STMicroelectronics N.V.