cancel
Showing results for 
Search instead for 
Did you mean: 

How to write and read data on a SD card with TouchGFX ?

A.Mombrun
Associate

Hi.

I am using a Discovery kit F769I Disco and its included touchscreen.

I am struggling to write and read data from an external SD Card using TouchGFX. Indeed, I want to create an interaction using 2 buttons where it either creates a text file on my sd and writes data in it or reads data from an existing text file.

So far, this has worked using the Simulator because it doesn't use the microSD card.

However, it doesn't work when I run the code on the board : I am using the flow operators (>>) to write and read data.

I tried writing and reading data only using STM32CubeIDE (without the graphical interface) and it works because I am using the functions present in the FATFS library.

How could I make it work in TouchGFX ?

Thank you for reading.

3 REPLIES 3
Romain DIELEMAN
ST Employee

Hi,

I think you can find older post on the forum or online of people working with SD cards to achieve something similar, it rings a bell. You can also have a look at the backend communication article in the documentation to understand how to interact between your UI (buttons) and the logic of your project.

/Romain

I have searched for "sd card touch gfx" but honestly I couldn't find a post. Do you have any references ?

I will take a look at the backend article.

Thanks for your help.

Well, it doesn't really relate to Touchgfx, Touchgfx and SD card are two independent modules. You can have them without any problem. The matter is I wonder if you like to use CPP-like functions as you mentioned "I am using the flow operators (>>) to write and read data". If so, you are about to implement FAT in CPP on your own since FATFS is implemented in pure C (Some assembly is ....).