keil移植到IAR上出现问题

2019-10-16 06:51发布

KEIL调试成功之后移植到IAR上,出现一些未定义的错误,但是通过go to defination可以调到变量定义区。
Building configuration: CAN - Debug 
Updating build tree... 
CAN.c  
Error[Pe020]: identifier "GPIO_InitTypeDef" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 21 
Warning[Pe223]: function "RCC_APB2PeriphClockCmd" declared implicitly C:UsersAdministratorDesktopCANUsersCANCAN.c 27 
Error[Pe020]: identifier "RCC_APB2Periph_GPIOB" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 27 
Error[Pe020]: identifier "RCC_APB2Periph_AFIO" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 27 
Warning[Pe223]: function "RCC_APB1PeriphClockCmd" declared implicitly C:UsersAdministratorDesktopCANUsersCANCAN.c 28 
Error[Pe020]: identifier "RCC_APB1Periph_CAN1" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 28 
Error[Pe020]: identifier "GPIO_Pin_8" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 32 
Error[Pe020]: identifier "GPIO_Mode_IPU" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 33 
Error[Pe020]: identifier "GPIO_Speed_50MHz" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 34 
Warning[Pe223]: function "GPIO_Init" declared implicitly C:UsersAdministratorDesktopCANUsersCANCAN.c 35 
Error[Pe020]: identifier "GPIO_Pin_9" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 37 
Error[Pe020]: identifier "GPIO_Mode_AF_PP" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 38 
Warning[Pe223]: function "GPIO_PinRemapConfig" declared implicitly C:UsersAdministratorDesktopCANUsersCANCAN.c 42 
Error[Pe020]: identifier "GPIO_Remap1_CAN1" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 42 
Error[Pe020]: identifier "CAN1_RX0_IRQn" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 45 
Error[Pe020]: identifier "GPIO_InitTypeDef" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 93 
Warning[Pe223]: function "RCC_APB2PeriphClockCmd" declared implicitly C:UsersAdministratorDesktopCANUsersCANCAN.c 99 
Error[Pe020]: identifier "RCC_APB2Periph_GPIOB" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 99 
Error[Pe020]: identifier "RCC_APB2Periph_AFIO" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 99 
Warning[Pe223]: function "RCC_APB1PeriphClockCmd" declared implicitly C:UsersAdministratorDesktopCANUsersCANCAN.c 100 
Error[Pe020]: identifier "RCC_APB1Periph_CAN2" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 100 
Error[Pe020]: identifier "GPIO_Pin_12" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 103 
Error[Pe020]: identifier "GPIO_Mode_IPU" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 104 
Error[Pe020]: identifier "GPIO_Speed_50MHz" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 105 
Warning[Pe223]: function "GPIO_Init" declared implicitly C:UsersAdministratorDesktopCANUsersCANCAN.c 106 
Error[Pe020]: identifier "GPIO_Pin_13" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 108 
Error[Pe020]: identifier "GPIO_Mode_AF_PP" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 109 
Error[Pe020]: identifier "CAN2_RX1_IRQn" is undefined C:UsersAdministratorDesktopCANUsersCANCAN.c 114 
Error while running C/C++ Compiler 
 
Total number of errors: 21 
Total number of warnings: 7 

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
4条回答
北冥鱼
1楼-- · 2019-10-16 08:49
 精彩回答 2  元偷偷看……
正点原子
2楼-- · 2019-10-16 10:48
估计是头文件没添加。
北冥鱼
3楼-- · 2019-10-16 10:56
回复【3楼】正点原子:
---------------------------------
谢谢原子哥
晨星
4楼-- · 2019-10-16 12:44
是没有定义宏,,把stm32f20x上面的宏是注释掉的,,去掉注释就好了
虽然一年前的帖子了,,我还是想回答,,刚才我就是遇到了这个问题

一周热门 更多>