How to write and read KEA128 Flash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to write and read KEA128 Flash

1,919 次查看
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? 

标签 (1)
0 项奖励
回复
4 回复数

1,371 次查看
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 项奖励
回复

1,371 次查看
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 项奖励
回复

1,371 次查看
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 项奖励
回复

1,371 次查看
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 项奖励
回复