帮朋友修改一段代码,但是他只发了一些函数过来,我下载了“IAR Embedded Workbench”,然后建立工程,将芯片设置为“STM8AF6226”,然后编译报错“Please select first the target STM8S/A device used in your application (in stm8s.h file)”;在STM8.H找不到“STM8AF6226”的定义,大侠们请帮帮忙,帮我编译过去, 相关代码如下 /* #define STM8S208 */ /*!< STM8S High density devices with CAN */ /* #define STM8S207 */ /*!< STM8S High density devices without CAN */ /* #define STM8S007 */ /*!< STM8S Value Line High density devices */ /* #define STM8AF52Ax */ /*!< STM8A High density devices with CAN */ /* #define STM8AF62Ax */ /*!< STM8A High density devices without CAN */ /* #define STM8S105 */ /*!< STM8S Medium density devices */ /* #define STM8S005 */ /*!< STM8S Value Line Medium density devices */ /* #define STM8AF626x */ /*!< STM8A Medium density devices */ /* #define STM8S103 */ /*!< STM8S Low density devices */ /* #define STM8S003 */ /*!< STM8S Value Line Low density devices */ /* #define STM8S903 */ /*!< STM8S Low density devices */ #if !defined (STM8S208) && !defined (STM8S207) && !defined (STM8S105) && \ !defined (STM8S103) && !defined (STM8S903) && !defined (STM8AF52Ax) && \ !defined (STM8AF62Ax) && !defined (STM8AF626x) && !defined (STM8S007) && \ !defined (STM8S003)&& !defined (STM8S005) #error "lease select first the target STM8S/A device used in your application (in stm8s.h file)" #endif |
从零开始操作STM8寄存器(风驰iCreate奉献)
【中文资料】初学STM8库函数的中文帮助软件
绝对经典的中文STM8学习手册,淘宝上学习板资料,友情大放送!
【原创教程】风驰iCreate独家开源STM8 27个例程和10多万字的pdf教程
STM8的LCD1602 4线驱动,为什么不工作
【精华资料】由零开始开发STM8
STM8S 的触摸库是如何在主程序中查询键的呢、
【精华资料】STM8的C语言编程1-14讲完整版
【精品教程】STM8系列单片机入门教程系列
STM8 第一次进中断不准【悬赏问答】
RE:第一次接触ST芯片,STM8S.H编译不过去,请帮帮忙看看
/* #define STM8AF626x */ /*!< STM8A Medium density devices */
RE:第一次接触ST芯片,STM8S.H编译不过去,请帮帮忙看看
RE:第一次接触ST芯片,STM8S.H编译不过去,请帮帮忙看看
RE:第一次接触ST芯片,STM8S.H编译不过去,请帮帮忙看看
编译报错
Building configuration: sbstcx - Release
Updating build tree...
STM8_EEPROM.c
Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) F:\新建文件夹 (2)\stcx\Source\main.h 51
Error[Pe029]: expected an expression F:\新建文件夹 (2)\stcx\Source\STM8_EEPROM.c 5
Error[Pe029]: expected an expression F:\新建文件夹 (2)\stcx\Source\STM8_EEPROM.c 14
Error while running C/C++ Compiler
main.c
Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) F:\新建文件夹 (2)\stcx\Source\main.h 51
Warning[Pe177]: variable "Data" was declared but never referenced F:\新建文件夹 (2)\stcx\Source\main.c 42
Warning[Pe177]: variable "Address" was declared but never referenced F:\新建文件夹 (2)\stcx\Source\main.c 43
Warning[Pe177]: variable "value_optbyte" was declared but never referenced F:\新建文件夹 (2)\stcx\Source\main.c 44
Warning[Pe177]: variable "value_optbyte_complement" was declared but never referenced F:\新建文件夹 (2)\stcx\Source\main.c 44
Warning[Pe177]: variable "res_value" was declared but never referenced F:\新建文件夹 (2)\stcx\Source\main.c 45
Error[Pe136]: struct "TIM3_struct" has no field "SMCR" F:\新建文件夹 (2)\stcx\Source\main.c 116
Error[Pe020]: identifier "TIM3_SMCR_TS" is undefined F:\新建文件夹 (2)\stcx\Source\main.c 116
Error[Pe136]: struct "TIM3_struct" has no field "SMCR" F:\新建文件夹 (2)\stcx\Source\main.c 117
Error[Pe020]: identifier "TIM3_SMCR_SMS" is undefined F:\新建文件夹 (2)\stcx\Source\main.c 117
Error[Pe136]: struct "TIM3_struct" has no field "SMCR" F:\新建文件夹 (2)\stcx\Source\main.c 118
Error[Pe020]: identifier "TIM3_SMCR_MSM" is undefined F:\新建文件夹 (2)\stcx\Source\main.c 118
Error while running C/C++ Compiler
stm8_interrupt_vector.c
Warning[Pe375]: declaration requires a typedef name F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 7
Error[Pe169]: expected a declaration F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 7
Error[Pe020]: identifier "interrupt_handler_t" is undefined F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 11
Error[Pe020]: identifier "interrupt_handler_t" is undefined F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 15
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 15
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 16
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 17
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 18
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 19
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 20
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 21
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 22
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 23
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 24
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 33
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 34
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 36
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 37
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 38
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 45
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 46
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 51
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 52
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 59
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 60
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 65
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 72
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 73
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 83
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 90
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 92
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 93
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 94
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 95
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 96
Error[Pe067]: expected a "}" F:\新建文件夹 (2)\stcx\Source\stm8_interrupt_vector.c 97
Error while running C/C++ Compiler
Total number of errors: 43
Total number of warnings: 8
RE:第一次接触ST芯片,STM8S.H编译不过去,请帮帮忙看看
然后我在“STM8S.H”里找“@far”的定义,
#ifdef _COSMIC_
#define FAR @far
#define NEAR @near
#define TINY @tiny
#define EEPROM @eeprom
#define CONST const
#elif defined (_RAISONANCE_) /* __RCST7__ */
#define FAR far
#define NEAR data
#define TINY page0
#define EEPROM eeprom
#define CONST code
#if defined (STM8S208) || defined (STM8S207) || defined (STM8S007) || defined (STM8AF52Ax) || \
defined (STM8AF62Ax)
/*!< Used with memory Models for code higher than 64K */
#define MEMCPY fmemcpy
#else /* STM8S903, STM8S103, STM8S003, STM8S105, STM8AF626x */
/*!< Used with memory Models for code less than 64K */
#define MEMCPY memcpy
#endif /* STM8S208 or STM8S207 or STM8S007 or STM8AF62Ax or STM8AF52Ax */
#else /*_IAR_*/
#define FAR __far
#define NEAR __near
#define TINY __tiny
#define EEPROM __eeprom
#define CONST const
#endif /* __CSMC__ */
我现在用的是IAR编译,是不是说只能用COSMIC编译??
RE:第一次接触ST芯片,STM8S.H编译不过去,请帮帮忙看看
RE:第一次接触ST芯片,STM8S.H编译不过去,请帮帮忙看看