Hi,

I am currently trying to receive data that is sent through the console to the XDK via USB. What I am looking for is a functionality similar to SER_serialRead(...). At the moment I already was tried USB_receiveByte, getchar and getc(stdin). None of them delivered me any output when sending something to the XDK. USB_receiveByte even blocked and locked the whole XDK for any other uses.
I just want to receive byte by byte the characters I send to the XDK via a serial Console/Terminal.
Can you help me with this?

Kind regards,

Kai Liebich
0 (0 Votes)
Receive data from USB (virtual COM port)
Answer
12/5/15 3:13 PM as a reply to Kai Clemens Liebich.
Hi Kai,

did you already try the URU (USB Reset Utility) module? It allows you to register a callback for usb requests:

URU_return_t URU_registerApplicationISR(URU_usbAppCallback uruAppCallback)

For a usage example, please refer to the USB_com_cc.c source file in the XDK Sensor Montior Demo. I think it accomplishes the task you describe.

Please let me know whether this information was helpful.

Kind regards,
Manuel

 

0 (0 Votes)
Receive data from USB (virtual COM port)
Answer
12/7/15 4:44 AM as a reply to Manuel Cerny.
Thank you! This is exactly what I needed.

I hade one strange occurence when trying to implement this code: When I included the URU_usbResetUtility_ih.h my XDK stopped working at all and didn't produce any output anymore. After commenting out some lines of code and stepwise enabling them again, I got the program running again without changing anything... Now it is working fine. I also can't reproduce this behaviour.
0 (0 Votes)
Receive data from USB (virtual COM port)
Answer
12/7/15 12:45 PM as a reply to Kai Clemens Liebich.
Hi Kai,

I'm glad I could help you.
The issue you had was probably not related to the URU module but a XDK startup problem. Every once in a while the device hangs on startup and needs another reboot to work again.

Kind regards,
Manuel
0 (0 Votes)
RE: Receive data from USB (virtual COM port)
Answer
10/31/16 8:41 PM as a reply to Manuel Cerny.
Hi, I would like to know how running USB_cc.c please, I try to send data in console. 
0 (0 Votes)
RE: Receive data from USB (virtual COM port)
Answer
11/2/16 12:57 PM as a reply to Nabila Padilla.

Hello Nabila,

welcome to the XDK community. I will try my best to help you but I require more information to give you a more specific answer about what you are going to implement. In general you can use the printf() function to send data from the XDK to the Workbench console.

Kind regards,
Franjo

0 (0 Votes)