MIMXRT1060/1064 HOST CDC SDK Example Looped to Device Side Never Yielding

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

MIMXRT1060/1064 HOST CDC SDK Example Looped to Device Side Never Yielding

Jump to solution
400 Views
Avillalba
Contributor II

I have one main application which calls both the Host CDC task and the Device CDC task, the host side has minimal changes from the example evkmimxrt1064_host_cdc_freertos and the device side parses strings for API commands. I have the host working on USB OTG2 and the device is on USB OTG1. I am able to see that the host task enumerates correctly and I can type with my characters being echoed back through teraterm but the device side never kicks in and interprets my commands. I attempted to add a vTaskDelay to allow other tasks to run but then I no longer get echos back from my characters typed. Is there another way I would have to force the Host task to yield or is the example not sending the characters to the correct VCOM on the device side?

Labels (1)
0 Kudos
1 Solution
197 Views
Avillalba
Contributor II

hi @Kan_Li I think the question I had was fixed, I wanted to know if i could ignore the UART completely and send characters over the USB stack and through trial and error i found a pathway that worked. I ended creating a buffer for the characters so I could send them over the stack and then echo the result that came in through the USB stack from the device.

View solution in original post

0 Kudos
7 Replies
322 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @Avillalba ,

 

Maybe you can consider to integrate the Shell demo with the USB Device CDC demo as the serial manager also support USB CDC, so that the Shell may accept the commands sent via the USB CDC port.

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
312 Views
Avillalba
Contributor II

hi @Kan_Li I would like to get a working host cdc example that can talk to the device side cdc meaning send commands via terminal tool such as tera term, at the moment i see that the host cdc sends the messages to the device but the device never gets a chance to interpret it even if the characters are echoed back on the terminal. The main issue seems to be that when i add a delay to the cdc task it simply stops running and the host side does not receive any input from the device side since it never runs either. can you offer any insight into this?

0 Kudos
270 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @Avillalba ,

 

If only the device CDC task is running on RT1064,can it work properly?

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
260 Views
Avillalba
Contributor II

hi @Kan_Li I was able to get my use case working at about 70% efficiency by decreasing the USB_HOST_UART_RECV_TIMEOUT_THRSHOLD to (5 / portTICK_PERIOD_MS) which allowed the uart buffer to dump data more frequently to the device side. I have ran into a different issue of this not outputting the full string that its supposed to receive. Is it possible to modify the host example to ignore the Uart and simply get a command string from a terminal tool then send it to the device and echo the output from the device back to the terminal as well?

0 Kudos
253 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @Avillalba ,

 

I believe UART is just the channel between the host example and a terminal tool, if you want to ignore it, how to get a command string from the terminal tool? Do you mean switching to some channel else?

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
198 Views
Avillalba
Contributor II

hi @Kan_Li I think the question I had was fixed, I wanted to know if i could ignore the UART completely and send characters over the USB stack and through trial and error i found a pathway that worked. I ended creating a buffer for the characters so I could send them over the stack and then echo the result that came in through the USB stack from the device.

0 Kudos
180 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @Avillalba ,

 

UART is just a channel used to receive from/echo back to the human , but if you use another channel instead, of course you may ignore UART. 

 

Hope that makes sense,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------