I adapted the USB-CDC demo for AT91SAM7A3, taken from the lwIP_Demo_Rowley_ARM7, it works but then I modified the vUSBCDCTask function to implement a simple Echo for that I at the end of the for(; block:
while( xQueueReceive( xRxCDC, &ucByte, usbNO_BLOCK ) ){
   xQueueSend( xTxCDC, &ucByte, usbNO_BLOCK );
}
Then I test the throughput but It is really slow (about 300 @ 115200baud nominal). I would like to know how to improve the responsiveness. Should I do everything in the ISR function? Or should I wake up a task from the ISR? And then, howto to make a task waits the receipt of data (from ISR)? I put xQueueReceive (…) with some delay (e.g. usbSHORT_DELAY), but in this case the task is polling the queue…
thank you for your answer. I had a look at the old messages, but I couldn’t find any new ideas.
I followed the R.Barry instruction I had:
- an ISR routine collecting data from the hardware and then it puts them in a Queue;
- a task replying with a simple echo. But the throughput is near 300baud (or less…)…note that if I repeat more times an incoming character (eg. 2 times) I double the speed…4 times speedx4 etc…
I wonder if the bottleneck would be on the pc side…
I have one more question, can happen a task switch while ISR is executing?Â
I put the ‘echo’ in the ISR, which is a smal amount of code: get data from usb IN buffer and put it in the OUT buffer.