Is it possible to read GPIO registers using devmem2 under Linux? (on DK2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-16 9: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.
- Labels:
-
ST-Boards
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-17 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-17 7:50 AM
Hi @ABora.1​ ,
Linux Clock framework manage clock dynamically and enable it only when required by drivers.
Olivier
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-17 7: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.
