Skip to content

Error: bcm283x-gpio (GPIO19): subsystem gpiomem not initialized #46

@vzhurin

Description

@vzhurin

When I trying to use PWM I am getting an error:

2025/04/24 00:17:31 bcm283x-gpio (GPIO19): subsystem gpiomem not initialized

Here is the code

func main() {
	if _, err := host.Init(); err != nil {
		log.Fatal(err)
	}

	pwm := gpioreg.ByName("GPIO19")
	if pwm == nil {
		log.Fatal("Failed to find GPIO19")
	}

	if err := pwm.PWM(gpio.DutyMax/3, 10*physic.KiloHertz); err != nil {
		log.Fatal(err)
	}
}

Any ideas how to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions