Register address is wrong.

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

Register address is wrong.

跳至解决方案
1,662 次查看
100asong
Contributor I

My CPU:9s12DP512.

 

void main(void)
{     
  MMCCTL1 =  1;                 
  /* DIRECT: DP15=0,DP14=0,DP13=0,DP12=0,DP11=0,DP10=0,DP9=0,DP8=0 */
  DIRECT = 0;                  
  /* IVBR: IVB_ADDR=255 */
  IVBR = 255;     
  
  ECLKCTL = 64;

 

  while(1);

}

 

 

some warning information here:

 

L1823: External object _MMCCTL1 in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default


L1823: External object _DIRECT in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default


L1823: External object _IVBR in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default


L1823: External object _ECLKCTL in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default

 

And then I debug it by BDM, find that :

MMCCTL1 address changed from 0x0013 t0 0x0000(Compiler setting).

DIRECT address is okay.

ECLKCTL address is wrong ,change to 0x03.

 

Why it is not right address.

标签 (1)
0 项奖励
回复
1 解答
1,434 次查看
CrasyCat
Specialist III

Hello

 

- Which version of CodeWarrior are you using?
  To retrieve that info:
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - CodeWarrior version used is displayed on top in the Installed Products dialog.

 

- How did you create the project? Did you use the project wizard?

  Project created with the wizard have all the required files to get you up and running quickly. 

 

Here you are obviously missing the definition for all the I/O registers.

I would recommend you to add the file mc9s12dp512.c (assuming you are using a mc9s12dp512 MCU) which contains the I/O definition for the various registers to your project.

 

There is something strange here though.

Register MMCCTL1 is only available in HCS12XE cores. How did you get it initialized in your startup code?

 

CrasyCat

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,435 次查看
CrasyCat
Specialist III

Hello

 

- Which version of CodeWarrior are you using?
  To retrieve that info:
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - CodeWarrior version used is displayed on top in the Installed Products dialog.

 

- How did you create the project? Did you use the project wizard?

  Project created with the wizard have all the required files to get you up and running quickly. 

 

Here you are obviously missing the definition for all the I/O registers.

I would recommend you to add the file mc9s12dp512.c (assuming you are using a mc9s12dp512 MCU) which contains the I/O definition for the various registers to your project.

 

There is something strange here though.

Register MMCCTL1 is only available in HCS12XE cores. How did you get it initialized in your startup code?

 

CrasyCat

0 项奖励
回复