Kinetis K22 USB CDC in C++ Project

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

Kinetis K22 USB CDC in C++ Project

866件の閲覧回数
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.

タグ(3)
0 件の賞賛
2 返答(返信)

833件の閲覧回数
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 件の賞賛

828件の閲覧回数
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 件の賞賛