MQX & MCF54418 - USB problem

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

MQX & MCF54418 - USB problem

901 Views
amprel
Contributor I

Hello everybody,

We have developed a board based on a ColdFire MCF54418 (the board is quite similar to the TWR-MCF54418) and we are running some MQX examples to test the board’s peripherals (we are using MQX 3.8.1 and CodeWarrior Classic 7.2). In particular, we have are trying to test the USB I/F, which on our board is just a USB device (the chosen example is the virtual COM port one). The problem is that the code crashes when, in the routine _usb_dci_usbhs_chip_initialize() (in ehci_dev_main.c, the following instruction is executed:

/*--- Intial Configuration ---*/

/* Initialize the endpoint 0 properties */

EHCI_REG_WRITE(dev_ptr->REGISTERS.OPERATIONAL_DEVICE_REGISTERS.ENDPTCTRLX[0], (EHCI_EPCTRL_TX_DATA_TOGGLE_RST | EHCI_EPCTRL_RX_DATA_TOGGLE_RST));

The problem is, the EHCI_EPCTRL_TX_DATA_TOGGLE_RST (bit 22) and EHCI_EPCTRL_RX_DATA_TOGGLE_RST (bit 6) belong to the Endpoint Control Register 1, not 0 (see MCF54418RM, page 24-44 and 24-45). Instead, in the Endpoint Control Register 0 those bits are reserved and must be cleared, so this would explain the crash (we have verified with the P&E BDM that it is actually the Endpoint Control Register 0 that gets written to).

Two questions:

1) Has anyone tried an MQX USB device example on the TWR-MCF54418 (unfortunately we don’t have this EVB, so we can’t check)?

2) Does anyone have some working USB device code for the MCF54418 or know how to fix the one provided with MQX?

Thank you in advance for your help!

Alessandro

Labels (1)
0 Kudos
5 Replies

535 Views
plim
Contributor I

Hi Alessandro,

You might want to check your USB clock.  I just had the same issue with a crash at the same point.  I'm using the on-chip transceiver for the USB device.  After I enabled the 60 MHz clock for the on-chip transceiver in the BSP it got past this line of code without crashing.  I've still got some work to do though in getting it to enumerate...not seeing the DP line go high. 

Best regards,

Kurt

0 Kudos

535 Views
t_k
Contributor II

Hi Kurt,

Did you enable the pull-up for FS/LS detect in the MISCCR register?

We also found that the #define for MCF54XX_CCM_MISCCR_USBPUE was incorrectly set to 0x04 when it should be 0x02

I hope this helps,

Travis

0 Kudos

535 Views
plim
Contributor I

Hello Travis,

I just did what you suggested and I was able to enumerate and run the USB device application.

Thank you very much!

Best regards,

Kurt

0 Kudos

535 Views
t_k
Contributor II

Hi Alessandro,

I'm also using the MCF54418 and getting intermittent errors.  Sometimes it refuses to connect on first try, and other times it will run for half an hour without problems.   Unfortunately I haven't had time yet to dig into the code to find out where my problem lies.  

Hopefully whatever you figure out will help me as well.

Thanks,

Travis

0 Kudos

535 Views
DavidS
NXP Employee
NXP Employee

Hi Alessandro,

I'm using MQX4.0 and CW10.3 and just tried the virtual com usb device project successfully for twrmcf54418 Tower kit.

I don't see anything in the MQX4.0 release notes to indicate that any fixes were specifically applied.

Regards,

David

0 Kudos