.init segment

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

.init segment

Jump to solution
677 Views
IlConte
Contributor IV

Dear all, I use CW 10.6 and S08PT60

 

I have a application divided fron application and boot

 

Boot from 0x1040

Application from 0x3200  

 

My prm is

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */

    Z_RAM                    =  READ_WRITE   0x0040 TO 0x00FF;

    RAM                      =  READ_WRITE   0x0100 TO 0x103F;

    ROM                      =  READ_ONLY    0x3300 TO 0xFF6F;       /* 3200 - 3300 driver */

    ROM1                     =  READ_ONLY    0x1040 TO 0x2FFF;

    ROM2                     =  READ_ONLY    0xFF80 TO 0xFFAF;

    EEPROM                   =  READ_ONLY    0x3100 TO 0x31FF;

/* INTVECTS                 =  READ_ONLY    0xFFB0 TO 0xFFFF; Reserved for Interrupt Vectors */

END

 

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */

    DEFAULT_RAM,                        /* non-zero page variables */

                                        INTO  RAM;

 

    _PRESTART,                          /* startup code */

    STARTUP,                            /* startup data structures */

    ROM_VAR,                            /* constant variables */

    STRINGS,                            /* string literals */

    VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */

    DEFAULT_ROM,

    COPY                                /* copy down information: how to initialize variables */

                                        INTO  ROM; /* ,ROM1,ROM2: To use "ROM1,ROM2" as well, pass the option -OnB=b to the compiler */

 

    _DATA_ZEROPAGE,                     /* zero page variables */

    MY_ZEROPAGE,                         INTO  Z_RAM;

    MY_BOOT                              INTO  ROM1;

END

 

STACKSIZE 0x80

 

map:

*********************************************************************************************

SECTION-ALLOCATION SECTION

Section Name                    Size  Type     From       To       Segment

---------------------------------------------------------------------------------------------

.init                              7     R     0x3300     0x3306   ROM

.rodata                          326     R     0x3307     0x344C   ROM

.text                           8305     R     0x344D     0x54BD   ROM

_DATA_ZEROPAGE                   185   R/W       0x40       0xF8   Z_RAM

MY_BOOT                         7224     R     0x1040     0x2C77   ROM1

.abs_section_ffb0                 80     R     0xFFB0     0xFFFF   .absSeg0

 

 

How can I move the .init segment to ROM1 segment ?

 

Thanks

Labels (1)
0 Kudos
1 Solution
473 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hello Stefano,

to move the .init segment to ROM1 segment, we need:

1. define _PRESTART in ROM1 in prm file.

_PRESTART                    INTO ROM1;

2. add -OnB=b to the compiler to avoid trouble.

for detail . see attached video


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
474 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hello Stefano,

to move the .init segment to ROM1 segment, we need:

1. define _PRESTART in ROM1 in prm file.

_PRESTART                    INTO ROM1;

2. add -OnB=b to the compiler to avoid trouble.

for detail . see attached video


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
473 Views
IlConte
Contributor IV

Thanks OK

0 Kudos