6539 views|1 replies

1305

Posts

0

Resources
The OP
 

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);


This post is from GD32 MCU

Latest reply

It should be the pointer that is passed. I also found this problem before. So I changed the code myself.  Details Published on 2018-10-20 12:03
 

606

Posts

20

Resources
2
 
It should be the pointer that is passed. I also found this problem before. So I changed the code myself.
This post is from GD32 MCU
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list