cembeddedstm32stm32f1

why cannot open source input file "ARMCM3.h":? with ST-link and STM32F103ZET6


When I tried to build the following project with those code, the error happened like this !

#include <stm32f10x.h>

#include "stm32f10x_gpio.h"
#include "stm32f10x_rcc.h"

void LED_GPIO_Config(void){
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_SetBits(GPIOB, GPIO_Pin_5);
}
//delay
void delay_nms(u16 time){
u16 i = 0;
while(time--){
    i = 12000;
    while(i--);
}

}
//main
int main(void){
SystemInit();
LED_GPIO_Config();
while(1){
    GPIO_SetBits(GPIOB, GPIO_Pin_5);
    delay_nms(1000);
    GPIO_ResetBits(GPIOB, GPIO_Pin_5);
    delay_nms(1000);
}
    
}

The output like this:

*** Using Compiler 'V5.06 update 2 (build 183)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Target 1'
compiling ControllerFunctions.c...
compiling BayesFunctions.c...
compiling FastMathFunctions.c...
compiling DistanceFunctions.c...
compiling ComplexMathFunctions.c...
compiling BasicMathFunctions.c...
compiling main.c...
compiling LED_MCBSTM32E.c... 
compiling MatrixFunctions.c...
assembling irq_cm3.s...
compiling cmsis_os1.c...
compiling SVMFunctions.c...
compiling StatisticsFunctions.c...
compiling SupportFunctions.c...
compiling rtx_lib.c...
compiling rtx_evr.c...
compiling rtx_delay.c...
compiling rtx_evflags.c...
compiling rtx_kernel.c...
compiling CommonTables.c...
compiling rtx_memory.c...
compiling rtx_mempool.c...
compiling rtx_mutex.c...
compiling rtx_semaphore.c...
compiling rtx_system.c...
compiling rtx_msgqueue.c...
compiling RTX_Config.c...
compiling RV_Framework.c...
D:\u_version projects\ZET6\LED_1\RTE\CMSIS_RTOS_Validation\RV_Config.h(10): error:  #5: cannot open 
source input file "ARMCM3.h": No such file or directory
 #include "ARMCM3.h"
C:\Keil_v5\ARM\PACK\ARM\CMSIS-RTOS_Validation\1.1.0\Source\RV_Framework.c: 0 warnings, 1 error
compiling RV_Report.c...
D:\u_version projects\ZET6\LED_1\RTE\CMSIS_RTOS_Validation\RV_Config.h(10): error:  #5: cannot open 
source input file "ARMCM3.h": No such file or directory
#include "ARMCM3.h"
C:\Keil_v5\ARM\PACK\ARM\CMSIS-RTOS_Validation\1.1.0\Source\RV_Report.c: 0 warnings, 1 error
compiling RV_Timer.c...
D :\u_version projects\ZET6\LED_1\RTE\CMSIS_RTOS_Validation\RV_Config.h(10): error:  #5: cannot open 
source input file "ARMCM3.h": No such file or directory
 #include "ARMCM3.h"
C:\Keil_v5\ARM\PACK\ARM\CMSIS-RTOS_Validation\1.1.0\Source\RV_Timer.c: 0 warnings, 1 error
compiling RV_WaitFunc.c...
D:\u_version projects\ZET6\LED_1\RTE\CMSIS_RTOS_Validation\RV_Config.h(10): error:  #5: cannot open 
source input file "ARMCM3.h": No such file or directory
 #include "ARMCM3.h"
C:\Keil_v5\ARM\PACK\ARM\CMSIS-RTOS_Validation\1.1.0\Source\RV_WaitFunc.c: 0 warnings, 1 error
compiling cmsis_rv.c...
D:\u_version projects\ZET6\LED_1\RTE\CMSIS_RTOS_Validation\RV_Config.h(10): error:  #5: cannot open 
source input file "ARMCM3.h": No such file or directory
  #include "ARMCM3.h"
C:\Keil_v5\ARM\PACK\ARM\CMSIS-RTOS_Validation\1.1.0\Source\cmsis_rv.c: 0 warnings, 1 error
compiling rtx_timer.c...
compiling rtx_thread.c...
compiling os_systick.c...
assembling startup_stm32f10x_hd.s...
compiling FilteringFunctions.c...
compiling TransformFunctions.c...
compiling misc.c...
compiling stm32f10x_gpio.c...
compiling DMA_STM32F10x.c...
compiling stm32f10x_rcc.c...
compiling GPIO_STM32F10x.c...
compiling system_stm32f10x.c...
".\Objects\LED.axf" - 5 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:05
Load "D:\\u_version projects\\ZET6\\LED_1\\Objects\\LED.axf" 
_____^  
*** error 56: cannot open file
Error: Flash Download failed  -  Could not load file 'D:\u_version 
projects\ZET6\LED_1\Objects\LED.axf'
Flash Load finished at 11:00:32

Besides, I am using st-link with stm32f103zet6! I do not know why it ccould not find the file and I also did not find the file either! Is that because some packages were broken or how to solve this? Thank you!


Solution

  • Probably you miss a define needed to import the right headers. Try to pass STM32F103xE symbol to the compiler. The file may be not located in the project folder but could be imported from an another include path outside the project.