USB CDC with MQX and C++

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

USB CDC with MQX and C++

1,015 Views
louiemoye
Contributor III

Hello,

I recently created a MQX 4.1 project, and used the C++ demo app to start a new C++ project with MQX.  In another proejct, I created MQX 4.1 with USB Device CDC support.  Now I'm trying to combine the two project to create MQX 4.1, written in C++ and include USB CDC Support.  I copied example code from the USB CDC project, and I added paths to my BSP/USB directory (${MQX_ROOT_DIR}/lib/ArubaBSP.cw10gcc/debug/usb), into the Project/Properties/C/C++ General/Includes tab for all languages.  I also added the classic extern "C" around my header includes usb_descriptor.h, and around usb_class.h, and usb_cdc.h.  However, I continue to get these linker errors:

undefined reference to `USB_Class_CDC_Recv_Data'

I get the same errors with each of the USB_Class_CDC_xxx functions I attempt to use. 

Any suggestions on how to resolve this?

BTW I'm using Codewarrior 10.6, and gcc

Regards

0 Kudos
11 Replies

762 Views
trytohelp
NXP Employee
NXP Employee

Hi,

What is the processor used ?

The 2 projects were created with same MQX version ?

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

762 Views
louiemoye
Contributor III

Yes, they were created with the same MQX 4.1.  I have a custom BSP cloned from TWR70F120M BSP.  The processor is the K70.  I even have the two project imported into the same workspace. 

Thanks

0 Kudos

762 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Thanks for Info.

I need to perform some tests on my side.

Keep you informed.


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

762 Views
louiemoye
Contributor III

Great, thanks.  Just curious - would it be easier to convert my C project to a C++ project?  What would it take to do that? 

0 Kudos

762 Views
trytohelp
NXP Employee
NXP Employee

Hum

I've problem with CPP project.

Pascal

0 Kudos

762 Views
louiemoye
Contributor III

Are you having the same undefined externals for CDC library calls?  Also, what about converting C to CPP project?

Thanks

0 Kudos

762 Views
trytohelp
NXP Employee
NXP Employee

Hi,

The question is probably too MQX specific.

I will re-direct the question to MQX team.

Pascal

0 Kudos

762 Views
louiemoye
Contributor III

I was able to resolve this issue.  I had to add more references and paths to the tool setting.  Specifically, Project\Properties\C/C++ Build\Settings\ToolSettings and then under all four tools for Arm Ltd Windows GCC [Assembler, C++ Compiler, C++Linker, and C++ Preprocessor], added this to the directory include paths:

"${MQX_ROOT_DIR}/lib/MyBSP.cw10gcc/debug/usb"

In the same setting area I added to Arm Ltd Windows GCC C++ Linker/Miscellaneous/Other Objects:

"${MQX_ROOT_DIR}/lib/MyBSP.cw10gcc/debug/bsp/bsp.a"

And to Arm Ltd Windows GCC C++ Linker/Miscellaneous/Linker Flags:

--start-group "${MQX_ROOT_DIR}/lib/MyBSP.cw10gcc/debug/bsp/usbd.a" -Xlinker --end-group

Then of course I added to the Project\Properties\C/C++ General\Paths and Includes\Includes (for all languages):

${MQX_ROOT_DIR}/lib/MyBSP.cw10gcc/debug/usb

MyBSP is the name of my custom cloned BSP.

0 Kudos

762 Views
louiemoye
Contributor III

Pascal - what is the status on getting the MQX team involved?  This issue is getting super critical as it is now holding up my progress forward.  I'm on a development team of many engineers,  and leading the embedded software development portion; consquently, this is holding up progress on the entire project.  I have opened support cases with Freescale on other issues, but I seem to get faster responses on the forum.  If there is a better/faster way to get support on super critical issues, please let me know how I can proceed.

Regards,

Louie

0 Kudos

762 Views
trytohelp
NXP Employee
NXP Employee

Hi Louie,

Good to know that you've solved the problem and sorry for your community experience regarding this problem.

Probably I lost too much times trying to reproduce and investigate the problem on my side before to move it to MQX team.

What is the better way between SR# and community ?

I don't know how all Freescale support teams are working but the same engineers are working on community and SR#.

I don't know if there is a faster way.

May be this depends of the question.

More people have access to community whereas the SR# is dedicated to Freescale support team.

I think the community is working fine for sample question whereas the SR# is may be better for complex question.

For instance if we need to investigate the problem with an example on directly on your project.

This is the better way on our side for tracking issue - if we contact the development team to have info or to report a bug for instance.

Now for critical question I think the better way should be by contacting the support.

You can contact us via live chat too which is very similar and probably better than a call.

Have a look to

    Sales and Support|Freescale

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

762 Views
louiemoye
Contributor III

OK, thanks. 

0 Kudos