Skip to main content
LZhen.5
Associate
February 28, 2022
Question

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 ?

  • February 28, 2022
  • 8 replies
  • 2996 views

..

This topic has been closed for replies.

8 replies

KnarfB
Super User
February 28, 2022

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
LZhen.5Author
Associate
February 28, 2022

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
LZhen.5Author
Associate
February 28, 2022

0693W00000KamihQAB.jpg

LZhen.5
LZhen.5Author
Associate
February 28, 2022

0693W00000KamoVQAR.jpg

LZhen.5
LZhen.5Author
Associate
February 28, 2022

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

LZhen.5
LZhen.5Author
Associate
February 28, 2022

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

waclawek.jan
Super User
February 28, 2022

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

LZhen.5
LZhen.5Author
Associate
March 2, 2022
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.
Pavel A.
Super User
February 28, 2022

@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

LZhen.5
LZhen.5Author
Associate
March 2, 2022
Thanks for your help.The problem has been solved.The Macro Statement has been set in Keil Setting part. At 2022-03-01 04:30:23, "ST Community" wrote: @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 Pavel A. (Community Member) @LZhen.5 (Community Member) 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 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 ? Pavel A. (Community Member) @LZhen.5 (Community Member) 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 Monday, February 28, 2022 12:30 PM You're receiving emails when someone "Mentions me in a comment." To change or turn off ST Community email, log in as lzstry@163.com.st. STMicroelectronics N.V.