Skip to content

BaremetalPi on Raspberry PI 5 #8

@JakeZw

Description

@JakeZw

This discussion pertains to the Raspberry PI OS both up to date using the 64 bit version.

In the init_gpio() function in the file gpio.jl the device /dev/gpiomem is hardcoded into BaremetalPi.

While this works well on my RPI 4, the RPI 5 does not have this device. Rather it has '/dev/gpiomem0-dev/gpiomem4each with a different major number. The major number for RPI 4/dev/gpiomemis 237. On the RPI 5 the device with this major number is/dev/gpiomem2`. I assume this is important.

I modified a local copy of BaremetalPi with this change and then init_gpio() no longer errors.

What BaremetalPi now needs is a way to determine whether to use '/dev/gpiomemor/dev/gpiomem2`. This could be done by one of the following:

  • determine if the Pi is 4 or 5
  • search the /dev folder to see which one exists
  • search the /dev folder to see which character device has major number 237

Not known
Whether this works with other OS's

If you have a preferred implementation I can test it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions