EmbDev.net

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


Author: jdupre (Guest)
Posted on:

Rate this post
0 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);

  }

Author: Joe Dupre (jdupre)
Posted on:

Rate this post
0 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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.