pragma CODE_SEG of __EntryPoint function Issue

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

pragma CODE_SEG of __EntryPoint function Issue

跳至解决方案
1,213 次查看
amit_dhand
Contributor III

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

标签 (1)
0 项奖励
回复
1 解答
833 次查看
trytohelp
NXP Employee
NXP Employee

Hi all,

This is may be linked to the Thread:

    Problem with S12ZVC startup code


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
3 回复数
834 次查看
trytohelp
NXP Employee
NXP Employee

Hi all,

This is may be linked to the Thread:

    Problem with S12ZVC startup code


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
833 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

please upload your demo code including Cpu_Test_func() functions.

please also mention the CW version: Start the IDE and click on Help | About CodeWarrior Development Studio. Send me the version and build id.

thanks!


Have a great day,
Zhang Jun

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

0 项奖励
回复
833 次查看
amit_dhand
Contributor III

Hello Jennie,

thank you for your support.

I am using CodeWarrior for MCU S12ZVC

    Version: 10.6

    Build Id:140329

Thank you

Regards,

Amit Dhand

0 项奖励
回复