cancel
Showing results for 
Search instead for 
Did you mean: 

STMCubeIDE 1.1.0 (CubeMX 5.4.0) switch initialization order.

msalamon_pl
Associate II

Hi. I noticed in the latest STMCubeIDE v1.1.0 DMA is initialized at the end of initialization chain. There is only NVIC interrupt priority set but as i can see it's important where it's initialized.

/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_USART2_UART_Init();

MX_DMA_Init();

instead of previous

/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_DMA_Init();

MX_USART2_UART_Init();

The result is while UART IDLE interrupt occurs, DMA shows me always that is received 0 bytes in NDTR register.

my code(working with correct initialization order): https://github.com/lamik/UART_DMA_receiving

2 REPLIES 2
simonpl
Associate

Having the same problem, generating code for a STM32F100VETx while using ADC1 and DMA. DMA is initialized after ADC1 which does not work if DMA is used to query the ADC. Switching the initialization order resolves the problem.

PJung.1395
Associate

Same problem appears on CubeMX5.4.