Data Flash Read/Write on 56F8323

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

Data Flash Read/Write on 56F8323

4,719 次查看
Mac
Contributor I
I am using processor expert to generate the base code for my project.  I am attempting to write a data table to data flash from my code that is running in Program Flash.  I have made calls using PE specified addresses within the Data Flash such as:

#define DATA_FLASH_START 4096

From what it looks like, when calling the following two fxns, you need to multiply the address by 2 before calling:

byte DataFlash_SetByteFlash(dword Addr,byte Data);

byte DataFlash_GetByteFlash(dword Addr,byte *Data);

When calling any other set or get fxn for words or long words, you just pass the actual address that you wish to write.

My problem is that no matter what I try at what address, the read and write functions never return an Error Ok value, there is always some sort of an error that is returned.  I have turned off all interrupts in the system so that I can step through this code without CodeWarrior crashing or the peripheral clocks queueing interrupts.  If someone has some basic code that performs basic read/write fxns that they know work, could you please reply and attach them.

Thanks,

Justin

标签 (1)
标记 (1)
0 项奖励
1 回复

1,019 次查看
hlsa
Contributor I
Hi Justin,
 
I found this old post from you today. Did you solve this problem?
 
The address must be multiplied by 2, because the memory addresses are in 16 bit alignment and the bean works internally in 8 bit alignment.
 
I have the problem, that I can write to data flash memory starting at address 2 * 0x1200 = 0x2400 without any problems. But when I try to write to address 2 * 0x1000 = 0x2000 (first address), this fails!
 
Holger
0 项奖励