merge usb cdc host and device

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

merge usb cdc host and device

518 Views
jihsianglum
Contributor I

To whom it may concern,

I am attempting to develop an application for the FRDMKL82Z board which requires it to act as a cdc host some times and a cdc device at others.  I have gotten the demos to execute successfully and have been able to modify them for my purposes.  I now need to merge both code bases - I think I understand how to get FreeRTOS to switch one side on at a time but am having lots of linker problems if I just try to copy and paste one into the other.  I tried to follow the instructions as per https://community.nxp.com/thread/437502 but I ended up with lots of broken includes even though I have pointed the linker at the correct directory (I basically copied the entire vcom device directory into a special directory in the host project and pointed the linker at that).  Is there something I am missing?  I am somewhat out of practice coding - haven't done it for 20 years so there may be something obvious I am missing. 

I am using SDK 2.2 and KDS 3.2.  

Thanks

0 Kudos
Reply
1 Reply

379 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

First I would you read the the MCUXpresso SDK USB Stack User's Guide.

Section 4.1 Developing a New USB Device Application.

Section 4.2 Developing a New USB Host Application.

From software perspective, if  you use host cdc as a starting point , see below picture, you need to copy device stack to the usb folder, copy the device cdc source files to the sources folder. Next you need to merge main function. Maybe you need at least 2 tasks, one is for cdc host, one is for cdc device. and start the relative task when needed.  Maybe need lots of time to fix some compile errors.

pastedImage_1.png

Regards

Daniel

0 Kudos
Reply