Hello,

Should have said this is the FRDM-K64F board, freedom-k64f configuration.

Kind regards

Stewart

On 14/02/2021 09:37, nu...@charnell.plus.com wrote:
Hello,

I would like to setup a Kinetis k64f as a USB host to communicate with a USB serial device. As there is not a configuration for USB host with the k64f I thought I would start by configuring the k64f as a USB device, but have not been able to produce a working (visible USB device on K64 USB interface) setup yet.

I wonder if anyone has used the USB interface on the Kinetis k64f, or the Kinetis k28, or might have some tips on how to debug?

The k64f has two modes of USB clocking, derived from PLL clock or IRC48 clock sync'd to incoming USB data. I started by using clocking derived from PLL.

I have modified a number of source files based on the Kinetis k28, which has a configuration for usbnsh:

nuttx/boards/arm/kinetis/freedom-k64f/include/board.h based on freedom-k28 board.h. Modified to set MCG Frequency (PLLOUT) to 96 MHz and included settings for USB clocks. nuttx/boards/arm/kinetis/freedom-k64f/src/k64_usbdev.c. Added DP Pullup in non-OTG device mode, based on k28_usbdev.c, and k64_usbinitialize routine. Pull-up functioning (measured with multimeter). nuttx/boards/arm/kinetis/freedom-k64f/src/k64_bringup.c - Added call to k64_usbinitialize & CONFIG_PL2303

nsh is working over SDA USB interface (the Kinetis k64f board programming and debug interface, via a K20DX device, separate from the K64 USB interface connected directly to the k64f device). I also have Ethernet (nsh via telnet) functioning.

I have built the PL2303 & CDCACM apps, neither produce a usb device visible from Linux laptop

Output of dmesg (PL2303 app with some USB debug enabled)
nsh> dmesg
__start: Reset status: 00:00
khci_hwinitialize: BDT Address 0
khci_hwinitialize: BDTPAGE3 1f
khci_hwinitialize: BDTPAGE2 ff
khci_hwinitialize: BDTPAGE1 46
Mounting procfs to /proc
Successfully bound SDHC to the MMC/SD driver
kinetis_usbsuspend: resume: 1

Output of journalctl on linux PC connected via USB hub to K64 USB interface

Feb 13 10:18:21 stewart-Inspiron-5559 kernel: usb 1-2.4: new full-speed USB device number 124 using xhci_hcd Feb 13 10:18:21 stewart-Inspiron-5559 kernel: usb 1-2.4: device descriptor read/64, error -32 Feb 13 10:18:21 stewart-Inspiron-5559 kernel: usb 1-2.4: device descriptor read/64, error -32 Feb 13 10:18:22 stewart-Inspiron-5559 kernel: usb 1-2.4: new full-speed USB device number 125 using xhci_hcd Feb 13 10:18:22 stewart-Inspiron-5559 kernel: usb 1-2.4: device descriptor read/64, error -32 Feb 13 10:18:22 stewart-Inspiron-5559 kernel: usb 1-2.4: device descriptor read/64, error -32 Feb 13 10:18:22 stewart-Inspiron-5559 kernel: usb 1-2-port4: attempt power cycle Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: new full-speed USB device number 126 using xhci_hcd Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: Device not responding to setup address. Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: Device not responding to setup address. Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: device not accepting address 126, error -71 Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: new full-speed USB device number 127 using xhci_hcd Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: Device not responding to setup address. Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: Device not responding to setup address. Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2.4: device not accepting address 127, error -71 Feb 13 10:18:23 stewart-Inspiron-5559 kernel: usb 1-2-port4: unable to enumerate USB device


Kind regards

Stewart Charnell


Reply via email to