AnsweredAssumed Answered

pragma CODE_SEG of __EntryPoint function Issue

Question asked by Amit Dhand on Aug 31, 2015
Latest reply on Sep 1, 2015 by Pascal Irrle

Hello,

 

I have created a demo project in Code Warrior 10.6 with Processor Expert for S12ZVC micro controller.

 

Function __EntryPoint is the initialisation function for the project which is defined as

INIT _EntryPoint  in the Linker Command File.

 

In file CPU.c function __EntryPoint is defined under

#pragma CODE_SEG __NEAR_SEG NON_BANKED

 

But map file shows this function lies in

 

OBJECT-ALLOCATION SECTION

     Name               Module                 Addr   hSize   dSize     Ref    Section   RLIB

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

MODULE:                 -- Cpu_c.obj --

- PROCEDURES:

     _EntryPoint                             FD0003      59      89       1   .init

 

 

Now I created another function Cpu_Test_func in CPU.c under the same segment #pragma CODE_SEG __NEAR_SEG NON_BANKED in which __EntryPoint function is placed.

 

Then map file shows Cpu_Test_func lies in

 

OBJECT-ALLOCATION SECTION

     Name               Module                 Addr   hSize   dSize     Ref    Section   RLIB

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

MODULE:                 -- Cpu_c.obj --

- PROCEDURES:

          Cpu_Test_func                       FD005C      33      51       1   .init

 

My Observations are

1) Function created in the file where the init function is defined and also under same segment then the function goes into .init segment.

2) Function created in different file where the init function is not defined and also under same segment then the function goes into the correct segment.

 

Now my question is why this happens like that. Is it a bug of CodeWarrior 10.6 for S12ZVC. How can I resolve them.

 

Thanks,

Amit Dhand

Outcomes