Arduino STM32 USB initialization Stall Problem Ask Question

Post here first, or if you can't find a relevant section!
Post Reply
maksimp
Posts: 1
Joined: Mon Mar 29, 2021 2:33 pm

Arduino STM32 USB initialization Stall Problem Ask Question

Post 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)
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Arduino STM32 USB initialization Stall Problem Ask Question

Post 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?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino STM32 USB initialization Stall Problem Ask Question

Post by fpiSTM »

In fact it depends how you set menu options for USB.
Because Serial can be the same than SerialUSB.
Post Reply

Return to “General discussion”