2016-10-24 12:56 AM
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.
2016-10-24 01:45 AM
Hi goodman.stephen.001,
Thanks for highlighting this issue. It is reported internallySorry for any inconvenience it may bring.-Syrine-2016-10-26 04:46 AM
Thanks for you findings, the bug (399163) has been fixed in STM32CubeMX v4.18 that will be released W46
Best regards Daniel