EmbDev.net

Forum: ARM programming with GCC/GNU tools Help with BasicUSB demo application please


von jdupre (Guest)


Rate this post
useful
not useful
I've got Martin Thomas' BasicUSB demo working in "mode 1", where data on
the SAM7S UART is passed over USB to a "virtual" COM port on the host
and vice versa.

I'm trying to send characters to the virtual COM port independant of the
SAM7 UART (in order to use the virtual port as a debug interface).  That
is, I just need a "virtual_printk()" function that outputs a string over
USB to the virtual COM port.

I thought I could just use the pCDC.Write() function, but this only
outputs the string when characters are typed in at a terminal connected
to the virtual port. There is something going on with the interupts that
I don't understand.

Can someone please tell me what is preventing the data from being
written directly to the virtal COM port?

Thanks,  - Joe

while (1)
   {
  // Check enumeration
  if (pCDC.IsConfigured(&pCDC))
        {

          // Send string to virtual COM port (not working)
          // testdata only sent when character entered
          // at virtual COM port terminal application.
          pCDC.Write(&pCDC, testdata, strlen(testdata) );

    length = pCDC.Read(&pCDC, data, MSG_SIZE);
    data[length]=0;
    Trace_Toggel_LED( LED1) ;
          AT91F_US_Put(data);

  }

von Joe D. (jdupre)


Rate this post
useful
not useful
jdupre wrote:
> Can someone please tell me what is preventing the data from being
> written directly to the virtal COM port?

OK, my bad.  I didn't realize that pCDC.Read() was waiting for data.
That is why the Write function wouldn't write until a key was pressed
(to get out of the Read function)...

- J

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.