Quality RTOS & Embedded Software

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




Loading

FreeRTOS+FAT SL benchmarking

Posted by owaisfazal on September 22, 2014

Hello,

I am trying to do some bench marking of FreeRTOS+FAT SL using Atmel SAM4S and Atmel Studio IDE. I am trying to measure the time required to write to a SD card. For this purpose I am using a simple bit toggling before and after the f_write function. The results are not very clear to me since the timing is not constant all the time. Does someone know how to measure this more accurately or if this is the expected behavior. Moreover, I have a task with a vTaskDelay(1000) and it performs the same writing function over again. Any suggestion or help is appreciated.

Regards, Owais


FreeRTOS+FAT SL benchmarking

Posted by rtel on September 22, 2014

The majority of the time during an fwrite will be the time taken to write to SD card - which includes the time taken for the card to program the flash it contains.

There is a lot going on inside the SD card, and it is possible that will generate some jitter - it handles all the ware levelling, etc. for you.

If you want to measure something without any other FreeRTOS tasks getting in the way then I would suggest setting FFSTHREAD_AWARE to 0 and performing the write before the scheduler has started.

The SL in FreeRTOS+FAT SL stands for 'super lean', and just like TCP/IP stacks, there is an inverse relationship (up to a point) between RAM footprint and performance.

Regards.


FreeRTOS+FAT SL benchmarking

Posted by owaisfazal on September 22, 2014

Thank you for your response. My application will require me to write to the SD card during the operation and since I have to perform this in a task, I need to be sure if the writing function will successfully finish its job before the task is interrupted by some other task. I am also aware that toggling a pin is not the best solution so I am open for suggestion.

Regards


FreeRTOS+FAT SL benchmarking

Posted by rtel on September 22, 2014

I need to be sure if the writing function will successfully finish its job before the task is interrupted by some other task

If this is just a sequencing issue, then you can temporarily raise the priority of the task performing the write - but that will naturally impact the real time responsiveness of your application.

If FFSTHREAD_AWARE is set to 1 then you need not worry about another task accessing the file system at the same time, no matter what the task priorities.

Regards.


FreeRTOS+FAT SL benchmarking

Posted by owaisfazal on September 22, 2014

Thank you once again. I have read some comments in the comments in the code and according to them it is not possible to access the file system from more than one task, is this true? Also it is suggested that the idle hook be used and FFSTHREAD_AWARE should be set to 1. In my case I need to write to the SD card from more than one task and idle hook solution is not a good option since it may happen that the idle hook is never called due to other tasks. One more thing I need to ask is that, is it possible to create two different files on SD and write simultaneously, so what I mean is that once a file is created a space is allocated for it and when another task creates a different file it should not overlap the first one and also a file should not be allowed to be written until it is closed. Is there such a mechanism implemented in FreeRTOS+FAT SL?

Regards.


FreeRTOS+FAT SL benchmarking

Posted by rtel on September 22, 2014

If FFSTHREAD_AWARE is 1 then file system access is protected by a semaphores. However, in the super lean product only one file can be open at a time.


FreeRTOS+FAT SL benchmarking

Posted by owaisfazal on September 22, 2014

So it will not be a problem if I access SD card from more than one task? as long as the file is opened and closed in the first task the second task can open and write to the same or a different file? What if there is a third task that tries to access the file that is not yet written what happens in this case?

Regards.


FreeRTOS+FAT SL benchmarking

Posted by rtel on September 22, 2014

The third task won't be able to access it until it can obtain the semaphore, which is managed by the FAT API.


FreeRTOS+FAT SL benchmarking

Posted by owaisfazal on September 23, 2014

Hello,

Thanks for clearing that. Is it also possible that we leave a file open in a task and then write to that same file from a different task?

Regards.


FreeRTOS+FAT SL benchmarking

Posted by rtel on September 23, 2014

Thanks for clearing that. Is it also possible that we leave a file open in a task and then write to that same file from a different task?

I think that should be fine.

Regards.


FreeRTOS+FAT SL benchmarking

Posted by owaisfazal on September 23, 2014

Thank you for the response. Is there a more efficient way to measure the time taken by the task that is writing to the SD card since bit toggling is not at all useful. Any suggestion will be appreciated.

Regards.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists