Skip to content

gpio_pin_get_config for STM32 returns wrong flags value for input pins #95113

@r2r0

Description

@r2r0

Describe the bug

For STM32WB55 we obtain wrong flags value from gpio_pin_get_config when it is called for input pins.
The returned value has both flags set: GPIO_OUTPUT and GPIO_INPUT.

Regression

  • This is a regression.

Steps to reproduce

Call gpio_pin_get_config for any pin configured (in DTS) as input.

Relevant log output

Impact

Functional Limitation – Some features not working as expected, but system usable.

Environment

  • OS: Linux
  • Tollchain: Zephyr 0.17.0
  • Zepyr 3.7

Additional Context

Probably wrong code is:

	if (pin_cfg.out_state != 0) {
		flags |= GPIO_OUTPUT_HIGH;
	} else {
		flags |= GPIO_OUTPUT_LOW;
	}

and there should be instead:

	if (pin_cfg.out_state != 0) {
		flags |= GPIO_OUTPUT_INIT_HIGH;
	} else {
		flags |= GPIO_OUTPUT_INIT_LOW;
	}

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32priority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions