Reading data from banked flash location

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

Reading data from banked flash location

ソリューションへジャンプ
584件の閲覧回数
vojislavbandobr
Contributor I

Hi,

 

I have constants placed into PPAGE_6 and PPAGE_7 but I have problem to read them.

 

I tried standard:

 

(*(volatile unsigned char*)addr);

 

where addr is full address of byte location into flash (for example 0x68000), but I got data from other location.

 

I have used banked memory model.

 

MCU is MC9S08DZ128

 

Any Idea?

ラベル(1)
タグ(1)
0 件の賞賛
1 解決策
411件の閲覧回数
kef
Specialist I

Standard pointer can't be used to access banked data in CW. You have 3 choices:

1. switch PPAGE from routine in nonbanked flash, read data from PPAGEd flash.

2. manipulate linear address pointer registers (LAP) and read your data reading LWP, LBP and LB registers.

3. use CW linear data pointer and macros form mmu_lda.h . It is a pity this pointer is not the same like regular C pointer. You should study DEMOQE128_LAP_Dictionary example to find how to use it. Example was included in CW6.x examples folder. It seems it is not included any more in CW10.x. See attached.

Try using forum search. Subject was discussed few times already.

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
412件の閲覧回数
kef
Specialist I

Standard pointer can't be used to access banked data in CW. You have 3 choices:

1. switch PPAGE from routine in nonbanked flash, read data from PPAGEd flash.

2. manipulate linear address pointer registers (LAP) and read your data reading LWP, LBP and LB registers.

3. use CW linear data pointer and macros form mmu_lda.h . It is a pity this pointer is not the same like regular C pointer. You should study DEMOQE128_LAP_Dictionary example to find how to use it. Example was included in CW6.x examples folder. It seems it is not included any more in CW10.x. See attached.

Try using forum search. Subject was discussed few times already.

0 件の賞賛
411件の閲覧回数
vojislavbandobr
Contributor I

Thank you!

0 件の賞賛