Page 1 of 1

Arduino STM32 USB initialization Stall Problem Ask Question

Posted: Mon Mar 29, 2021 4:43 pm
by maksimp
0


I am developing on Nucelo-64 L476RG board, Serial and USB used to work before with stm32duino, now, perhaps I am doing something wrong, The below code stalls at USB_CoreInit() which is before the setup()

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
SerialUSB.begin(115200); // also stalls if this line is commented out

}

void loop() {
// put your main code here, to run repeatedly:
Serial.print(4);
delay(1000);
}
The flags enabled are as

Usart support : Enabled (generic Serial)
USB Support: CDC Generics (also tried with no Generics)
USB Speed : Low/Full speed
Optimize: Debug (-g)

Re: Arduino STM32 USB initialization Stall Problem Ask Question

Posted: Mon Mar 29, 2021 5:34 pm
by ag123
i think for Serial, one of them has to be USB CDC e.g. with generic Serial. then the other one which is uart should not have generic Serial.
it would otherwise have a symbol collision?

if things are switched around e.g. disable USB and only enable the uart Serial works, it may point to 'deeper' problems related to USB.
for nucleo boards i'd guess USB isn't needed?

Re: Arduino STM32 USB initialization Stall Problem Ask Question

Posted: Mon Mar 29, 2021 5:46 pm
by fpiSTM
In fact it depends how you set menu options for USB.
Because Serial can be the same than SerialUSB.