Skip to main content
Vitaliy Chernobay
Senior
July 31, 2017
Question

CubeMX 4.22.0 bug for DMA2D config

  • July 31, 2017
  • 8 replies
  • 1942 views
Posted on July 31, 2017 at 19:58

It is DMA2D config, generated CubeMX for Keil.

hdma2d.Instance = DMA2D;

hdma2d.Init.Mode = DMA2D_M2M;

hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;

hdma2d.Init.OutputOffset = 0;

hdma2d.LayerCfg[1].InputOffset = 0;

hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;

hdma2d.LayerCfg[1].AlphaMode = DMA2D_REPLACE_ALPHA;

hdma2d.LayerCfg[1].InputAlpha = 0;

// hdma2d.LayerCfg[1].AlphaInverted = DMA2D_REGULAR_ALPHA;

// hdma2d.LayerCfg[1].RedBlueSwap = DMA2D_RB_REGULAR;

It is config for STM32F476IGTx. I must comment last lines for compillung.

It is line not for my processor

 (STM32F476IGTx)

 !!!

This feature is only available on devices :

STM32F756xx, STM32F767xx, STM32F769xx, STM32F777xx and STM32F779xx.

#dma2d #systemworkbench. #cubemx #cubemx #dma2d
This topic has been closed for replies.

8 replies

ST Technical Moderator
August 1, 2017
Posted on August 01, 2017 at 12:48

Hello

Chernobay.Vitali.002

,

Thank you for reported this issue. Iraised it internally to CubeMx team for fix.

Best Regards

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Alex Fedoseev
Associate II
August 1, 2017
Posted on August 01, 2017 at 15:19

Vitaliy,

Thank you very much for identifying the error and providing a workaround.

I could not figure out why I can't use DMA2D in my project.

I also have the same

#

error when I import

https://community.st.com/tags#/?tags=cubemx

generated project into my IDE. I am using version 4.22 of CubeMX and

#

My Project is for STM32F7-DISCOVERY board

The IDE doesn't like these 2 lines of code:

 hdma2d.LayerCfg[1].AlphaInverted = DMA2D_REGULAR_ALPHA;
 hdma2d.LayerCfg[1].RedBlueSwap = DMA2D_RB_REGULAR;�?�?

The compiler can't find AlphaInverted, RedBlueSwap, DMA2_REGULAR_ALPHA, DMD2D_RB_REGULAR

Commenting out those 2 lines, as Vitaliy suggested, got rid of those errors.

Great job, Vitaliy!

0690X00000607eJQAQ.png
Vitaliy Chernobay
Senior
August 1, 2017
Posted on August 01, 2017 at 15:44

It all is descabe in file stm32f7xx_hal_dma2d.h (from line 145)

#if defined (DMA2D_FGPFCCR_AI) && defined (DMA2D_BGPFCCR_AI)

uint32_t AlphaInverted; /*!< Select regular or inverted alpha value.

This parameter can be one value of @ref DMA2D_Alpha_Inverted.

This feature is only available on devices :

STM32F756xx, STM32F767xx, STM32F769xx, STM32F777xx and STM32F779xx.*/

#endif /* (DMA2D_FGPFCCR_AI) && (DMA2D_BGPFCCR_AI) */

#if defined (DMA2D_FGPFCCR_RBS) && defined (DMA2D_BGPFCCR_RBS)

uint32_t RedBlueSwap; /*!< Select regular mode (RGB or ARGB) or swap mode (BGR or ABGR).

This parameter can be one value of @ref DMA2D_RB_Swap

This feature is only available on devices :

STM32F756xx, STM32F767xx, STM32F769xx, STM32F777xx and STM32F779xx.*/
Alex Fedoseev
Associate II
August 1, 2017
Posted on August 01, 2017 at 16:54

Thank you!

i guess, it's time to read the source code and the manual. 

stm32cube-t
ST Employee
August 8, 2017
Posted on August 08, 2017 at 11:36

Hello Alex,

Can you please provide the ioc file for your F746 project? 

CubeMX 4.22 does not provide the possibility to configure the Alpha inversion and Red&Blue swap parameters since they are not available for this MCU:

0690X00000607xxQAA.png

While indeed it is available for other series (ex: F767x):

0690X00000607y2QAA.png
Vitaliy Chernobay
Senior
August 8, 2017
Posted on August 08, 2017 at 17:14

0690X00000607huQAA.png

CubeMX (ver. 4.22) DMA2D config for STM32F746IG

________________

Attachments :

746IG_FMC_LTDC_DMA2d.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyWb&d=%2Fa%2F0X0000000b94%2FNemg0iFxHhvs92YCUSnyh29YP1qplbku2XATdZJSKDI&asPdf=false