How to use flash memory?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use flash memory?

199 Views
darwinagudelohe
Contributor I

Hi

I'm trying to read the flash memory of the KL25Z. I can program it correctly, I can view the information programed with the jlink, but i don't know how read it from the main program.

I'm using KSDK V2

any idea?

Labels (1)
Tags (1)
0 Kudos
1 Reply

67 Views
mjbcswitzerland
Specialist V

Hi

The program flash in the Kinetis processor is memory mapped so the simplest method of reading from it is to just use pointers.
For example, to read 64 bytes from the addres 0x8000 do:


unsigned char mybuffer[64];
unsigned char *ptrFlash = (unsigned char *)0x8000;
memcpy(mybuffer, ptrFlash, sizeof(mybuffer));

Regards

Mark
Kinetis for professionals: http://www.utasker.com/kinetis.html

0 Kudos