STMicroelectronics / STM32CubeU5

Full Firmware Package for the STM32U5 series: HAL+LL drivers, CMSIS, BSP, MW, plus a set of Projects (examples and demos) running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits).
Other
121 stars 67 forks source link

Calling HAL_SPI_Transmit_DMA() generates crash with "half-duplex" SPI #3

Closed SDS-BastienLS closed 2 years ago

SDS-BastienLS commented 2 years ago

Describe the set-up

Describe the bug (skip if none)

HardFault on execution of this condition: Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_spi.c, line 2930

In function SPI2_IRQHandler()->HAL_SPI_IRQHandler()

After the call of HAL_SPI_Transmit_DMA().

Additional context

The code is generated with STM32CubeMX. The Cube project is configured with a SPI peripheral, and 1 DMA channel linked to the TX of the SPI. Both IRQ Hanlder and HAL handler generation are ticked for both SPI and DMA channel interrupts.

The HAL_SPI_IRQ_Handler is trying to access the field "hspi->hdmarx->Mode" although hspi->hdmarx is NULL since no DMA channel is linked to SPI RX. This generates the HardFault.

ASELSTM commented 2 years ago

ST Internal Reference: 121844

ASELSTM commented 2 years ago

Hi @SDS-BastienLS,

This issue has been fixed in the frame of version v1.1.0 of the STM32CubeU5 published recently. Please allow me then to close this thread.

With regards,