有一点疑问

2019-07-20 19:36发布

为什么在system_stm32f4xx.h头文件中的一个语句  extern uint32_t SystemCoreClock中前边有一个x啊?显示没有定义uint32_t什么的     我在前边加上include "stm32f4xx.h"  就没有了,因为顶层头文件里有u32的定义 ,但是加上"sys.h" 就会报错,明明sys.h里边也有stm32f4xx.h啊?这里不是很明白  求解释?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
7条回答
正点原子
1楼-- · 2019-07-21 01:10
你这是库函数版本代码。加库函数版本的sys.h才可以。
初学者要变大师
2楼-- · 2019-07-21 06:42
加入sys.h报错 是说在编译过程中报错了     当然什么都不加的话  即使有x也能编译通过  很奇怪啊
正点原子
3楼-- · 2019-07-21 09:13
加入sys.h,看报什么错,根据报错提示去修改
初学者要变大师
4楼-- · 2019-07-21 13:11
正点原子 发表于 2016-10-12 20:22
加入sys.h,看报什么错,根据报错提示去修改

这个报错我不是很懂   

Build target 'Template'
compiling main.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
main.c: 0 warnings, 1 error
compiling stm32f4xx_it.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
stm32f4xx_it.c: 0 warnings, 1 error
compiling system_stm32f4xx.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
system_stm32f4xx.c: 0 warnings, 1 error
assembling startup_stm32f40_41xxx.s...
compiling misc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcmisc.c: 0 warnings, 1 error
compiling stm32f4xx_adc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_adc.c: 0 warnings, 1 error
compiling stm32f4xx_can.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_can.c: 0 warnings, 1 error
compiling stm32f4xx_crc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_crc.c: 0 warnings, 1 error
compiling stm32f4xx_cryp.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_cryp.c: 0 warnings, 1 error
compiling stm32f4xx_cryp_aes.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_cryp_aes.c: 0 warnings, 1 error
compiling stm32f4xx_cryp_des.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_cryp_des.c: 0 warnings, 1 error
compiling stm32f4xx_cryp_tdes.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_cryp_tdes.c: 0 warnings, 1 error
compiling stm32f4xx_dac.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_dac.c: 0 warnings, 1 error
compiling stm32f4xx_dbgmcu.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_dbgmcu.c: 0 warnings, 1 error
compiling stm32f4xx_dcmi.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_dcmi.c: 0 warnings, 1 error
compiling stm32f4xx_dma2d.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_dma2d.c: 0 warnings, 1 error
compiling stm32f4xx_dma.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_dma.c: 0 warnings, 1 error
compiling stm32f4xx_exti.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_exti.c: 0 warnings, 1 error
compiling stm32f4xx_flash.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_flash.c: 0 warnings, 1 error
compiling stm32f4xx_flash_ramfunc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_flash_ramfunc.c: 0 warnings, 1 error
compiling stm32f4xx_fsmc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_fsmc.c: 0 warnings, 1 error
compiling stm32f4xx_gpio.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_gpio.c: 0 warnings, 1 error
compiling stm32f4xx_hash.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_hash.c: 0 warnings, 1 error
compiling stm32f4xx_hash_md5.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_hash_md5.c: 0 warnings, 1 error
compiling stm32f4xx_hash_sha1.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_hash_sha1.c: 0 warnings, 1 error
compiling stm32f4xx_i2c.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_i2c.c: 0 warnings, 1 error
compiling stm32f4xx_iwdg.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_iwdg.c: 0 warnings, 1 error
compiling stm32f4xx_ltdc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_ltdc.c: 0 warnings, 1 error
compiling stm32f4xx_pwr.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_pwr.c: 0 warnings, 1 error
compiling stm32f4xx_rcc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_rcc.c: 0 warnings, 1 error
compiling stm32f4xx_rng.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_rng.c: 0 warnings, 1 error
compiling stm32f4xx_rtc.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_rtc.c: 0 warnings, 1 error
compiling stm32f4xx_sai.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_sai.c: 0 warnings, 1 error
compiling stm32f4xx_sdio.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_sdio.c: 0 warnings, 1 error
compiling stm32f4xx_spi.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_spi.c: 0 warnings, 1 error
compiling stm32f4xx_syscfg.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_syscfg.c: 0 warnings, 1 error
compiling stm32f4xx_tim.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_tim.c: 0 warnings, 1 error
compiling stm32f4xx_usart.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_usart.c: 0 warnings, 1 error
compiling stm32f4xx_wwdg.c...
..SYSTEMsyssys.h(86): error:  #20: identifier "u32" is undefined
  void MSR_MSP(u32 addr);       //设置堆栈地址
..FWLIBsrcstm32f4xx_wwdg.c: 0 warnings, 1 error
初学者要变大师
5楼-- · 2019-07-21 14:12
 精彩回答 2  元偷偷看……
烟酒不沾
6楼-- · 2019-07-21 20:10
 精彩回答 2  元偷偷看……

一周热门 更多>