STM32L433RC - Hardfault when using SPI Flash if interruption occurs on UART
Hello,
Context:
- I'm using a Nucleo board based on STM32L433RC.
- FreeRTOS is running on the target.
- I'm using IAR and my project is configured with STM32CubeMX V5.6.0 and STM32Cube_FW_V1.15.1.
- I have an interruption on USART1 RX (1200 or 9600bps) and I'm also using SPI1 to interface an external SPI Flash. I'm also using this with interruption on SPI1 RX and TX.
Problem:
When no data is received on UART, SPI is working properly. If one of my task is using SPI to write to the flash (for example), while data is received through UART (and so the UART interruption called), an Hardfault is generated.
Also, I'm forced to use SPI at less than 8Mbits/s (doesn't work at 16Mbit/s) and I don't know why..
I've already checked stacks (of the mcu and freeRTOS tasks) and they seemed alright.
I noticed that SPI1 and USART1 share the same peripheral bus (I don't know if it is revelant)
Do you have any idea of where does it could come from?
Thank you,
Charles B.
