The error information is as follows:
../../../../GD32F10x_ Firmware_ Library/CMSIS/GD/GD32F10x/Include\gd32f10x.h(168): error: redefinition of enumerator ‘USBD_ HP_ CAN0_ TX_ IRQn’
../../../../GD32F10x_ Firmware_ Library/CMSIS/GD/GD32F10x/Include\gd32f10x.h(169): error: redefinition of enumerator ‘USBD_ LP_ CAN0_ RX0_ IRQn’
Cause of problem:
Preprocessor symbols should be set to gd32f10x_ MD, but it is set to gd32f10x_ HD
Preprocessor symbols means preprocessing symbols, which is equivalent to macro definitions. When we use the gd32 firmware library, because the firmware library contains the definitions of the whole series of GD microcontrollers. At this time, the define box can be used as a global macro definition, that is, select which part of the definitions and resources in the firmware library I want to adopt.
It literally means “use standard peripheral driver”. Adding “use_stdperiph_driver” to the C/C + + predefined allows “use standard peripheral driver”. As for the added “gd32f10x_hd”, it can also be explained in the file “gd32f10x. H” through function search as described above. In fact, it also switches some definitions of corresponding hardware.
In fact, it defines the capacity of the chip
/* define GD32F10x */ #if !defined (GD32F10X_MD) && !defined (GD32F10X_HD) && !defined (GD32F10X_XD) && !defined (GD32F10X_CL) /* #define GD32F10X_MD */ /*!< GD32F10X_MD: GD32 Medium density devices */ /* #define GD32F10X_HD */ /*!< GD32F10X_HD: GD32 High density Value Line devices */ /* #define GD32F10X_XD */ /*!< GD32F10X_XD: GD32 Extra density devices */ /* #define GD32F10X_CL */ /*!< GD32F10X_CL: GD32 Connectivity line devices */ #endif /* define GD32F10x */
- Visual Studio 2012 error C4996: ‘scanf’: This function or variable may be unsafe.
- Error 2 error c2491: XX: definition of dllimport static data member is not allowed
- Keil5 error: #29: expected an expression [Solved]
- error RC2247 : SYMBOL name too long [How to Solve]
- Hash_map is deprecated and will be REMOVED. Please use unordered_map.
- [Solved] Compilation error: dereferencing pointer to incomplete type…
- Solution for Visual Studio 2012 compilation error [error C4996:’scanf’: This function or variable may be unsafe.]
- Cmake Setting Support C++11 This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options
- [Solved] std::max() error C2589: ‘(‘ : illegal token on right side of ‘::‘
- [Solved] error:#20: identifier “HAL_StatusTypeDef“ is undefined.
- [Solved] MIT cheetah make error: ‘ioctl’ was not declared in this scope
- [Solved] keil arm_math Error: error: #35: #error directive: “Define according the used Cortex cor
- How to Solve using stm32f4 to drive PS2 error
- C Language error: two or more data types in declaration specifiers
- How to Solve QT and PCIe interactive loading setupapi.H error
- Configure. AC: error: possibly undefined macro [How to Solve]
- How to Solve Error: “initializer element is not constant”
- result = e.symbols[symb] KeyError: b‘system‘ [How to Solve]
- [Solved] CUDA error：-UserWarning: CUDA initialization: CUDA unknown error
- Tensorflow C++：You must define TF_LIB_GTL_ALIGNED_CHAR_ARRAY for your compiler