A small problem about DMA in the GD32 code base[Copy link]
GD32 provides its own code library, but I feel that the continuity of different versions of the code library is very poor. A sample program that compiles normally on other computers sometimes fails when compiled on my computer. For example: compile the sample program in KEIl. It is just a simple lighting program and does not call the DMA function, but an error message about DMA still appears during compilation:
Clear text: RTE\Device\GD32F350RB\gd32f3x0_dma.c(50): error: #147-D: declaration is incompatible with "void dma_init(dma_channel_enum, dma_parameter_struct *)" (declared at line 195 of "I:\Keil_v5\ARM\PACK\GigaDevice\GD32F3x0_DFP\1.0.0\Device\Firmware\Peripherals\inc\gd32f3x0_dma.h") I carefully checked the code and found that it was caused by inconsistent function definitions. Definition in header file: void dma_init(dma_channel_enum channelx, dma_parameter_struct* init_struct); Implementation in .C file: void dma_init(dma_channel_enum channelx, dma_parameter_struct init_struct) Isn't it easy for the manufacturer to find this problem? This example makes me question the quality of the manufacturer's code. So everyone should carefully check the code before using it in the product. Just modify the definition in the header file as follows: void dma_init(dma_channel_enum channelx, dma_parameter_struct init_struct);