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]
- 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] MIT cheetah make error: ‘ioctl’ was not declared in this scope
- How to Solve using stm32f4 to drive PS2 error
- Configure. AC: error: possibly undefined macro [How to Solve]
- C Language error: two or more data types in declaration specifiers
- How to Solve Error: “initializer element is not constant”
- result = e.symbols[symb] KeyError: b‘system‘ [How to Solve]
- QGC Error: Fail: No CPU load information [How to Solve]
- Tensorflow C++：You must define TF_LIB_GTL_ALIGNED_CHAR_ARRAY for your compiler
- QT solves error: use of deleted function and is private within this context
- [Solved] Error C1189: #error: Please use the /MD switch for _AFXDLL builds
- The solution of no module named ‘jinja2. Asyncsupport’
- Solution of adding H264 error in ffmpeg compilation
- [Solved] error LNK2038: Detected mismatch of “RuntimeLibrary”: The value “MDd_DynamicDebug” does not match the value “MTd_StaticDebug”