cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L452 TouchGFX and SD Card

fmaesso
Associate II

Hello,
I am using a custom board with the STM32L452RET. On this board:

  • SPI1 is connected to an IIS3DWB accelerometer,
  • SPI2 is connected to a 240x280 TFT display with an ST7789 controller and TouchGFX,
  • SPI3 is used with FatFs to access an SD card, following this tutorial: https://controllerstech.com/sd-card-using-spi-in-stm32/,
  • USB CDC is used for communication.

My issue is that if I compile a file containing the FatFs functions (regardless of whether I use the SD card access functions or not), the numerical values that should be displayed on the screen appear incorrectly (see attached images). However, if I exclude the FatFs functions from compilation, the display shows the values correctly.

I’ve tried several solutions:

  • Compiling everything but not mounting the SD card,
  • Modifying the initialization sequence of peripherals,
  • Reducing the clock speed for SPI2 and SPI3.

Unfortunately, none of these attempts worked.
I am using CubeIDE version 1.16.1.

I appreciate any help you can provide.
Thank you!

1 REPLY 1
Saket_Om
ST Employee

Hello @fmaesso 

Could you try to increase the heap and stack size in your project settings?

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar