cancel
Showing results for 
Search instead for 
Did you mean: 

Fatfs working for two separate core M4 and M7 with different initialization (STM32H745IITx)

LUCA_RIGGIO
Associate

Good morning,

I would like to implement Fatfs to communicate with a sd card in the core M4 and with a usb mass storage device in the core M7. In Cube Mx environment I'm able to initialize what I need, obtaining a fatfs M4 initialized to communicate with sd card and a fatfs M7 initialized to communicate with a usb mass storage device. Pratically this solution doesn't work (The devices are not recognized: the sd card is correctly mounted just one time and then it is not recognized while the usb is never recognized) but, when I keep everything together in the same core, fatfs M7 (usb mass storage+sd card) works perfectly. Could you tell me If it's possible to implement fatfs in the following way: fatfs M4 (sd card) and fatfs M7 (usb mass storage)? And considering that I need to create files inside sd card and write data to them in core m4 and sending these files from sd to usb in m7, are there some variables (like sd file path etc) that I need eventually to put in shared memory ?

Let me know and thanks for your time!

Luca

1 REPLY 1
Saket_Om
ST Employee

Hello @LUCA_RIGGIO 

The recommended way is to let core M4 exclusively handle the SD card and its FATFS, while core M7 only receives raw data from M4 and sends it over USB. M4 mounts the SD, creates and opens files, and reads/writes them using FATFS. When some file data needs to be transferred, M4 reads a chunk from the file into a buffer located in shared RAM, signals M7 via an inter-core mechanism (IPCC, HSEM, or a shared flag). M7 never accesses the SD or its FATFS directly: it just waits for the notification, reads the data from the shared buffer, and sends it over USB. 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om