STM32 OTGv1 GCCFG initialization bug. Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
JasonRen
Posts: 1
Joined: Mon Apr 10, 2023 8:17 pm
Been thanked: 1 time

STM32 OTGv1 GCCFG initialization bug.  Topic is solved

Postby JasonRen » Mon Apr 10, 2023 8:23 pm

https://github.com/jiaxin96/ChibiOS/blo ... _lld.c#L43,

Code: Select all

#if defined(BOARD_OTG_NOVBUSSENS)
#define GCCFG_INIT_VALUE        (GCCFG_NOVBUSSENS | GCCFG_VBUSASEN |        \
                                 GCCFG_VBUSBSEN | GCCFG_PWRDWN)
#else
#define GCCFG_INIT_VALUE        (GCCFG_VBUSASEN | GCCFG_VBUSBSEN |          \
                                 GCCFG_PWRDWN)
#endif


When VBUSSENS is disabled, the initialization parameters are wrong, which leads to some USB pins not working properly as GPIO. It should be changed to the following definition:

Code: Select all

#if defined(BOARD_OTG_NOVBUSSENS)
#define GCCFG_INIT_VALUE        (GCCFG_NOVBUSSENS | GCCFG_PWRDWN)
#else
#define GCCFG_INIT_VALUE        (GCCFG_VBUSASEN | GCCFG_VBUSBSEN |          \
                                 GCCFG_PWRDWN)
#endif

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32 OTGv1 GCCFG initialization bug.

Postby Giovanni » Fri Apr 14, 2023 10:00 am

Hi,

Change committed, thanks.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 56 guests