STMicroelectronics / STM32CubeF4

STM32Cube MCU Full Package for the STM32F4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
827 stars 409 forks source link

MX_DMA_Init called after MX_DFSDM causes the DMA interrupt to not work #90

Closed noomio closed 2 years ago

noomio commented 2 years ago

NUCLEO-F413ZH STM32CubeIDE STM32CubeMx package STM32F4 series: 1.26.2

Issue

Configuring the DFSDM2 with DMA didnt fire the DMA2 interrupt and DMA2_Stream0_IRQHandler was never called.

The code generated with CubeMX:

` int main(void) { / USER CODE BEGIN 1 /

/ USER CODE END 1 /

/ MCU Configuration--------------------------------------------------------/

/ Reset of all peripherals, Initializes the Flash interface and the Systick. / HAL_Init();

/ USER CODE BEGIN Init /

/ USER CODE END Init /

/ Configure the system clock / SystemClock_Config();

/ Configure the peripherals common clocks / PeriphCommonClock_Config();

/ USER CODE BEGIN SysInit /

/ USER CODE END SysInit /

/ Initialize all configured peripherals / MX_GPIO_Init(); MX_ADC1_Init(); MX_DFSDM2_Init(); MX_I2S2_Init(); MX_USB_OTG_FS_PCD_Init(); MX_SAI1_Init(); MX_UART4_Init(); MX_TIM6_Init(); MX_DMA_Init(); MX_USART2_UART_Init(); `

The fix

Fix is to call MX_DMA_Init(); first and then all the rest.

` MX_DMA_Init();

MX_GPIO_Init();

MX_ADC1_Init();

MX_DFSDM2_Init();

MX_I2S2_Init();

MX_USB_OTG_FS_PCD_Init();

MX_SAI1_Init();

MX_UART4_Init();

MX_TIM6_Init();

MX_USART2_UART_Init(); `

DboubaMefteh commented 2 years ago

I had the same issue on stm32f407 disco. This solution fixed it. Thank you @noomio

RKOUSTM commented 2 years ago

Hi @noomio and @DboubaMefteh,

Thank you for your contribution. You are absolutely right about this point. Actually, the point you raised has already been dealt and fixed internally. The fix will be made available in the frame of a future release of CubeMX.

Now, as this issue is not directly related to some software component published within this repository (CMSIS, HAL, BSP, etc.) but rather to our ecosystem (namely the Cube MX tool), please allow me to close it.

Thank you for your contribution. We are looking forward to reading from you again.

With regards,

RKOUSTM commented 2 years ago

ST Internal Reference: 111339