how to decide dest in SetBlockFlash()

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

how to decide dest in SetBlockFlash()

ソリューションへジャンプ
2,347件の閲覧回数
SofTA
Contributor I
Hi Experts,
 
It seems someone asked this kind of question before but I could no find an answer suit me so please excuse me to ask it again:
 
I want to save some calibration data. I am using MC9S08QE128 CPU. How can I decide the dest in SetBlockFlash() in IntFlash bean? Thanks a lot in advance.
 
Softa
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
988件の閲覧回数
CrasyCat
Specialist III
Hello
 
If you want to reserve a page of flash for your application, just make sure to remove any occurrence of this  page in the.PRM file's PLACEMENT block.
 
Your original placement block might look as follows:
 
Code:
PLACEMENT    
     DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,                         
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,             
    NON_BANKED,                        
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_0,PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,                    
    MY_ZEROPAGE                INTO  Z_RAM;END

 
Let's say you want to reserve PPAGE_0 to store your data in your application. Then modify the placement block as follows:
 
Code:
PLACEMENT
    DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,
    NON_BANKED,               
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,       
    MY_ZEROPAGE                INTO  Z_RAM;END

 
CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
988件の閲覧回数
SofTA
Contributor I
Hi Tom,
 
Thank you for offering help. I may not state me question clearly. I am new to PE. As I understand, my program code compiled in PE platform also use flash memory. I do not worry much about the address of the data I want to save because I think I can use &data to get the address. But I don't know where to save it safely without overwriting my program code. For example, if I write it to address 0x08000, how do I know or control that the address 0x08000 is only used by me but not the compiler? Maybe my quesion is too rudimentary :smileyhappy:
 
Softa
0 件の賞賛
返信
988件の閲覧回数
SofTA
Contributor I
Hi CrasyCat,
 
Thank you very much. This is exactly what I want to know. This is great. Thank you again!
 
Softa
0 件の賞賛
返信
989件の閲覧回数
CrasyCat
Specialist III
Hello
 
If you want to reserve a page of flash for your application, just make sure to remove any occurrence of this  page in the.PRM file's PLACEMENT block.
 
Your original placement block might look as follows:
 
Code:
PLACEMENT    
     DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,                         
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,             
    NON_BANKED,                        
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_0,PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,                    
    MY_ZEROPAGE                INTO  Z_RAM;END

 
Let's say you want to reserve PPAGE_0 to store your data in your application. Then modify the placement block as follows:
 
Code:
PLACEMENT
    DEFAULT_RAM               INTO  RAM,RAM1;    _PRESTART,
    STARTUP,                                ROM_VAR,                                STRINGS,                                VIRTUAL_TABLE_SEGMENT,
    NON_BANKED,               
    DEFAULT_ROM,    COPY                       INTO  ROM;
    PAGED_ROM                  INTO  PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1;    _DATA_ZEROPAGE,       
    MY_ZEROPAGE                INTO  Z_RAM;END

 
CrasyCat
0 件の賞賛
返信
988件の閲覧回数
J2MEJediMaster
Specialist I
Take a look at this thread and see if it will help you. If you're talking about what memory address to use for storing into Flash, you need to look at the memory map for the MCU you're working with. HTH.

---Tom

0 件の賞賛
返信