AnsweredAssumed Answered

MKL28Z read/write data to non-volatile memory (ROM or Flash)

Question asked by M I on Jul 24, 2019
Latest reply on Jul 25, 2019 by M I


I don't see any SDK example to read/write data to non-volatile memory of MKL28Z such as internal ROM and flash during runtime.    I need to store CHANGING data measurement statistics & other system pertinent info so in case of power outage or intentional power-down after manufacturing test of the product & shelving in the box, these data will be retained & can retrieved during system initialization and during normal in-service operations.

Basically, I need non-volatile storage for small database structures.   I remember reading about a 32-byte "protected" user data area that will persist even at VLLS0, lowest leakage stop mode.   But that's too small & I need space for data to persist even at complete power-down.

I know MKL28Z has 32K ROM & 512KB Flash RAM.    I missed the point when I selected MKL28Z as MCU for our product that it has "ROM" not "EEPROM", but is there a way to write to the ROM, away from bootloader area?   This way I don't have to mix up with bootloader.   I understand that ROM is permanent but in today's technology maybe there's a way to read/write to in in MKL28Z?

I saw a 2015 post where "Ma Hui" recommended downloading a "driver" for the KL43Z?   I honestly don't understand how this goes...   ... and this may not work for the KL28Z I'm using.

I mean, I'm currently using MCUXpresso IDE to research & develop different operations that I will soon gather all together in 1 big system of operations under RTOS & multitasking, mutex, queuing operations so I don't understand how that driver gets into this picture.



Is it possible to do segmentation during compilation with pre-processor directives like .bss .data . code... through MCUXpresso builds so at run time I know the variable combined in flash with code will RESIDE in flash & not get loaded in RAM which will disappear on  power-down?


What I'm asking is a method to save / store realtime-changing data to memory during manufacturing test &/or in-service runtime that will persist even when system is powered-down, either to/from:

1) ROM

2) Flash RAM

Please keep in mind, this is reading/writing data in realtime runtime operation.

Any thoughts?
Thanks for the help.