Data Flash Read/Write on 56F8323

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Data Flash Read/Write on 56F8323

4,950件の閲覧回数
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)
  • DSC

タグ(1)
0 件の賞賛
返信
1 返信

1,250件の閲覧回数
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 件の賞賛
返信