I just tried the following patch, and the code runs normally. Shall I make a PR?
diff --git a/arch/arm/src/stm32/stm32_rcc.c b/arch/arm/src/stm32/stm32_rcc.c index f5e69be7d4..249fbcaa9a 100644 --- a/arch/arm/src/stm32/stm32_rcc.c +++ b/arch/arm/src/stm32/stm32_rcc.c @@ -199,15 +199,15 @@ void stm32_clockconfig(void) #endif + /* Enable peripheral clocking */ + + rcc_enableperipherals(); + #ifdef CONFIG_STM32_SYSCFG_IOCOMPENSATION /* Enable I/O Compensation */ stm32_iocompensation(); #endif - - /* Enable peripheral clocking */ - - rcc_enableperipherals(); } /************************************************************************************ Στις Κυρ, 9 Αυγ 2020 στις 4:54 μ.μ., ο/η Fotis Panagiotopoulos < f.j.pa...@gmail.com> έγραψε: > Hi, > > I am using NuttX v9.0.0. > > As I see in file stm32_rcc.c the IO compensation cell is enabled before > the SYSCFG peripheral is enabled. First there is a call to > stm32_iocompensation(), and then to rcc_enableperipherals(). > Thus the code tries to access registers to SYSCFG, before clocking is > enabled to this system. > > I went ahead and enabled CONFIG_STM32_SYSCFG_IOCOMPENSATION. Indeed the > code hangs in the loop in stm32_gpio.c line 816 while waiting for the IO > cell to be enabled. > > I believe this is a bug. Or I am missing something? > I would expect to first enable all clocks, and then set-up the IO cell. > >