How to read data from internal P-Flash for KL26?

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

How to read data from internal P-Flash for KL26?

Jump to solution
667 Views
yenhsu
Contributor III

Hello,

I am trying to use internal P-flash of KL26 as a NVM to save data, of course I will carefully not to access the area that stored binary source code to mess it up then cause the system crash. It seems to me that I can use "FTFA_FCCOB0" command to write or erase a sector, but I would like to know how to read data from internal flash for KL26. I will deeply appreciate if someone who can teach me about this? (It would be better if you can provide an example code for a reference.)

Thanks

1 Solution
570 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Chris Chen,

    You are welcome!

    If your question is solved, please mark the correct answer to close this question, thank you!


Have a great day,

Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
570 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Chris chen,

    Read flash data is very easy, just read the according address is OK, you don't need to use any other flash command.

  Take an example, printf the data in address 0x0008:

printf("0x%x,",*((uint32_t *)(0x00000008)));

(uint32_t *)(address);//address is just the flash address where you want to read the data.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

570 Views
yenhsu
Contributor III

Hi Kerry,

It's really helpful to me. Thank you very much. :smileyhappy:

Regards,

Chris.

0 Kudos
571 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Chris Chen,

    You are welcome!

    If your question is solved, please mark the correct answer to close this question, thank you!


Have a great day,

Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos