Kinetis K22 USB CDC in C++ Project

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

Kinetis K22 USB CDC in C++ Project

848 Views
kwebster83
Contributor II

I'm trying to get the Freescale USB Stack working in a C++ project however I'm running into issues whereby the device descriptor requests are failing - i.e. no descriptors are being sent from my device.

I have a fully-working C project which used Processor Expert to generate the USB CDC interface and this works fine when built as a C project.

Having moved the existing code over to my C++ project, everything seems fine (initialization, clocks, interrupts, etc are all configured) and the USB_ISR is being entered for the SLEEP, RESET and SOF states but nothing more.

I've taken the existing USB stack files as they are and imported them straight into my project. I've added an `extern "C"` around the USB interrupt function prototype and all compiles without issue. The only thing I can assume is that there are some structure sizes which may be different sizes due to missed preprocessor definitions, etc but I've gone through the code many times and nothing stands out.

I'm at a loss as to where else I could even begin to start with this. I foolishly assumed it would be simple.

Any pointers or hints would be greatly appreciated.

Tags (3)
0 Kudos
2 Replies

815 Views
nxf77486
NXP TechSupport
NXP TechSupport

 

Hello @kwebster83 ,

Thank you for your time and for contacting NXP support.

We have and SDK for the K22, but unfortunately we do not have any support for the USB with C++ is just supported by the project C configuration. We apologize in advance for the inconvenient this might cause. Please let me know if you have any other question.

0 Kudos

810 Views
kwebster83
Contributor II

Thanks for your reply.

Thankfully, I've managed to get this working and I've wrapped the USB/CDC code up in a C++ class.

0 Kudos