Page 1 of 1

STM32L4+ USB-CDC

Posted: Tue Dec 07, 2021 3:16 pm
by phusho
Hi,
I am playing with STM32L4R5ZI nucleo 144 board. One thing that bug me out is that with ChibiOS 21.6.x USB is not working. I am using testhal/STM32/multi/USB_CDC example.
If I use 20.3.x stable - same example is working. I can not find any difference in the two projects. New features like dynamic clock are disabled, but boost is enabled ( which must not be a problem as CR5 register value for boost is same ), also clock configuration in two projects are same. What I can say is that with 21.6.x internal PULLUP is doing nothing (maybe hardware is not functioning correct). Any Ideas what to look at ?

edit: master is not working as well

Re: STM32L4+ USB-CDC

Posted: Tue Dec 07, 2021 3:37 pm
by Giovanni
Hi,

Please use 21.11.0. Version 21.6.0 has been discontinued.

Of course please report if you have the same problem with 21.11.0.

Giovanni

Re: STM32L4+ USB-CDC

Posted: Tue Dec 07, 2021 3:43 pm
by phusho
There is no 21.11.0 in GitHub, how to get it ?

edit: Found it

Re: STM32L4+ USB-CDC

Posted: Tue Dec 07, 2021 3:47 pm
by phusho
Same problem with 21.11.0

Re: STM32L4+ USB-CDC

Posted: Tue Dec 07, 2021 7:17 pm
by Giovanni
phusho wrote:Same problem with 21.11.0


Moving in bug reports, will look at this.

Giovanni

Re: STM32L4+ USB-CDC

Posted: Wed Dec 08, 2021 10:59 am
by Giovanni
Hi,

Fixed as bug #1207.

You just need to change your mcuconf.h file this way:

Code: Select all

#define STM32_PWR_CR2                       (PWR_CR2_PLS_LEV0 | PWR_CR2_IOSV | PWR_CR2_USV)


Giovanni

Re: STM32L4+ USB-CDC

Posted: Wed Dec 08, 2021 12:23 pm
by phusho
Giovanni wrote:Hi,

Fixed as bug #1207.

You just need to change your mcuconf.h file this way:

Code: Select all

#define STM32_PWR_CR2                       (PWR_CR2_PLS_LEV0 | PWR_CR2_IOSV | PWR_CR2_USV)


Giovanni

Changes you made are working in commit I see that you have changed STM32_PLLSAI1N_VALUE to 72, It is working with previous settings also, according to configurator sheet you will have 48 MHz with 48 and STM32_PLLSAI1Q_VALUE=4. I have tested and it is working. Unless there are other complications.

Re: STM32L4+ USB-CDC

Posted: Wed Dec 08, 2021 12:45 pm
by Giovanni
Hi,

Those settings are equivalent, you can use the old or the new ones depending on other constraints if needed.

Giovanni