Using external EEPROM for application data

fabiensf wrote on Saturday, June 25, 2011:

Hi all,

I start my first project using FreeRTOS and I want to check with you if I did correct things:

My application need to store data inside an external EEPROM I2C memory. Multiple tasks need to be able to read and write to this memory.

- For Write operation, I plan to create a Gatekeeper task with one queue. All tasks will write to this queue and the Gatekeeper will write data to EEPROM.

-For the Read operation, I plan to use the same gatekeeper, but to have one dedicated Queue for each task that need to read data from this memory.

Do you think this is the cleanest way to access this EEPROM memory using FreeRTOS? If not, could you please explain me how to do this?

Thanks in advance for your help.
Best regards,

rtel wrote on Saturday, June 25, 2011:

This is really an application design question, but I will comment one the less.

Your writing concept sounds fine.  However, for reading, it would be simplest to use the same queue.  A write command to the gatekeeper can give the address to write to in the eeprom, and the data to be written (however many bytes, and from where).  A read commend can give the address to read from in the eeprom, and where to place the data that is read out of the eeprom (where to store however many bytes are being read).  Then you need some sort of flag to say when the read is complete.

Alternatively, you could just have a read eeprom function and a write eeprom function, and use the same mutex within each function to ensure multiple access do not happen simultaneously.  If that is a practical solution or not depends on your application though.


fabiensf wrote on Monday, June 27, 2011:

Hi Richard,

First of all, I would like to thank you for your quick answer.

I am really happy to hear that my concept sounds fine. I just read your reply and using only one Queue for Read/Write seems  very good and better.
About the flag, I think I will use a BinarySemaphore dedicate for each tasks in order to release each task from Blocked state when data is ready.

Best regards,