cancel
Showing results for 
Search instead for 
Did you mean: 

STMcubeMX don't generate code for DMA

Vegard Havellen
Associate II
Posted on February 21, 2017 at 23:10

Hi.

I am trying to generate code via STMcubeMX for UART via DMA. I have configured the UART and DMA correctly to my liking, but when I press generate source code the only code for the DMA is:

/**

* Enable DMA controller clock

*/

static void MX_DMA_Init(void)

{

/* DMA controller clock enable */

__HAL_RCC_DMA1_CLK_ENABLE();

}

When I look into the logfile for 

STMcubeMX I can see when it is trying to generate the code for the DMA it gives these errors:

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (Channel) has Id (UART5_RX) currently not set

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (PeriphDataAlignment) has Id (UART5_RX) currently not set

INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (MemDataAlignment) has Id (UART5_RX) currently not set

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (Mode) has Id (UART5_RX) currently not set

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (FIFOMode) has Id (UART5_RX) currently not set

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (FIFOThreshold) has Id (UART5_RX) currently not set

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (FIFOThreshold) has invalid value (null)

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (MemBurst) has Id (UART5_RX) currently not set

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (MemBurst) has invalid value (null)

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (PeriphBurst) has Id (UART5_RX) currently not set

[INFO] ImportTextPane:147 - (OptionalMessage_ERROR) IP (DMA) : Parameter (PeriphBurst) has invalid value (null)

When i look at the parameters it throws an error for I can see that it is set. 

Do anyone have a solution so I can generate code for the DMA?

Attached is the log-file and the IOC-file

#dma #stmcubemx #optionalmessage_error
6 REPLIES 6
T J
Lead
Posted on February 22, 2017 at 00:21

I have no trouble with CubeMX, for the DMA on Usarts... on the '091

are you using 1.7.0 ?

which processor is it ?

Vegard Havellen
Associate II
Posted on February 22, 2017 at 10:36

My STMcubeMX is on version 4.1.9, i am using STM32F446ZETx. 

Imen.D
ST Employee
Posted on February 22, 2017 at 11:34

Hello

‌,

Which version of HAL are you using ?

I created new project with your same configuration and I have

MX_DMA_Init() function as below

:

/** * Enable DMA controller clock */static void MX_DMA_Init(void){ /* DMA controller clock enable */ __HAL_RCC_DMA1_CLK_ENABLE();/* DMA interrupt init */ /* DMA1_Stream0_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Stream0_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Stream0_IRQn); /* DMA1_Stream1_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Stream1_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Stream1_IRQn);}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Try creating new project in proper/new folder, thenkeep me informed about your updates.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee
Posted on February 22, 2017 at 12:31

My STMcubeMX is on version 4.1.9

You should use the last version of STM32CubeMX 4.19.0

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on February 22, 2017 at 11:52

When I generated a new file I got the correct code and no errors in the log-file. Weird that it didn't work on my original project. I used version 1.6.0 of HAL. 

Posted on February 22, 2017 at 12:33

Oh, sorry, I meant 4.19.0,