USB-FS drivers for K32L2B

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

USB-FS drivers for K32L2B

2,586 Views
aberger
Contributor V

I am beginning to play with a FRDM-K32L2B3 development board and would like to explore the USB-FS module that is included with the K32. The K32 has two dedicated pins for USB_DP and USB_DM. My ultimate goal is to implement serial communications over the USB interface, but I would like to make use of those dedicated pins. Can you point me to any useful resources for trying to achieve this?

I couldn't find any demos or examples in the FRDM-K32L2B 2.12.0 SDK for the USB module. I also haven't been able to find any Application Notes describing implementation of a USB-to-serial functionality. 

0 Kudos
5 Replies

2,007 Views
bobpaddock
Senior Contributor III

I know this thread is old.

Wanted to mention that TinyUSB now supports the K32L2B3.

I'm working on adding support for K32L2A now.

https://www.tinyusb.org

 

0 Kudos

2,561 Views
jh0
Contributor IV

Hi,

All USB examples are inside SDK. There is hello_world_virtual_com demo, that will send by CDC to PC hello world message.

0 Kudos

2,557 Views
aberger
Contributor V

Thank you for this suggestion. Can you point me to which SDK you are referring. I can't find hello_world_virtual_com in the FRDM-K32L2B 2.12.0 SDK. Thank you.

0 Kudos

2,538 Views
jh0
Contributor IV

SDK_FRDM-K32L2B.zip\boards\frdmk32l2b\demo_apps\hello_world_virtual_com

0 Kudos

2,463 Views
aberger
Contributor V

Thanks @jh0. I found the hello_world_virtual_com demo. Unfortunately, I can't get communication working over the COM port that is enumerated in Windows Device Manager when I run the demo on the FRDM-K32L2B3 dev board. 

The hello_world.c source code executes the following line

DbgConsole_Init((uint8_t)kSerialManager_UsbControllerKhci0, (uint32_t)NULL, kSerialPort_UsbCdc, (uint32_t)NULL);

 The function prototype for this function is:

status_t DbgConsole_Init(uint8_t instance, uint32_t baudRate, serial_port_type_t device, uint32_t clkSrcFreq)

So it seems that the baudRate and clkSrcFreq aren't being properly configured. However, I've tried supplying 115200 and 48000000, respectively, but that also doesn't solve things.

The code execution appears to get stuck at

DEBUG_CONSOLE_TAKE_BINARY_SEMAPHORE_BLOCKING(s_debugConsoleReadWaitSemaphore);

which is executed by 

status_t DbgConsole_ReadOneCharacter(uint8_t *ch)

 which is part of the fsl_debug_console.c module.

0 Kudos