Could somebody have a quick look to give me some hint ?

cancel
Showing results for 
Search instead for 
Did you mean: 

Could somebody have a quick look to give me some hint ?

3,653 Views
Contributor I
We built a new board using Coldfire 5407

I built a simple application "Hello World" (automatically generated) by CW software). I added couple of inline assembly lines like the following

/*
* File: main.c
* Purpose: sample program
*
*/

#include

int main()
{
printf("Hello World MW in C\n\r");

fflush(stdout);

asm // added by me - begin
{
move.l #1,d0 // single step is ok
move.l d0,d1 // single step causes exeception

} // added by me - end

while(1); // Idle

return 0;
}

Then I do single step. Everything is fine until
"move.l d0,d1". I got the error message box as


"Critical Error
dbg_check_critical_error returned: IIIegal command error
from CPU - try a RESET"

Then I click OK, I got

"Bus error"




The same code works fine in the demo board - m5407c3. But it can't work on my new board.

asm // added by me - begin
{
move.l #1,d0 // single step is ok
move.l d0,d1 // single step causes exeception

} // added by me - end

What would be the possible reason to prevent the register to register copy "move.l d0,d1" ? hardware or software error? Any suggestions?


Thanks in advance.
Labels (1)
0 Kudos
4 Replies

79 Views
Contributor I
Thank you CrasyCat.

Thie issue has bothered me for a week and still no clue ...

We use our own board not the demo board. The demo board works fine. But our board design follows the demo design.

Do you have any clue why the

move.l #1,d0 // single step is ok
move.l d0,d1 // single step causes exeception

the register to register movemnet causes the bus error!

Is this a hardware problem or softare setup?

We use CW development Studio for Coldfire Architectures Version 6.0, Build 8. Is this the newest version?

I checked all the exceptions in my project settings dialog. But it won't help anyway.

I really need a feedback... I am thinking to buy P&E ICDCFZ debugger to see if this debugger works ...

I think it is like a hardware issue. Do we miss something in the hardware design.

Thanks for your reply
0 Kudos

79 Views
Specialist III
Hello
 
If the issue appears only on your own board, I would suspect either a hardware problem or a wrong configuration file.
Did you check that the configuration described in the target initialization file specified in CF Debugger Settings is appropriate for your board.
 
The Debug initialization file contains commands that initialize the target board
to write the program to memory, once the debugger starts the program.
 
You might have to modify the file we provide for the EVB board.
 
I have no clue how a move to register can generate an exception.
But keep in mind that the exception might be detected a couple of cycle later.
 
CrasyCat
0 Kudos

79 Views
Contributor I

cc,

I have been working with zizheng on this issue.  We have purchased the P&E ICDCFZ debugger and have noted that it appears to work fine.  Also, we can access memory (read, write, and mem test with the hardware debugger) and RUN code with CW, it is only when debugging that we see errors (on my machine, CW generally locks up when I try to debug).

We have both been over the hardware extensively and can not find any issue.  There are some subtle differences between our design and the 5407EVB, but none of them made any difference.

As for the configuration file, our board is relatively simple, having FLASH, SRAM, and a couple of peripherals.  Since we can access the board with hardware diagnostics and run code, I can't see any problem with the config file (doesn't mean there isn't one, I just can't see it).

Thanks,

Joe

 

0 Kudos

79 Views
Specialist III

Hello

I tried to reproduce the issue locally, but without success so far.

Are you using a standard Freescale evaluation board or a self made board?

Which version of CodeWarrior are you using(V6.2, ..)?

In your project settings dialog, which exceptions are unchecked in the "CF Exceptions" panel?

CrasyCat

0 Kudos