Problem with the prm file.

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

Problem with the prm file.

跳至解决方案
3,834 次查看
VianneyC
Contributor I
Hello,

I'm using CodeWarrior 5 and working with a HCS08 microcontroller. I have a problem with the prm file. I explain immediately  with  the facts :

That is my prm file (without comments) :

Code:
---start--prm--file------------------------------------------------------------NAMES ENDSEGMENTS    RAM0             =  READ_WRITE   0x0080 TO 0x00FF;    RAM1             =  READ_WRITE   0x0100 TO 0x077F;    STCK             =  READ_WRITE   0x0780 TO 0x087F;    FW_SEG           =  READ_ONLY    0x8000 TO 0xFBFF;       EMU_EE           =  READ_WRITE   0xFC00 TO 0xFDFF;       ROM1                     =  READ_ONLY    0xFE00 TO 0xFFAF;    NV_REG_SEG       =  READ_ONLY    0xFFB0 TO 0xFFBF;    USER_VECTOR_SEG  =  READ_ONLY    0xFFC0 TO 0xFFCB;    VECTOR_SEG              =  READ_ONLY    0xFFCC TO 0xFFFF;         ENDPLACEMENT    .data                                          INTO  RAM1;    .text                                          INTO  FW_SEG;    .stack                                         INTO  STCK;    _CX_DATA_TINY,fl_ram                           INTO  RAM0;    _CX_DATA_NEAR,.common,fl_ram1      INTO  RAM1;    _CX_CONST_NEAR                                INTO  FW_SEG;       int_vect_SEG                                   INTO  VECTOR_SEG;       nv_seg_SEG                                     INTO  NV_REG_SEG;    emu_ee_seg                                     INTO  EMU_EE;    fl_c,fl_era,fl_prg                                  INTO  FW_SEG;                                               ENDSTACKTOP 0x087F---end--prm--file------------------------------------------------------------

 

The problem is that a lot of segments are not created. I am aware that those segments are mine.
( fl_ram , fl_ram1, int_vect_SEG , nv_seg_SEG , emu_ee_seg , fl_c , fl_era , fl_prg )

In fact in the map file, I find only the other segments,

Code:
---start--map--file------------------------------------------------------------SECTION-ALLOCATION SECTIONSection Name                    Size  Type     From       To       Segment---------------------------------------------------------------------------------------------.text                           6773     R     0x8008     0x9A7C   FW_SEG.stack                           256   R/W      0x780      0x87F   STCK_CX_DATA_TINY                     19   R/W       0x80       0x92   RAM0_CX_DATA_NEAR                     69   R/W      0x100      0x144   RAM1.common                          362   R/W      0x145      0x2AE   RAM1_CX_CONST_NEAR                     4     R     0x9A7D     0x9A80   FW_SEG.abs_section_80                    1   N/I       0x80       0x80   .absSeg0.abs_section_ff                    1   N/I       0xFF       0xFF   .absSeg1.abs_section_100                   1   N/I      0x100      0x100   .absSeg2.abs_section_87f                   1   N/I      0x87F      0x87F   .absSeg3.abs_section_18                   16   N/I       0x18       0x27   .absSeg4.bss                               5   R/W      0x2AF      0x2B3   RAM1.rodata                          211     R     0x9A81     0x9B53   FW_SEG.init                              8     R     0x8000     0x8007   FW_SEG---end--map--file------------------------------------------------------------

 
and routine that are inserted, for example, in the "fl_era" segments result to be in the UNUSED-OBJECTS SECTION - NOT USED PROCEDURES part of the map file. That is normal, you tell me, because fl_era is not understood by the compiler ...

But, why this "fl_era" segments is not created ? For me the prm file seems good.
I hope that the explaination is cleary enough so that someone can give me some advices and - why not - a great solution to my problem.

Thanks

Vianney

--
Edit Alban - Used SRC to display both file content properly tabulated



Message Edited by Alban on 2007-07-11 04:38 PM
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,313 次查看
CrasyCat
Specialist III
Hello
 
The HC08 linker is a smart linker. An object (function, variable, constant), which is not referenced in the application will not be linked to your application.
If the objects you define in the section fl_ram are not used, the section will not be created at all.
 
In order to tell the linker to link those objects to the application even though they are not used, you need to use an ENTRIES block in your PRM.
 
Specify the list of the unused symbol you want to link to the application in the ENTRIES block.
 
CrasyCat

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,313 次查看
VianneyC
Contributor I

Ok.

I sent a service request, but waiting the respond really nobody has idea on what does not go ...

Bye.

Vianney



0 项奖励
回复
1,313 次查看
CrasyCat
Specialist III
Hello
 
It is hard to say without the whole application.
Did you check in the .map file in which section the variable NVOPT has been allocated?
This might give an indication on the reason for the problem.
Also Do you have external declaration for this variable?
Did you place the variable in the same section in the declaration?
 
Also can you try the following:
  - define NV_REG_SEG as follows  
      NV_REG_SEG       =  READ_ONLY    0xFFBF SIZE 1;
 
Should not make a difference, but might be worth a try.
 
CrasyCat
0 项奖励
回复
1,313 次查看
VianneyC
Contributor I
I  solved the problem using this solution :

Code:
    const Byte NVOPT @0xFFBF = 0xFE;

 that give me this allocation in the .map file:

Code:
*********************************************************************************************SECTION-ALLOCATION SECTIONSection Name                    Size  Type     From       To       Segment---------------------------------------------------------------------------------------------....abs_section_ffbf                  1     R     0xFFBF     0xFFBF   .absSeg0...

 Thanks.
Bye.

Vianney



0 项奖励
回复
1,314 次查看
CrasyCat
Specialist III
Hello
 
The HC08 linker is a smart linker. An object (function, variable, constant), which is not referenced in the application will not be linked to your application.
If the objects you define in the section fl_ram are not used, the section will not be created at all.
 
In order to tell the linker to link those objects to the application even though they are not used, you need to use an ENTRIES block in your PRM.
 
Specify the list of the unused symbol you want to link to the application in the ENTRIES block.
 
CrasyCat
0 项奖励
回复
1,313 次查看
VianneyC
Contributor I
Right !

Now I have this two files :

PRM :

Code:
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */        // 0x0000 to 0x007F : direct page registers        RAM0             =  READ_WRITE   0x0080 TO 0x00FF; // first  ram segment    RAM1             =  READ_WRITE   0x0100 TO 0x077F; // second ram segment    STCK             =  READ_WRITE   0x0780 TO 0x087F; // stack segment         // 0x0880 to 0x17FF : unimplemented    // 0x1800 to 0x182B : high page register        // 0x182C to 0x7FFF : unimplemented                FW_SEG           =  READ_ONLY    0x8000 TO 0xFBFF; // first  rom segment        EMU_EE_SEG       =  READ_WRITE   0xFC00 TO 0xFDFF; // serial eeprom emulation segment        ROM1             =  READ_ONLY    0xFE00 TO 0xFFAF; // second rom segment            NV_REG_SEG       =  READ_ONLY    0xFFBF TO 0xFFBF; // non volatile registers segment       USER_VECTOR_SEG  =  READ_ONLY    0xFFC0 TO 0xFFCB; // user vector segment    VECTOR_SEG       =  READ_ONLY    0xFFCC TO 0xFFFF; // vector segment             ENDPLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */    _CX_DATA_TINY,fl_ram                           INTO  RAM0;    .data,.bss,.common                             INTO  RAM1;    _CX_DATA_NEAR                                  INTO  RAM1;    .stack                                         INTO  STCK;    .init,.text,.rodata                            INTO  FW_SEG;        fl_c,fl_era,fl_prg                            INTO  FW_SEG;                     _CX_CONST_NEAR,_CX_CODE_INTERRUPT              INTO  FW_SEG;        emu_ee                                         INTO  EMU_EE_SEG;        nvopt_reg                                      INTO  NV_REG_SEG;        int_vect                                       INTO  VECTOR_SEG;           ENDSTACKTOP 0x087FENTRIES   FL_DRV.c.o:* Int_ctrl.c.o:* ee_cfg.c.o:* Main.c.o:*END

 and MAP :

Code:
_CX_DATA_TINY                     26   R/W       0x80       0x99   RAM0fl_ram                            73   R/W       0x9A       0xE2   RAM0.bss                               5   R/W      0x100      0x104   RAM1.common                          402   R/W      0x105      0x296   RAM1_CX_DATA_NEAR                     74   R/W      0x297      0x2E0   RAM1.stack                           256   R/W      0x780      0x87F   STCK.init                              8     R     0x8000     0x8007   FW_SEG.text                           6962     R     0x8008     0x9B39   FW_SEG.rodata                          413     R     0x9B3A     0x9CD6   FW_SEGfl_c                             399     R     0x9CD7     0x9E65   FW_SEGfl_era                            25     R     0x9E66     0x9E7E   FW_SEGfl_prg                            77     R     0x9E7F     0x9ECB   FW_SEG_CX_CONST_NEAR                     4     R     0x9ECC     0x9ECF   FW_SEG_CX_CODE_INTERRUPT               686     R     0x9ED0     0xA17D   FW_SEGemu_ee                            13   R/W     0xFC00     0xFC0C   EMU_EE_SEGint_vect                          48     R     0xFFCC     0xFFFB   VECTOR_SEG.abs_section_80                    1   N/I       0x80       0x80   .absSeg0.abs_section_ff                    1   N/I       0xFF       0xFF   .absSeg1.abs_section_100                   1   N/I      0x100      0x100   .absSeg2.abs_section_87f                   1   N/I      0x87F      0x87F   .absSeg3.abs_section_18                   16   N/I       0x18       0x27   .absSeg4

Why "nvopt_reg" is not in the map file ? This is the code in the file "Main.c" :

Code:
#pragma CONST_SEG nvopt_reg    const Byte NVOPT = 0xFE;            #pragma CONST_SEG DEFAULT

 And an other one that cause me the L1912 warning, what are the ".abs_section_xx" section name ? Can I cancel them ?

Thanks for the help, that I need... :smileysad:

Vianney


0 项奖励
回复
1,313 次查看
CrasyCat
Specialist III
Hello
 
There should be something special in the project. You need to get a support support engineer looking into that.
 
I would recommend you to submit a service request for that.

Click here to submit a service request.
 
Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
  - Start CodeWarrior
  - Open the project
  - Select "Help" -> "Pack and Go" and follow instructions on the screen.
 
Attach the generated .zip file to the SR. 
 
CrasyCat
0 项奖励
回复