how to decide dest in SetBlockFlash()

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to decide dest in SetBlockFlash()

跳至解决方案
2,257 次查看
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 解答
898 次查看
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 回复数
898 次查看
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 项奖励
回复
898 次查看
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 项奖励
回复
899 次查看
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 项奖励
回复
898 次查看
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 项奖励
回复