#pragma CODE_SEG no effect

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

#pragma CODE_SEG no effect

2,507 Views
DavidoBG
Contributor II
I would like write my application SW between E000->F7AD and the bootloader application between F7AD->FFAD. So i modify prm file like this:
 
/* This is a linker parameter file for the mc9s08qe8 */
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. */
    Z_RAM                    =  READ_WRITE   0x0060 TO 0x00FF;
    RAM                      =  READ_WRITE   0x0100 TO 0x025F;
    ROM                      =  READ_ONLY    0xE000 TO 0xF7AD;
    BOOTLOADER               =  READ_ONLY    0xF7AE TO 0xFFAD;
    ROM1                     =  READ_ONLY    0xFFC0 TO 0xFFCD;
 /* INTVECTS                 =  READ_ONLY    0xFFCE TO 0xFFFF; Reserved for Interrupt Vectors */
END
 
I put in my .c file
#pragma CODE_SEG
Bootloader SW
#pragma ROM
 
But when i open my .s19 file, the data position begins 0xE000 to E150 (150 Bytes is sizeof all code). I would like see
0xE000->E100 (100 bytes size of application SW )
and
0xF7AD->0xF7FD (50 bytes size of bootloader SW )
Do you have any idea my issue? i use MC9S08QE8
 
Thanks David
Labels (1)
0 Kudos
3 Replies

712 Views
erooll
Contributor II
Hi, your prm looks good, but try to do this: In you prm add in PLACEMENT section a entry like this
PLACEMENT 
 .
 .
 .
   BOOTLOADER_CODE INTO BOOTLOADER;
END
and in your .c do this:
#pragma CODE_SEG BOOTLOADER_CODE
Bootloader Sw
.
.
.
#pragma CODE_SEG DEFAULT
 
if you have a header file when are declarated your function, you need also put pragma statements to enclose function declaration
 
Check placement of your function in file .map of the project
0 Kudos

712 Views
DavidoBG
Contributor II
It's OK with into to placement section
Thanks very much
David
0 Kudos

712 Views
CompilerGuru
NXP Employee
NXP Employee
One thing which comes to my mind is that the entry point of the application (INIT in prm, defaults to _Startup) is moved into a special section, not sure out of my mind what the section name is, I guess .init (there is also a synonym with no dot).
In this case, try:
Code:
> .init, BOOTLOADER               =  READ_ONLY    0xF7AE TO 0xFFAD;

 
Daniel
0 Kudos