FreeRTOS+FAT on two cores system (ZYNQ7000)

claudiorossi wrote on Friday, September 27, 2019:

I am using FreeRTOS+FAT and the FTP example software on core 0 of my Zynq7000 based board to access an SD card. Now I need to implement a second application with FreeRTOS+FAT on the second core to access some files on the same SD card.
Is it possible to access files on the SD card from the two cores concurrently?

Thank you

heinbali01 wrote on Friday, September 27, 2019:

Claudio, I would say it is undoable to run the FreeRTOS+FAT on two cores for the same fysical disk. Even if you create inter-core mutexes to avoid concurrent disk access, it is an impossible task. One difficulty is that each core will have a cache of many sectors on the disk. The library assumes that it has unique access.

Do you have a standard way of communicating between the 2 cores?

I would make one core the SD-card owner and use FreeRTOS+FAT as it is.

When the second core needs access, it shall do so with RPC (remote procedure calls) that you will have to implement.

Within a single core there are mutexes that allow multiple tasks to access the same disk, also for the task that responds to the RPC’s.

claudiorossi wrote on Friday, September 27, 2019:

Hi Hien
just as I supposed. At the moment we don’t have a standard way of communication between the 2 cores. On our board we have implemented a Xilinx logic IP on FPGA for communication (Mailbox IP core) and we like to use the OCM memory for data tranfer.
As you suggest, we need to create an RPC protocol to acces the SD card.

Thanks for help