This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compile Error ( STM32 )

Hi All,

I'm the beginner on using STM32F101C4,try to start on I2C, so i download STM32F10x_AN2598_FW_V3.1.0, it's work on compiling with default MCU( STM32F103 ), but when i change the MCU to STM32F101C4, the following errors will appear soon, would you please tell me what's the problems? Thanks!

compiling main.c...
..\..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(317): error: #67: expected a "}" ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(406): warning: #12-D: parsing restarts here after previous syntax error } IRQn_Type;
..\src\main.c(104): error: #20: identifier "I2C2_EV_IRQn" is undefined NVIC_SetPriority(I2C2_EV_IRQn, 0x00);
..\src\main.c(107): error: #20: identifier "I2C2_ER_IRQn" is undefined NVIC_SetPriority(I2C2_ER_IRQn, 0x01);
..\src\main.c: 1 warning, 3 errors
"..\src\main.c" - 3 Error(s), 1 Warning(s).

Parents
  • Make sure the include paths for your project are complete, and override the default libraries Keil may be using. These things don't mix-n-match well.

    Check the Preprocessor defines to ensure you have the correct settings for you specific chip, some of the Low Density and Value Line classes of processors have only a subset of peripherals compared to the Medium and High Density ones. The startup files, and interrupt vectors, may well be different too.

    If there are example or template projects for your board/chip try using those, and reviewing the options/settings they use.

Reply
  • Make sure the include paths for your project are complete, and override the default libraries Keil may be using. These things don't mix-n-match well.

    Check the Preprocessor defines to ensure you have the correct settings for you specific chip, some of the Low Density and Value Line classes of processors have only a subset of peripherals compared to the Medium and High Density ones. The startup files, and interrupt vectors, may well be different too.

    If there are example or template projects for your board/chip try using those, and reviewing the options/settings they use.

Children