Keil V4.72 after upgrading to v5.1x

Source: Internet
Author: User

Problem description

Keil V4.72 upgrade to V5.1x, the original compiled through the project, the following error occurred:

. \libraries\cmsis\cm3\devicesupport\st\stm32f10x\stm32f10x.h (298): Error: #67: expected a "}

Cause analysis

Keil V4.72 version: When using the STM32 library file, we selected the device in the device column, for example STM32F103VET6, but we also need to preprocessor Symbols add macro STM32F10X_HD so that the compilation can pass. corresponding to the different capacity of the chip, the macro should also be modified to correspond.

Keil v5.1x Version: We have selected the device in the device column, such as STM32F103VET6, then we do not need to add a macro symbols in the preprocessor STM32F10X_HD of the C/S column. This is because the software automatically generates such macros based on devices of different capacities. For example, if our device is STM32F103R8T6, the software will automatically generate macro STM32F10X_MD without the need for the user to add. This is of course the arm company and St Company to discuss, and then decided to deal with it, obviously this is more convenient for users to use.

After our software upgrade, we may have previously defined the macro and the device should actually correspond to the macro inconsistency, the above error occurs. Because it is equivalent to a compiled variable, we define it two times. For example, the device is STM32F103VET6, our definition of the macro is STM32F10X_MD, and the software automatically generated a macro STM32F10X_HD, which will certainly cause errors when compiling.


Remove the macro stm32f10x_ (x) d from the preprocessor symbols in the one-C + + column and recompile.

Keil V4.72 after upgrading to v5.1x

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.