cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop DMA module from stm32f0xx_hal_conf.h?

Md Mubdiul Hasan
Associate III
Posted on November 29, 2016 at 05:49

Dear Sir,

 I want to disable DMA module application from my project.

Is there any relation it with flash module?

I have tried to change /*#define HAL_DMA_MODULE_ENABLED, 

but still build error log says,

../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h(134): error:  #20: identifier ''HAL_LockTypeDef'' is undefined

According to document UM1749, HAL_LockTypeDef is basically use in data field.

Dont you think, this error generates because of disabling DMA module?

Is there any other way to deactivate it?

Thank you .

Regards

Hasan
4 REPLIES 4
Walid FTITI_O
Senior II
Posted on November 29, 2016 at 10:25

Hi Hasa, 

As indicated in the same file , the DMA module is enabled to include the relevant header :

''#ifdef HAL_DMA_MODULE_ENABLED

  #include ''stm32f0xx_hal_dma.h''

''

when DMA module is not enabled, the header will not included which may causes errors due to the existing DMA code. Ti avoid this error you should delet all related DMA conde (defines, structures, functions..)

-Hannibal-

Md Mubdiul Hasan
Associate III
Posted on November 30, 2016 at 02:57

Dear Sir Hannboi,

I do appreciate your suggestion.

My application is not much wide, I want to delete DMA and I2C part.

I did inactive in this way,

 //#ifdef HAL_DMA_MODULE_ENABLED

      // #include ''stm32f0xx_hal_dma.h''

 At the beggining of this fille,  #define are inactivate using /*, am I wrong ?

Even I did so, there is no change on the build output !

For your kind information, I did 

1. This code was build in Coo-cox  environment, I have modified some of its part after changing its main MCU pinout in cubemx.

2. What I have modified is, its tim.h. spi.h, gpio.h, files combine in one main.c file. Remove I2C h file. some time I did #include #define. 

3.  Make changes in mxconstant.h file, as we changes GPIO in cubemx.

Do you feel mdk keil making problem in creating folder, take a look this project tree.0690X00000605THQAY.png

Posted on December 10, 2016 at 18:38

Most linkers have option to automatically remove from the final flash memory any function that is not used (no reference or no pointer to it).

You can check this in the optionally generated MAP file by the linker. The code size of the module that is not used should show 0 bytes of flash. Otherwise, look into the *_hal_conf.h file if present in the workspace.

Posted on December 12, 2016 at 06:01

Dear Sir Marsanne,

Thank you for texting here.

It was a problem where I was trying to build  my custom  stm project in mdk-keil.

Things we avoided, due to compiler did not compile files from Visual studio.

Keep in touch, this cause may arise in Eclipse again.