Skip to main content
Associate II
Nov 26, 2026 02:01 UTC
Question

Migrating to STm32cubeMX version 6.18.1 causes crash using DMA SPI or SMA I2S

I have a ThreadX app that worked fine under previous versions of STM32CubeIDE, but after upgrading to STM32CubeMX 6.18.1, whenever I start SPI DMA or I2S DMA, it goes to Default_Handler/ Infinite_Loop  The IABR registers are all zero.

This is the i2s initialisation:

hi2s1.Instance = SPI1;

hi2s1.Init.Mode = I2S_MODE_MASTER_TX;

hi2s1.Init.Standard = I2S_STANDARD_PHILIPS;

hi2s1.Init.DataFormat = I2S_DATAFORMAT_32B;

hi2s1.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;

hi2s1.Init.AudioFreq = I2S_AUDIOFREQ_48K;

hi2s1.Init.CPOL = I2S_CPOL_LOW;

hi2s1.Init.FirstBit = I2S_FIRSTBIT_MSB;

hi2s1.Init.WSInversion = I2S_WS_INVERSION_DISABLE;

hi2s1.Init.Data24BitAlignment = I2S_DATA_24BIT_ALIGNMENT_RIGHT;

hi2s1.Init.MasterKeepIOState = I2S_MASTER_KEEP_IO_STATE_DISABLE;

if (HAL_I2S_Init(&hi2s1) != HAL_OK)

 

This is the code that starts the I2S DMA:

res = HAL_I2S_Transmit_DMA(&HI2S, (uint16_t*)signal, TOTAL_SAMPLES);