Problem running code generated with CodeWarrior

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

Problem running code generated with CodeWarrior

跳至解决方案
561 次查看
pierreschmidt
Contributor III

Hello, I modified a project initially written for windriver diab compiler to work with Codewarrior.

 

I then ran the project with the help of cw_icdppcnexus but experienced a problem after startup when the PC goes to the main function: The PC gets 000000h which makes execution continue at a location where there is no executable code

 

So I had a look at the assembly instructions equivalency and compared the original Windriver executable file with the CodeWarrior one. Here is the result:

 

2650_2650.jpgSans titre.jpg

The window on top is the Codewarrior generated code, the second is from Windriver.

 

Codewarrior generates some extra instructions which make the PC go to 00000h due to SE_BLR instruction (LR is 00000h). After that the code looks very similar for both compilers. Is there a way to disable the generation of those extra instructions?? (does not actually know what those instructions do)

 

Thanks a lot

 

P.SCHMIDT

标签 (1)
0 项奖励
1 解答
369 次查看
pierreschmidt
Contributor III

I solved this problem. It was in fact due to bad memory mapping

在原帖中查看解决方案

0 项奖励
2 回复数
370 次查看
pierreschmidt
Contributor III

I solved this problem. It was in fact due to bad memory mapping

0 项奖励
369 次查看
luciantodor
Contributor I

I have the same problem and I cannot find the correct configuration for the memory mapping.

Please, can you help me with the memory mappgig?

Thanks!

Here is my memory section from the linker:

 

MEMORY

{

     /* Interrupt Service Routines */

     flash_rchw : org = 0x00000000, LENGTH = 0x8

     flash_vec : org = 0x20000, LENGTH = 0xD00

     

     /* 1MB Internal Flash */

     int_flash : org = 0x20D00, LENGTH = 1M - 0x20D00

     

     /* 80K Internal SRAM */

     int_sram : org = 0x40000000, LENGTH = 80k

     stack : org = 0x00200000, len = 0x0200

}

0 项奖励