DEMOJM Coldfire locks up when compiled with Codewarrior V6.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DEMOJM Coldfire locks up when compiled with Codewarrior V6.1

799 Views
nophead
Contributor I

The example programs work when compiled with the version of Codewarrior that comes in the kit, V6.1, but if I compile them with Codewarrior V6.3 they all lock up in disable_ep_tx().

 

Anybody know a fix for this?

Labels (1)
0 Kudos
1 Reply

251 Views
nophead
Contributor I

Well looking into the assembler code it appears the V6.3 compiler is badly broken:

 

The line:

MCF_USB_ENDPT(ep) &= ~MCF_USB_ENDPT_TX_EN;

Translates to:

LEA 0xFFFF9AC0,A0

MOV3Q #2,D0

BCLR D0(A0,D0.L*4)

 

D0 is used as both the bit to be cleared and the array index. It should use D7 as the index.

 

The V6.1 compiler produces much worse code but at least it is correct.

CLR.L D0

MOVE.B D7,D0

LEA 0xFFFF9AC0,A0

LEA (A0,D0.L*4),A0

MVZ.B (A0),D0

BCLR #2,D0

MOVE.B D0,(A0)

 

 

 

 

 

 

0 Kudos