2021-11-16 09:19 PM
On DK2, using devmem2 on linux I read that GPIOH->MODER/ODR (0x50009000/0x50009014) are all zeroes. The same for GPIOA. OTOH some other things can be read out like RTC clock settings. Is there a way to read the GPIO registers?
Solved! Go to Solution.
2021-11-16 10:53 PM
Hi @ABora.1 ,
Please have a look to How to read or write peripheral registers - stm32mpu
You probably miss the step to enable the GPIO clock.
Olivier
2021-11-16 10:53 PM
Hi @ABora.1 ,
Please have a look to How to read or write peripheral registers - stm32mpu
You probably miss the step to enable the GPIO clock.
Olivier
2021-11-17 07:41 AM
I don't quite understand why those GPIO clocks are apparently off by default under Linux. U-Boot enables a bunch of them, does Linux turn them off again? How is the WiFi able to operate without GPIOH? To my understanding PH4 is used to drive the on/off wire for the WiFi module.
2021-11-17 07:50 AM
Hi @ABora.1 ,
Linux Clock framework manage clock dynamically and enable it only when required by drivers.
Olivier
2021-11-17 07:55 AM
It must be a power saving feature. If I enable the GPIOH clock with devmem2, I am able to see the correct bit for PH4 on GPIOH->ODR. So I suppose the GPIOs hold their state without the clock enabled and Linux shuts off the clock if there are no needed changes to the GPIO state.