Access Flash at runtime

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

Access Flash at runtime

498 Views
Arpit_Jain
Contributor I

Hi.....

Is it possible to access code at run time?

How can we access code stored at flash at runtime in NXP MK60?

At what address code is store in flash, how to check that?

thank you!

0 Kudos
1 Reply

492 Views
ErichStyger
Senior Contributor V

Is it possible to access code at run time?

yes.

How can we access code stored at flash at runtime in NXP MK60?

For example:

uint32_t *p = (uint32_t*)main;
uint32_t startOfMainCode = *p;

At what address code is store in flash, how to check that?

As in above example, if you want to access the code of a known symbol/function.

Otherwise check your linker file and linker map file: You can use these symbols too. I wrote a while back an article on that topic: https://mcuoneclipse.com/2016/11/01/getting-the-memory-range-of-sections-with-gnu-linker-files/

I hope this helps,

Erich

0 Kudos