MCF54415 USB Host

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

MCF54415 USB Host

1,670 Views
nitinkothari
Contributor II

Hello Geeks,

We have a system using MCF54415 and I am intending to use the USB OTG port as Host.

We took the Tower example project for USB Host. But as the Tower board does not use OTG port for USB Host, I need to make some changes.

I made the following changes in twrmcf54418.h :

    1. Commented       // #define USBCFG_USBOTG_CONNECTOR                         USBCFG_CONNECTOR_ULPI.
    2. Added                    #define USBCFG_USBOTG_CONNECTOR                         USBCFG_CONNECTOR_STANDARD
    3. Commented       // #define USBCFG_DEFAULT_HOST_CONTROLLER            (&_bsp_usb_host_ehci1_if)
    4. Added                   #define USBCFG_DEFAULT_HOST_CONTROLLER            (&_bsp_usb_host_ehci0_if)
    5. Commented       // #define USBCFG_EHCI                                                          1
    6. Added                   #define USBCFG_EHCI                                                          0

I have tested it and it is not working (that is why I am here :smileyhappy: ).

So all the brainies out there, please help me fixing the issue. Please let me know what and where more changes are to be made.

Regards,

Nitro

Labels (1)
0 Kudos
11 Replies

1,152 Views
nitinkothari
Contributor II

Hi Folks,

I tried to configure the OTG registers to act as a Host.  To achieve this, I had changed the reference to structure USBHOST to USBOTG.

But I am still not able to get any activity on the ports.

Below is the current status of the registers :

 

Register NameValue
USB_OTG_ID0xe241fa05
USB_OTG_HWGENERAL0x000007c5
USB_OTG_HWHOST0x10020001
HWDEVICE0x00000009
USB_OTG_HWTXBUF0x80040604
USB_OTG_HWRXBUF0x00000404
GPTIMER0LD0x00000000
GPTIMER0CTL0x00000000
GPTIMER1LD0x00000000
GPTIMER1CTL0x00000000
USB_OTG_HCIVERSION0x0100
USB_OTG_CAPLENGTH0x40
USB_OTG_HCSPARAMS0x00010011
USB_OTG_HCCPARAMS0x00000006
DCIVERSION0x0000
DCCPARAMS0x00000184
USB_OTG_USBCMD0x00010001
USB_OTG_USBSTS0x00000088
USB_OTG_USBINTR0x00000037
USB_OTG_FRINDEX0x00003490
DEVICEADDR0x00000000
USB_OTG_PERIODICLISTBASE0x00000000
USB_OTG_ASYNCLISTADDR0x00000000
EPLISTADDR0x00000000
USB_OTG_TTCTRL0x00000000
USB_OTG_BURSTSIZE0x00001010
USB_OTG_TXFILLTUNING0x00020000
ULPI_VIEWPORT0x08000000
USB_OTG_CONFIGFLAG0x00000001
USB_OTG_PORTSC10xed001c00
OTGSC0x00203020
USB_OTG_USBMODE0x00000007
EPSETUPSR0x00000000
EPPRIME0x00000000
EPFLUSH0x00000000
EPSR0x00000000
EPCOMPLETE0x00000000
EPCR00x00800080
EPCR10x00000000
EPCR20x00000000
EPCR30x00000000
CCR0x527f
RCON0x1259
CIR0x2802
MISCCR0x2f7c
CDRH0x0101
CDRL0x0000
UOCSR0x3810
UHCSR0x0000
MISCCR30x0000
MISCCR20xa89f
ADCTSR0x0000
DACTSR0x0000
FNACR0x00000000

  

Can anyone please point out what am I missing ?

Also, is it even possible to implement a Host on OTG port without ULPI interface ?

Regards,

Nitro

0 Kudos

1,152 Views
nitinkothari
Contributor II

Anyone out there ?

0 Kudos

1,152 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Nitin,

I checked with me experts. It is nos possible to recreate the scenario with our boards. Otherwise we were already able to solve the issue. Having taking a look to your board in our labs is unfortunately not par of our scope as free support for MQX. I am really sorry but it would be necessary to recommend the Level 2 support for MQX. This kind of support is included with this level. For more details you can check this link: Freescale MQX™ Support|Freescale

I am sorry for the inconvenience this may cause you.

Best Regards,

Garabo

0 Kudos

1,152 Views
nitinkothari
Contributor II

Hi Garabo,

Sorry but we cannot afford the Level 2 support.

So I am on my own to get this fixed.

In the pursuit, I have succeeded in getting the Host send SETUP packets.

ECU.png

So, as you can see, there is also SE1 condition between two packets.

Can anyone help me now ?

Thanks !

0 Kudos

1,152 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Nitin,

Let me ask my experts to review and suggest you solutions.

Regards,

Garabo

0 Kudos

1,152 Views
nitinkothari
Contributor II

Hi Garabo,

I appreciate your efforts. It seems that I have fixed the issue and the port is communicating now.

But the MFS is giving me error : MFS_NOT_A_DOS_DISK. Shall I create a new thread for this issue ?

Thanks,

Nitro

0 Kudos

1,152 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Nitin,

Congratulations for solving the problem!

Yes, please help us to create a new thread. If you can add source code or example project that help us to recreate the problem please add it. In advance I can tell you that a FAT16 or FAT32 formatting usually solves this issue.

Regards,

Garabo

1,152 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Nitin,

I am afraid that USB OTG is not supported in MQX. What is the purpose of your application to use OTG? Sometimes it is confused the USB OTG with USB as device and later USB as Host. If that is your case then what you need is to use a jumper or switch that tells your device when to act as Host or Device.

Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,152 Views
nitinkothari
Contributor II

Hi Garabo,

My bad. I did not explain it properly. I am using the USBOTG port as USB Host.

So, I tried with the changes mentioned above but it is not working. Please help me find out what am I missing.

Regards,

Nitro

0 Kudos

1,152 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Nitro,

Just some supplement to Garabo's comment. The MQX's USB stack doesn't support OTG opertaion, but you can use the OTG module on MCF54418 as a dule role USB port. With the following modification, you may get it work as a Host port . I just run the msd command demo on TWR-MCF54418 with TWR-SER2, you may try it as well.

1.png

2.png

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,152 Views
nitinkothari
Contributor II

Hi Kan,

Thanks for your time.

I tried with the changes you had mentioned. But the BSP settings mentioned above are not applicable to my setup, hence it did not work. :smileysad:

In my system, there is no ULPI interfaces. I am trying to use the OTG port directly to act as a host.

Kindly see the diagram of my setup.

Nitro.jpg

Please let me know what else shall I change.

Thank you again.

Nitro

0 Kudos