cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: Cube v4.17.0 / STM32Cube FW_F0 V1.6.0; DMA Initialisation

stefanoroggerini9175
Associate II
Posted on October 24, 2016 at 09:56

I have just updated to Cube v4.0 which I also think updated the firmware package for the chip I am using (STM32F030RCTx). There is a bug in the initialisation code for the DMA that causes the project not to be compiled at all.

Pre-update:

__HAL_DMA1_REMAP(HAL_DMA1_CH3_SPI1_TX);

Post-update:

if (__HAL_DMA1_REMAP(HAL_DMA1_CH3_SPI1_TX) != HAL_OK)
{
Error_Handler();
}

The macro

__HAL_DMA1_REMAP

is defined as:

#define __HAL_DMA1_REMAP(__REQUEST__) \
do { assert_param(IS_HAL_DMA1_REMAP(__REQUEST__)); \
DMA1->CSELR &= ~((uint32_t)0x0F << (uint32_t)(((__REQUEST__) >> 28) * 4)); \
DMA1->CSELR |= (uint32_t)((__REQUEST__) & 0x0FFFFFFF); \
}while(0)

It's easy to see why this will not work in an if statement. I am having to edit the code manually every time I generate the code.
2 REPLIES 2
Nesrine M_O
Lead II
Posted on October 24, 2016 at 10:45

Hi goodman.stephen.001, 

Thanks for highlighting this issue. It is reported internally

Sorry for any inconvenience it may bring.

-Syrine-

fauvarque.daniel
ST Employee
Posted on October 26, 2016 at 13:46

Thanks for you findings, the bug (399163) has been fixed in STM32CubeMX v4.18 that will be released W46

Best regards

Daniel