paulgcoleman wrote on Tuesday, March 06, 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 <FreeRTOS.h>
#include <task.h>
#include <semphr.h>
#include <asf.h>
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.