2016-10-18 03:50 AM
THE SAME BUG IT WAS OBSERVED BY OTHERS, (compared to other posts this eventually helps to reproduce and understand the problem).
After upgrading STM32CubeMX from 4.16.1 to 4.17.0 I found a bug.Environment: I use STM32Cube_FW_F0_V1.6.0 firmware library.Symptom:In the stm32f0xx_hal_dma_ex.h the __HAL_DMA1_REMAP macro, together with the change introduced by the generator in usart.c does not compiles.Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h:796:10: error: expected expression before 'do' do { assert_param(IS_HAL_DMA1_REMAP(__REQUEST__)); \In the usart.c by generator, it is replaced the line__HAL_DMA1_REMAP(HAL_DMA1_CH3_USART1_RX);with if (__HAL_DMA1_REMAP(HAL_DMA1_CH3_USART1_RX) != HAL_OK) { Error_Handler(); }The problem is similar what we find in the following articlehttp://pilt.github.io/2009/10/16/the-use-of-do-while-0-in-c-macros/Temporarily I revert the changes in usart.c as a temporary workaround.The problem is in the driver code, but the changes in the STM32CubeMX v4.17.0 with regard to the use of the macro causes an error. #stm32 #bug #bug #cubemx #stm32cube2016-10-18 05:53 AM
Hello,
This issue is reported to ST team in this . ST team is aware about this issue now and works to resolve this issue. Regards2016-10-20 12:58 AM
I found the same issue in a project built for stm32f030cc, in stm32f0xx_hal_msp.c.
Also I was usingSTM32Cube_FW_F0_V1.6.0 firmware library. The faulty statement was this:if
(__HAL_DMA1_REMAP(HAL_DMA1_CH1_ADC) != HAL_OK)
{
Error_Handler();
}
Like Tibor did, I worked-around by changing that block with this one simple line:
__HAL_DMA1_REMAP(HAL_DMA1_CH1_ADC);
And it all worked.
BR,
Andrea
2016-11-08 03:45 AM
STM32CubeMX 4.18 out in the next coming weeks should fix your issue.
Best regards