Skip to content

Conversation

@bennetleins
Copy link

Currently only LEDs are detected and added automatically. This commit adds the capabilities for Buttons as well.

@bennetleins
Copy link
Author

Any chance you could take a look at this @pkoscik ?

Copy link
Member

@pkoscik pkoscik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @bennetleins! Thanks for your contribution.

There seems to be an issue in the way interrupt connections are handled for buttons.

Using this (Nucleo F446ZE) Devicetree file and dts2repl from your PR results in the following snippet:

...

gpioc: GPIOPort.STM32_GPIOPort @ sysbus <0x40020800, +0x400>

userbutton: Miscellaneous.Button @ gpioc 0xd
    invert: true

gpioc:
    13 -> userbutton@0

...

This is incorrect: the interrupts are connected in reverse (sink to source). Instead, it should generate the following snippet:

...

gpioc: GPIOPort.STM32_GPIOPort @ sysbus <0x40020800, +0x400>

userbutton: Miscellaneous.Button @ gpioc 0xd
    invert: true

userbutton:
    -> gpioc@13

...

For reference PTAL at a GPIO description for a similar Nucleo board in the Renode tree.

@pkoscik pkoscik assigned pkoscik and unassigned pkoscik Sep 19, 2025
@bennetleins
Copy link
Author

I just changed the code to fix the issue with the interrupt connections. If I run the code on the nucleo hello_world I now get this:

...
gpioc: GPIOPort.STM32_GPIOPort @ sysbus <0x40020800, +0x400>
...
userbutton: Miscellaneous.Button @ gpioc 0xd
    invert: true
    -> userbutton@13
...

@bennetleins bennetleins requested a review from pkoscik September 19, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants