merge usb cdc host and device

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

merge usb cdc host and device

867 次查看
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 项奖励
回复
1 回复

728 次查看
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 项奖励
回复