{"id":29643394,"url":"https://github.com/pybricks/pybricks-pru","last_synced_at":"2026-02-06T12:21:26.583Z","repository":{"id":304742067,"uuid":"1019754012","full_name":"pybricks/pybricks-pru","owner":"pybricks","description":"PRU firmware for Pybrcks","archived":false,"fork":false,"pushed_at":"2025-08-07T17:03:06.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-20T19:41:12.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pybricks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-14T20:21:13.000Z","updated_at":"2025-08-21T21:01:40.000Z","dependencies_parsed_at":"2025-07-15T03:16:16.618Z","dependency_job_id":"3a18d732-0623-4643-a841-2233f6bccde8","html_url":"https://github.com/pybricks/pybricks-pru","commit_stats":null,"previous_names":["pybricks/pybricks-pru"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pybricks/pybricks-pru","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybricks%2Fpybricks-pru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybricks%2Fpybricks-pru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybricks%2Fpybricks-pru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybricks%2Fpybricks-pru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pybricks","download_url":"https://codeload.github.com/pybricks/pybricks-pru/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybricks%2Fpybricks-pru/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29160810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-21T23:36:28.411Z","updated_at":"2026-02-06T12:21:26.559Z","avatar_url":"https://github.com/pybricks.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pybricks EV3 PRU firmware source code\n\nThis is the source code for the firmware which runs on the Programmable Real-Time Unit Subsystem (PRUSS) of the EV3.\n\n## Quick Start\n\n1. Obtain the GCC `pru-elf` toolchain. Prebuilt Linux binaries are available [here](https://github.com/dinuxbg/gnupru/releases). Ensure that the tools are in your `PATH` (for example, by running `pru-gcc -v`)\n2. Run `make` in this directory\n3. The binary file which will be embedded into Pybricks is `pru_ledpwm.bin`\n3. If you want to examine the resulting assembly code, run `pru-objdump -dS pru_ledpwm.elf`\n\n## What is the purpose of this code?\n\nThe PRU is a small custom microcontroller core embedded inside the larger AM1808 System-on-Chip which powers the Mindstorms EV3. Although it has access to most of the system, the intended use-case for the PRU is to offload tasks which require \"real-time\" performance. Moving tasks from the main ARM CPU to the PRU frees up the main CPU from having to handle these events.\n\nThe PRUs have their own instruction and data memory separate from the ARM CPU, and they are relatively small, so a common developer workflow is to embed precompiled PRU firmware blobs into the (much larger) ARM code. The GitHub Actions workflows in this repository help automate this.\n\nThe AM1808 contains two PRU cores, called PRU0 and PRU1. PRU0 is used to provide two additional UART serial ports for sensor ports 3 and 4, and this is done using a TI-provided software UART library. PRU1 runs the code in this repository.\n\nCurrently, PRU1 is used to implement brightness control for the front LEDs on the EV3 brick.\n\n## Functionality and resources used\n\nThis firmware runs on PRU1.\n\nData is exchanged between the ARM CPU and the PRU firmware using shared memory located in the second 64 KiB of the on-chip RAM (i.e starting at address `0x8001_0000`).\n\nThis firmware requires `CONTABPROPTR1.C30` to be set such that the constant table entry points to the shared memory (i.e. the field should have the value `0x0100`).\n\n### LED PWM functionality\n\nThis code allows varying the brightness of the front LEDs on the EV3 brick (the red/green LEDs in the directional button pad). This is done by turning them on and off for a specified percentage of the time (pulse-width modulation). PWM is being implemented entirely in software and not via a dedicated PWM peripheral.\n\nThere are four LEDs, and their brightnesses can be controlled independently. Each LED's brightness can be a value from 0 to 255 inclusive.\n\nThe timing for the LED PWM is derived from a hardware timer, Timer0.TIM34. Timer0.TIM34 is expected to count continuously with a period of $256\\times256$ (i.e. counting from 0 to 0xffff inclusive).\n\nThe LEDs are turned on and off through the PRU's special register R30. This requires the GPIO alternate function to be programmed to select the PRU1 function.\n\nThe PRU firmware expects these resources to be set up ahead of time by the ARM firmware.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybricks%2Fpybricks-pru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpybricks%2Fpybricks-pru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybricks%2Fpybricks-pru/lists"}