16k USB devices and Chibios.

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: 16k USB devices and Chibios.

Post by Giovanni »

Removing that sleep probably makes some lower priority thread do not execute because the loop becomes continuous when the USB is not active. Do you have loweer priority threads?

Giovanni
ulikoehler
Posts: 71
Joined: Tue Mar 17, 2015 2:32 am
Been thanked: 3 times

Re: 16k USB devices and Chibios.

Post by ulikoehler »

No, I only have the one serial thread and the main (idle) thread does nothing...

Uli
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: 16k USB devices and Chibios.

Post by Giovanni »

Could you try declaring USBDriver.state as volatile? I suspect the compiler optimizes it out if there is a function call in the loop (not just that sleep, any function). It is in usb_lld.h.

Alternatively try compiling with -O0.

Giovanni
Post Reply