Writing to Flash Memory TWR-KW24D512

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

Writing to Flash Memory TWR-KW24D512

903 Views
robertfrumusa
Contributor I

Hi,

I am Currently developing with the TWR-KW24D512 evaluation board. I am trying to write to flash memory to save important variables that I collect when the code first starts. The reason for this is  right now I am testing with low power modes that act as a reset when it wakes from low power mode. I don't want to have to run through the beginning of my code that initializes those variables because it is very time consuming.

Right now the variables are being saved to ram, but when the processor goes into low power mode, the ram gets reset and all of my variables are lost. My thought to fix this is to declare space in the flash and then save the variables there and then just retrieve them after the processor wakes from low power mode.

Would anyone know the best way to start saving variables to flash? Or would anyone be able to point me to a document that explains how to write to flash?

Thank you

0 Kudos
2 Replies

640 Views
AngelC
Senior Contributor I

Hello Robert

BeeStack projects with NVM module enabled will save all network data when Idle task is executed and same data is restored after wakeup. You will find a NVM driver in the project files form BeeKit (NVM_Interface, NV_Flash.c, etc.). You may use this driver as reference to save custom data in flash sectors, but any modification or custom implementation is application specific.

Regards,

AngelC

0 Kudos

640 Views
kalden_srcinc
Contributor IV

I'm not sure if you are using the KSDK, but there is a flash driver there that I have used in platform/drivers/src/flash/C90TFS

0 Kudos