Erasing Flash sectors in KL25 and FreeRtos

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Erasing Flash sectors in KL25 and FreeRtos

1,087 Views
HeronBR
Contributor I

     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 ?

0 Kudos
1 Reply

424 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

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