Skip to main content
ABora.1
Associate II
November 17, 2021
Solved

Is it possible to read GPIO registers using devmem2 under Linux? (on DK2)

  • November 17, 2021
  • 1 reply
  • 1601 views

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?

This topic has been closed for replies.
Best answer by Olivier GALLIEN

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

1 reply

Olivier GALLIEN
Olivier GALLIENBest answer
Technical Moderator
November 17, 2021

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

Olivier GALLIEN 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.
ABora.1
ABora.1Author
Associate II
November 17, 2021

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.

Olivier GALLIEN
Technical Moderator
November 17, 2021

Hi @ABora.1​ ,

Linux Clock framework manage clock dynamically and enable it only when required by drivers.

Olivier

Olivier GALLIEN 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.