While porting an application from TI´s MSP430 to the Kinetis KL15, I came to the point of porting the flash access routines. I am placing my configuration data in flash, this is working fine on the MSP430.
I am used to (read) access the flash memory like I would access data in RAM. As the Kinetis has a von Neumann Architecture (i.e. single memory area for both program and data memory), I had expected the same to be true for the Kinetis. However, what PE generates does not quite look like a simple memory access.
It was really convenient to use flash memory like RAM when reading, I am not exactly eager to copy everything into RAM before being able to use it. It means extra code and extra RAM. Is there a chance to access some user flash area with a simple read access? If yes, how? If not, what is the problem?
Max
Solved! Go to Solution.
Max
You can read data from the program flash as any memory-mapped address so there is no need to use special routines.
You only need Flash functions when deleting or programming.
If the code that you have is using flash routines for reading it is either the wrong code or something is incorrectly configured.
If your configuration data is in declared as a const array or struct you can simpy access it as any variable. Otherwise any pointer access to the Flash location can be used (eg. ucValue = *(unsigned char *)*0x2000;)
Regards
Mark
Mark,
thank you. I was on the wrong track after looking into the help of PE, which has the function
I had supposed there is a reason for this function - but it does not seem so.
Max
Max
You can read data from the program flash as any memory-mapped address so there is no need to use special routines.
You only need Flash functions when deleting or programming.
If the code that you have is using flash routines for reading it is either the wrong code or something is incorrectly configured.
If your configuration data is in declared as a const array or struct you can simpy access it as any variable. Otherwise any pointer access to the Flash location can be used (eg. ucValue = *(unsigned char *)*0x2000;)
Regards
Mark