12-18-2007
11:11 AM
2,785件の閲覧回数

Electronico
Contributor I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hello !
I'm working with Code warrior 6.0 and I'm experimenting troubles on the S08QE128.
For my application, I need to declare a 3 bytes sized pointer in order to read data saved in paged flash memory.
I'm using the "banked" memory model.
Code warrior help tels to use the key word "__far" in pointer declaration to declare a 3 bytes sized pointer, but it doesn't work, the pointer remains on 2 bytes only.
I also tryed to use the key word "__linear" : it seemed to work at first sight because the pointer had been well resized on 3 bytes, but the compiler failed with C4007 error telling "pointer deref is not allowed"...
Do you have any idea ?
Thank you very much for your help !
Electronico
解決済! 解決策の投稿を見る。
1 解決策
12-18-2007
01:48 PM
1,244件の閲覧回数

Navidad
Contributor III
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
When using the banked memory model all the function pointers are 3-byte wide. As for __linear pointers, you can use them to store linear addresses (the memory model has no influence upon their size), but dereferencing is not supported. In order to access the data you need to make use of the macros defined in mmu_lda.h (located in lib/hc08c/include in your CW distribution) or write some inline assembly. Please take a look at the example from this thread (the example is actually included in version 6.1).
When using the banked memory model all the function pointers are 3-byte wide. As for __linear pointers, you can use them to store linear addresses (the memory model has no influence upon their size), but dereferencing is not supported. In order to access the data you need to make use of the macros defined in mmu_lda.h (located in lib/hc08c/include in your CW distribution) or write some inline assembly. Please take a look at the example from this thread (the example is actually included in version 6.1).
3 返答(返信)
12-18-2007
01:48 PM
1,245件の閲覧回数

Navidad
Contributor III
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
When using the banked memory model all the function pointers are 3-byte wide. As for __linear pointers, you can use them to store linear addresses (the memory model has no influence upon their size), but dereferencing is not supported. In order to access the data you need to make use of the macros defined in mmu_lda.h (located in lib/hc08c/include in your CW distribution) or write some inline assembly. Please take a look at the example from this thread (the example is actually included in version 6.1).
When using the banked memory model all the function pointers are 3-byte wide. As for __linear pointers, you can use them to store linear addresses (the memory model has no influence upon their size), but dereferencing is not supported. In order to access the data you need to make use of the macros defined in mmu_lda.h (located in lib/hc08c/include in your CW distribution) or write some inline assembly. Please take a look at the example from this thread (the example is actually included in version 6.1).
12-18-2007
02:37 PM
1,244件の閲覧回数

Electronico
Contributor I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Navidad,
Thank you for your answer.
I'm going to try those macros defined in that file.
On my previous project, I worked on an HCS12, and the "far pointers" mechanism made me suffer a lot, but at the end was reliable and easy to use.
It's why I didn't thought about using another way of accessing data in paged memory.
Without your help, it would have taken a long time to me before I found that other solution !
Thank you again !
Bye,
Electronico
12-20-2007
01:32 PM
1,244件の閲覧回数

CrasyCat
Specialist III
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hello
You can find a sample project using string constants stored in banked ROM.
Look at {Install}\(CodeWarrior_Examples)\HCS08\Evaluation Board Examples\DEMOQE128\DEMOQE128_LAP_Dictionary.
CrasyCat
返信
