LinuxCommandLibrary

pio-access

Manage user access to parallel I/O resources

TLDR

Grant a user access to a resource

$ pio access grant [guest|maintainer|admin] [username] [resource_urn]
copy

Remove a user's access to a resource
$ pio access revoke [username] [resource_urn]
copy

Show all resources that a user or team has access to and the access level
$ pio access list [username]
copy

Restrict access to a resource to specific users or team members
$ pio access private [resource_urn]
copy

Allow all users access to a resource
$ pio access public [resource_urn]
copy

SYNOPSIS

pio-access <pio_device_id> <permission>

PARAMETERS

<pio_device_id>
    The identifier for the PIO device and state machine. This usually corresponds to the minor device number of /dev/rp2040-pioX. For example, '0' refers to /dev/rp2040-pio0, and '1' refers to /dev/rp2040-pio1. The command manages access to all state machines within that specific PIO block.

<permission>
    The action to perform: allow to grant access to non-root users, or deny to revoke it.

DESCRIPTION

The pio-access command on Linux systems (primarily Raspberry Pi OS) is used to control user-space access permissions to the Programmable I/O (PIO) state machines on RP2040-based devices. These state machines are crucial for low-level, high-speed hardware interaction.

By default, access to PIO devices like /dev/rp2040-pio0 and /dev/rp2040-pio1 might be restricted to the root user. pio-access allows an administrator to grant (or revoke) access for non-root users to specific PIO state machines, typically to facilitate the operation of development tools or custom applications that need direct control over the PIO hardware. This is essential for tools like picotool or pico-debug which often require direct interaction with the RP2040's PIO peripherals.

CAVEATS

Requires root privileges to execute, typically by using sudo.
Specific to Raspberry Pi RP2040 based systems. It will not work on other Linux systems lacking the necessary hardware and kernel modules.
Modifying PIO access can impact system stability or security if not managed carefully, as it grants direct hardware control.
The respective /dev/rp2040-pioX device file must exist for the command to operate on it.

DEVICE FILES

The command operates on kernel device files, typically found as /dev/rp2040-pio0 and /dev/rp2040-pio1. These files represent the PIO blocks on the RP2040 chip, each containing multiple state machines.

TYPICAL USE CASE

Often invoked as a pre-requisite for development tools such as picotool or pico-debug, which need direct communication with the RP2040 over USB or SWD (Serial Wire Debug) interfaces, often facilitated via PIO. Enabling access allows these tools to run without requiring root privileges themselves for every operation.

HISTORY

The pio-access command emerged with the increasing popularity of the Raspberry Pi RP2040 microcontroller and the need for robust user-space tooling. It is part of the broader ecosystem developed to support the RP2040, providing a standardized way to manage critical hardware access that often requires root privileges. Its development is closely tied to projects like libjaylink and openocd, which are fundamental for debugging and flashing RP2040 devices.

SEE ALSO

sudo(8), chmod(1), picotool(1), pico-debug(1)

Copied to clipboard