USB MSD host on TWR-K65F180M

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB MSD host on TWR-K65F180M

ソリューションへジャンプ
1,118件の閲覧回数
acampbell
Contributor II

I have a TWR-K65F180M, and I am trying to run a variation of the usbdisk demo (USB host for a mass storage device, e.g. thumb drive). However, I don't get anything out of the microUSB port (J15).

I am guessing the issue is that the microUSB port is not supplying power to peripherals. (When I plug in a basic USB laser mouse, the laser doesn't turn on.) There is a jumper (J13) for enabling/disabling power to the microUSB, but I do have it set.

Is there some other jumper configuration that I need to change to use the microUSB in host mode?

Currently I have all the jumpers in the default positions except J9 has both 3-4 and 5-6. I've tried varying some of the ones related to the microUSB port, but without any success.

ラベル(1)
0 件の賞賛
返信
1 解決策
833件の閲覧回数
lepol
NXP Employee
NXP Employee

Hello Aaron,

please, can you check which version of board you use and also whether you use USB high speed or full speed in project?

By default, you need to enable power by shorting J13 1-2 and power is provided by digital pin, usually PTD8 (which must be set to logical 1 in project). Could you also measure whether power is provided at USB micro or J13? Could you also insert a breakpoint to a function usb_host_dev_mng_check_configuration attach a device and see what happen?

Best regards,
Lenka Polaskova

元の投稿で解決策を見る

5 返答(返信)
833件の閲覧回数
mjbcswitzerland
Specialist V

Hi

J36(2-3) as default

J13(1-1) as default

Control PTD8 to '1' in code when needed to supply power to the USB output.

Regards

Mark

833件の閲覧回数
paulb-sct
Contributor III

Note that the 'readme' file included with the example project usb_host_msd_fatfs (as generated by SDK 2.0) is INCORRECT, at least for USB-HS. It lists incorrect jumper settings. I changed the jumpers to what was stated in the readme file ("J13 1-2, J9 7-8, Remove all jumpers from J23.") and could not even start a debug session. So, keep the jumpers as default:

J13

1-2

J9

5-6

J23

1-2 & 3-4

J36

2-3

And in the code you need to explicitly disable the KHCI build and enable the EHCI build, this is done in usb_host_config.h.

As for the earlier reply, I could not find the function usb_host_dev_mng_check_configuration().

0 件の賞賛
返信
833件の閲覧回数
lepol
NXP Employee
NXP Employee

I had this issue to, I assume that debug session is halted because when disconnecting all J23 jumpers (regulator inputs) the USB regulator output voltage is not provided. J9 7-8 source the regulator output to MCU. So with this connection scheme there is no power for MCU!. You can connect J23 1-2 or 3-4 and J9 7-8 when you want to power the mcu only from USB and not from external sources.
And at last I'm sorry for the wrong function name. That applies for SDK 1.0. For SDK 2.0 it may be equivalent if a function USB_HostInit return success.

Best regards

Lenka Polaskova

0 件の賞賛
返信
834件の閲覧回数
lepol
NXP Employee
NXP Employee

Hello Aaron,

please, can you check which version of board you use and also whether you use USB high speed or full speed in project?

By default, you need to enable power by shorting J13 1-2 and power is provided by digital pin, usually PTD8 (which must be set to logical 1 in project). Could you also measure whether power is provided at USB micro or J13? Could you also insert a breakpoint to a function usb_host_dev_mng_check_configuration attach a device and see what happen?

Best regards,
Lenka Polaskova

833件の閲覧回数
acampbell
Contributor II

I'm not entirely sure what the version of the board is; on the back it says 700-28036 REV A, SCH-28036 REV D, (c) 2015 Freescale.

Ok, it looks like usb_host_board_init sets PTD8. However, it only does so for EHCI (high speed), and I was using KHCI (full speed).

    /*"0" stands for USB_CONTROLLER_KHCI_0 */

    if (0 == controller_id)

    {

    }

    /*"2" stands for USB_CONTROLLER_EHCI_0 */

    else if (2 ==controller_id)

    {

         /*configure the id pin */

        /* Enable clock gating to all ports E*/

        CLOCK_SYS_EnablePortClock(4);

        PORT_HAL_SetMuxMode(PORTE,10UL,kPortMuxAlt7);

        PORT_HAL_SetPullMode(PORTE,10UL,kPortPullUp);

        PORT_HAL_SetPullCmd(PORTE,10UL,true);

        /* Source the Ubus. Set PTD8 to high */

        /* Enable clock gating to all ports D*/

        CLOCK_SYS_EnablePortClock(3);

        GPIO_DRV_Init(NULL, usbvbushostenablePin);

        GPIO_DRV_WritePinOutput(kGpioUsbVbus, 1);

    }

    else

Once I started using USB_CONTROLLER_EHCI_0, it turns on the USB power and works correctly.

0 件の賞賛
返信