Help Read Flash K64

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

Help Read Flash K64

跳至解决方案
1,904 次查看
danilolima
Contributor II

Hi.
I am wondering a way to read a part of flash memory on K64.
I have already tried using FLASH_ReadOnce and FLASH_ReadResource, but to no avail.
All help is welcome, thank you.

标签 (1)
1 解答
1,719 次查看
mjbcswitzerland
Specialist V

Hi

Try

unsigned char buffer[16];

(const void *)flash_add = 0x4000;

memcpy(buffer, flash_add, 16);

// Now we have the 16 bytes form flash address 0x4000 in buffer

Or generally
unsigned char flash_data = *(unsigned char *)0x4000;
To read any byte from flash.

Only the program once area requires special operation to read. The rest is simply memory-mapped.

Regards

Mark

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,720 次查看
mjbcswitzerland
Specialist V

Hi

Try

unsigned char buffer[16];

(const void *)flash_add = 0x4000;

memcpy(buffer, flash_add, 16);

// Now we have the 16 bytes form flash address 0x4000 in buffer

Or generally
unsigned char flash_data = *(unsigned char *)0x4000;
To read any byte from flash.

Only the program once area requires special operation to read. The rest is simply memory-mapped.

Regards

Mark

0 项奖励
回复
1,719 次查看
danilolima
Contributor II
Now I need to delete, write and read a memory location. Can you help me?
0 项奖励
回复
1,719 次查看
mjbcswitzerland
Specialist V

Hi

Erasing and writing requires Flash routines.
See http://www.utasker.com/kinetis/FRDM-K64F.html (with command line interface capabilty to read/write/erase internal Flash) and simulation.
Code available at http://www.utasker.com/kinetis.html
Including various file and parameter system that can operate in internal flash or external SPI flash.
Operation and low level interface described in http://www.utasker.com/docs/uTasker/uTaskerFileSystem_3.PDF

Regards

Mark

0 项奖励
回复
1,719 次查看
danilolima
Contributor II

Hi Mark I am very grateful for your help, thank you!

0 项奖励
回复