QD4 EEPROM location read

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

QD4 EEPROM location read

1,145件の閲覧回数
alexit
Contributor I

I must be overlooking something simple, but I can't see it.

 

Using the Flash.zip routines Bigmac posted years ago, with a QD4 and CW10.X my PRM file is modified like:

SSTACK_SEG = NO_INIT 0x00C0 TO 0x00FF;

EEPROM_SEG = READ_ONLY 0xF800 TO 0xF9FF;

ROM1 = READ_ONLY 0xFFC0 TO 0xFFCF RELOCATE_TO 0x00C0;

 

with

SSTACK INTO SSTACK_SEG;

EEPROM INTO EEPROM_SEG;

FLASH_ROUTINE INTO ROM1;

 

In the main.c I am locating my variable in the EEPROM space:

#pragma CONST_SEG EEPROM

const byte telltale;

#pragma CONST_SEG DEFAULT

 

During use, I flash this location when:

if (maxrpm > telltale)

Flash_Program(0xF800, maxrpm)

 

and wanted read this back after a power cycle:

 

telltale = (char*)0xF800;

 

But it won't compile after I added the read back, how should I access this location?

ラベル(1)
タグ(3)
0 件の賞賛
返信
2 返答(返信)

1,045件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

please try this:

telltale = *(unsigned char*)0xE100;

1,045件の閲覧回数
alexit
Contributor I

Thank you, this also did not compile. I am waiting for the PT hardware because I believe this will have better flash support. Then I will be working this project further.

0 件の賞賛
返信