Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Using external EEPROM for application data

Posted by Fabien on 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,
Fabien

RE: Using external EEPROM for application data

Posted by Richard on 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.

Regards.

RE: Using external EEPROM for application data

Posted by Fabien on 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,
Fabien


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS