CMX USB Stack - MC51JM128

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

CMX USB Stack - MC51JM128

935 Views
fsprogrammer
Contributor I

I have been trying to compile and use the CMX USB generic device on the MC51JM128 demojm board.   I simply recompile the software switching the target to to JM processors.   The code always fails after running  usb_init();  in main.    I get a windows message saying the device device not recognized.   The code is hung in an an endless loop at the while in the location below:

 

static void disable_ep_tx(hcc_u8 ep)
{
   MCF_USB_ENDPT(ep) &= ~MCF_USB_ENDPT_EP_TX_EN;
  while(MCF_USB_ENDPT(ep) & MCF_USB_ENDPT_EP_TX_EN) {
    ;
  WR_LE32(&BDT_CTL_TX(ep, 0), 0);
  WR_LE32(&BDT_CTL_TX(ep, 1), 0);
}

 

Has anyone seen this and can give me some advice on where to look ?  The code seems to compile OK.  Is there anything else other than change the target that I need to do ?

 

I have verified everything is working fine on the PC by switching back to the other board and run the sample generic USB app there and that initializes fine and runs fine.

Labels (1)
0 Kudos
2 Replies

352 Views
pecha72
Contributor I

i have the same problem,  my test program hangs in the same point (while instruciton), if you have the solution please reply this message ,thanks in advance.

0 Kudos

352 Views
pecha72
Contributor I

 

here i have the solution in disable_ep_tx............

 

hcc_u8 parche; 

 

// the following sentence by this way dosent compile correctly almost under code warrior 5.9

// MCF_USB_ENDPT(ep) &= ~MCF_USB_ENDPT_EP_TX_EN;

 

parche = MCF_USB_ENDPT(ep); 
parche &= ~MCF_USB_ENDPT_EP_TX_EN;
MCF_USB_ENDPT(ep) = parche; 

while(MCF_USB_ENDPT(ep) & MCF_USB_ENDPT_EP_TX_EN)
;
WR_LE32(&BDT_CTL_TX(ep, 0), 0);
WR_LE32(&BDT_CTL_TX(ep, 1), 0);

 

 

0 Kudos