How to write and read KEA128 Flash

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

How to write and read KEA128 Flash

1,422 Views
jikanghu
Contributor I

there are  two problems that confused me:

1. i have to write some global  uint32_t  variates into flash, these variates need to be updata according to the routine demands.How to write variates into fixed address of flash respectively, and how to read the content of these fixed address respectively.

2.  i use the last few sectors to storage golbal variates which need to be updata, one sector has 512 byte. when i update one of the bytes, the others  stay the same, but before i write the flash ,i have to erase the sector. what my operation is correct? how i do to write the flash? 

Labels (1)
0 Kudos
4 Replies

874 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Hu,

1. Flash operate functions are in flash.c. If you need some demo to guide you to fast access, you can download ke_drv_lib_2.0 from NXP website. This library is for MKE series, but also fit for KEA MCU. Read flash is just like read a ram. you can do it like this way: data=(*(unsigned char*)address);

2. Yes, flash can be written in byte, but can only be changed after sector erase. this is the most special feature of NOR flash, different with EEPROM. And flash can not be write-erase for ever. NXP guarantee 100k write-erase cycle for its product. You must use software to smooth your operation. 

Regards,

Jing

0 Kudos

874 Views
jikanghu
Contributor I

Jing

 I use KEAZ64 , another question,I defined a new sectors for my application, like this below, is this right?

pastedImage_1.png

pastedImage_2.png

,do i need to modfied flash.ld file and startup_SKEAZ1284.S file?

0 Kudos

874 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

1. data = (*(unsigned char*)0xf801) :   Yes, it's ok. But take care, something like  (*(unsigned int*)0xf801) will cause hardfault. It's not an alignment reading.

2. You can download it at https://www.nxp.com/webapp/sps/download/preDownload.jsp.

3. Of course you must modified flash.ld.

Regards,

Jing

0 Kudos

874 Views
jikanghu
Contributor I

Jing,

Thanks for your replay,  the read operation like :data = (*(unsigned char*)0xf801) is right? would you give the download link of ke_drv_lib_2.0, i can't find it in NXP website, thanks a lot.

0 Kudos