I implemented successfully flash Erase and write routines as suggested in thread Erasing Flash sectors in KL25 on the Freedom Board, but when I tried to use with FreerRtos and more threads I got a message "No source available for "0xFFFFFFFE (0xFFFFFFFE)() ".
I already tried to use Cpu_DisableInt(); and taskENTER_CRITICAL(); but it didn't work. The error occurs after a few hundreds cycles.
Erase sector
FLASH1_Erase(FLASH1Pointer, 0x1F000, 1024);
do {
FLASH1_Main(FLASH1Pointer);
OpStatus = FLASH1_GetOperationStatus(FLASH1Pointer);
} while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));
And then write the data in Flash:
FLASH1_Write(FLASH1Pointer, FromPtr, 0x1F000, Size);
do {
FLASH1_Main(FLASH1Pointer);
OpStatus = FLASH1_GetOperationStatus(FLASH1Pointer);
} while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));
Does someone have any suggestion ?
Hi Heron,
We don't have much experience in FreeRTOS but you might be missing something in your flash driver. You could use the MQX FlashX driver as a reference and compare what it does is the same you are doing in your FreeRTOS Flash driver. My two cents :smileywink:!
Hope this helps you.
Regards,
-Garabo