Having a very strange problem with STM32G474 when enabling USB support CDC. It does this even with a simple LED blink program without any serial code at all. Without USB CDC enabled, the LED comes up blinking after uploading, and if I power the board off then on, the LED comes up blinking as it should.
However, if I enable USB support CDC, the LED comes up blinking after upload, but after powering off then on it never blinks again. If i add some serial.print code it also works fine after uploading, and the serial prints show up in the serial monitor over USB, but after powering off then on it stops working. Enabling USB support HID doesn't cause the problem, just CDC.
This is with the STM32duino core 2.9.0 but have tried several earlier STM cores and it does it with all of them.
STM32G474 strange problem with USB support CDC
Re: STM32G474 strange problem with USB support CDC
Hi @jeffs555
Which board you used? Target and options?
Which board you used? Target and options?
Re: STM32G474 strange problem with USB support CDC
Thanks for responding.
I am using a WEACT board with a STM32G474CEU6
The problem is probably because I was using generic STM32G474CETx as the board part number because there was no STM32G474CEUx selection.
The parts are basically the same with 48 pins, but the STM32G474CEU6 has the 3 ground connections moved to a pad on the bottom and so has 3 extra IO pins. The LED on the WEACT board is on one of the extra IO pins.
I am trying to add a generic STM32G474CEU6 to the boards.txt and hopefully that will fix the problem.
I am using a WEACT board with a STM32G474CEU6
The problem is probably because I was using generic STM32G474CETx as the board part number because there was no STM32G474CEUx selection.
The parts are basically the same with 48 pins, but the STM32G474CEU6 has the 3 ground connections moved to a pad on the bottom and so has 3 extra IO pins. The LED on the WEACT board is on one of the extra IO pins.
I am trying to add a generic STM32G474CEU6 to the boards.txt and hopefully that will fix the problem.
Re: STM32G474 strange problem with USB support CDC
Pay attention to USB clock source. It have to be 48MHz.
Re: STM32G474 strange problem with USB support CDC
Thanks again, it is working now including the USB serial.
I copied the generic_clock.c and ldscript.ld files from the Tx variants directory to the Ux variants directory,
Then edited the copied generic_clock.c and changed the 8 references for Tx parts to Ux
It wouldn't recognize the changes to boards.txt until I deleted the arduino-ide directory as described at this link
https://github.com/arduino/arduino-ide/ ... 1152005617
I copied the generic_clock.c and ldscript.ld files from the Tx variants directory to the Ux variants directory,
Then edited the copied generic_clock.c and changed the 8 references for Tx parts to Ux
It wouldn't recognize the changes to boards.txt until I deleted the arduino-ide directory as described at this link
https://github.com/arduino/arduino-ide/ ... 1152005617
Re: STM32G474 strange problem with USB support CDC
Do you know how i could request the generic STM32G474CEUx be added to the next STM32duino release? The STM32G474CEU6 has a lot of very nice peripherals and I would like to recommend the WeAct board to some people without having to walk them through adding it themselves.
Re: STM32G474 strange problem with USB support CDC
Do a Pull Request. See the contributing documentation.