FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2012 Threads] Problem with USB driver and FreeRTOSPosted by Paul Coleman on March 6, 2012 II'm developing an app for the Atmel UC3C1512 using their AVR Studio 5 development environment and also their software framework (ver 2.5.1-17860.53) and I have an interaction problem between their USB stack and the FreeRTOS scheduler. Basically, the problem is that when I enable the scheduler the USB starts sending out spurious characters anywhere between 1 and 15 seconds apart. If I don't enable the scheduler it works as expected. It makes no difference whether I create a task for the sceduler to run it still does it and I'm not using any other features of FreeRTOS i.e. I'm not creating any message queues or semaphores etc. This is my test code... #include #include #include #include
void USBRxNotifyCallback(void) { int charIn;
while(udi_cdc_is_rx_ready()) { charIn = udi_cdc_getc(); udi_cdc_putc(charIn); } }
bool USBEnabledCallback(void) { return true; }
void USBVbusCallback(bool b_vbus_high) { if (b_vbus_high) { udc_attach(); } else { udc_detach(); } }
int main(void) { pcl_switch_to_osc(PCL_OSC0, FOSC0, OSC0_STARTUP);
udc_start();
if (!udc_include_vbus_monitoring()) { udc_attach(); }
// !!! with the following line enabled the USB will send spurious characters out !!! vTaskStartScheduler();
for(;;); }
Has anybody else experienced problems with the USB at all?
Thanks, Paul.
RE: Problem with USB driver and FreeRTOSPosted by Richard on March 6, 2012 I know nothing about this driver - but how does it interface to the hardware? Is it using any interrupts or system calls other than the single USB peripheral interrupt?
Have you tried initialising the peripheral after the scheduler has started? Take care not to start the device with the scheduler in an inconsistent state.
Regards.
RE: Problem with USB driver and FreeRTOSPosted by Paul Coleman on March 6, 2012 Thanks for the reply.
I can't answer the question off the top of my head as it's a large framework written by Atmel that I have very little knowledge about.
I had tried initialising the USB after the scheduler has started but it made no difference. I'd trimmed the app down to try and eliminate things and that was what I ended up with.
I will continue to investigate but I just wanted to see if anybody else had had similar issues.
Regards, Paul.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|