MK66 Cannot start USB CDC with SerialManager

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

MK66 Cannot start USB CDC with SerialManager

590 Views
Axent
Contributor II

Hello everyone. I relocated from STM32 to NXP MCUs. Currently I use MK66 series and try to launch USB CDC class devise using SerialManager. I use MCUexpresso IDE.
I set all needed clocks (and for usb):
CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcIrc48M, SIM_USB_CLK_48000000HZ);

I am also pinned necessary pins for DP and DM signals in Pin Tool.
In my function I use code:

 

static uint8_t s_serialHandleBuffer[SERIAL_MANAGER_HANDLE_SIZE];
static serial_handle_t s_serialHandle = &s_serialHandleBuffer[0];
static uint8_t s_ringBuffer[SERIAL_MANAGER_RING_BUFFER_SIZE];
serial_manager_config_t config;
serial_port_usb_cdc_config_t usbCdcConfig;
usbCdcConfig.controllerIndex = kSerialManager_UsbControllerKhci0;
config.type = kSerialPort_UsbCdc;
config.ringBuffer = &s_ringBuffer[0];
config.ringBufferSize = SERIAL_MANAGER_RING_BUFFER_SIZE;
config.portConfig = &usbCdcConfig;
SerialManager_Init(s_serialHandle, &config);

 


SerialManager_Init() returns with OK.
When I plug the cable to PC< Windows shows the message (USB device not recognized) Error 43: Descriptor request fail.
I found the same issue in forum :
https://community.nxp.com/t5/K32-L-Series-Microcontrollers/quot-USB-CDC-quot-does-not-work-on-K32L2B... 

But no any replies to it. I figured out that MCU doesn't process callbacks at PC requests (events like Reset, getDescriptors and other. Briefly enumeration I mean)

Can you help me? Maybe I forgot something detail in my implementation??
Thanks.


0 Kudos
Reply
2 Replies

587 Views
Axent
Contributor II

I figured out that I added FreeRTOS support in my project.
But if I switch to BareMetal, my code statrs work fine.
How can I implement this with FreeRTOS? Thanks

0 Kudos
Reply

558 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @Axent ,

I made a demo. It can PRINTF in APPtask. You can take a look.

 

Regards,

Jing

0 Kudos
Reply