Quality RTOS & Embedded Software

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


internal flash with FreeRTOS?

Posted by Allure99 on October 22, 2008

I have a problem when trying to write to flash on a AT91SAM7X256.

I have moved my flash-write functions to RAM.

I think I have it setup correctly.

The problem seems to be timing, because if I step through the flash write code, it works like a charm... but if I let it run full speed it crashes every time to the pabort!



RE: internal flash with FreeRTOS?

Posted by woops_ on October 22, 2008
Is this a freertos question? There are no flash write functions in freertos.

RE: internal flash with FreeRTOS?

Posted by Allure99 on October 23, 2008
Yes the question is for freeRTOS.

I have project running on freeRTOS.
I am using AT91SAM7X and Rowley Crosswork.

I am trying to use the internal flash to store/log data.
My function seem to be running ok(write to flash) if I run it before RTOS

and after i shift it into one of the task after scheduler start,
I always end up in :

b dabort_handler

Any idea how to write internal flash in RTOS?

many thanks!


RE: internal flash with FreeRTOS?

Posted by Tonau on June 17, 2009
Hello @ All,

I had the same problem. I made a funktion based on the code of the example project basic-internalflash-project. I tested the funktion in main before the scheduler starts and everything was fine. Then I moved it into a Task and nothing worked anymore.I discovered that two things are important. First you have to encapsulate your flash_write function with taskENTER_CRITICAL(); and taskEXIT_CRITICAL();. Second the system crashes if you use FLASHD_Unlock(AT91C_IFLASH, AT91C_IFLASH + AT91C_IFLASH_SIZE , 0, 0); and FLASHD_Lock(lastPageAddress, lastPageAddress + AT91C_IFLASH_PAGE_SIZE, 0, 0); to lock and unlock the flash pages. Dont ask me why this happens. But I found that no pages are locked so writing to flash should be no problem.
Maybe anyone can explain this behavior.

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

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

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner