Skip to main content
msalamon_pl
Associate II
November 14, 2019
Question

STMCubeIDE 1.1.0 (CubeMX 5.4.0) switch initialization order.

  • November 14, 2019
  • 2 replies
  • 1352 views

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

This topic has been closed for replies.

2 replies

simonpl
Visitor II
November 18, 2019

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
Visitor II
November 20, 2019

Same problem appears on CubeMX5.4.