{"id":18694261,"url":"https://github.com/9elements/picoprog","last_synced_at":"2025-04-12T07:01:37.671Z","repository":{"id":254870638,"uuid":"845575095","full_name":"9elements/picoprog","owner":"9elements","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-13T07:45:14.000Z","size":1822,"stargazers_count":8,"open_issues_count":5,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-12T00:37:22.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/9elements.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}},"created_at":"2024-08-21T14:08:44.000Z","updated_at":"2025-03-23T18:50:25.000Z","dependencies_parsed_at":"2024-08-26T18:15:24.052Z","dependency_job_id":"f457aec1-c439-4334-9859-8a5076039ff1","html_url":"https://github.com/9elements/picoprog","commit_stats":null,"previous_names":["9elements/picoprog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9elements%2Fpicoprog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9elements%2Fpicoprog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9elements%2Fpicoprog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9elements%2Fpicoprog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9elements","download_url":"https://codeload.github.com/9elements/picoprog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530569,"owners_count":21119597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-07T11:09:09.295Z","updated_at":"2025-04-12T07:01:37.634Z","avatar_url":"https://github.com/9elements.png","language":"Rust","readme":"# Picoprog\n\nPicoprog is a firmware for the Raspberry Pi Pico that provides a USB-to-serial and USB-to-SPI bridge. It allows you to communicate with UART and SPI peripherals via USB.\n\n## Prerequisites\n\nBefore you can compile and use Picoprog, you need to install the following dependencies:\n\n- Rust and Cargo: Follow the instructions on the [official Rust website](https://www.rust-lang.org/tools/install) to install Rust and Cargo.\n- Install flip-link and elf2uf2\n\n```sh\n# Only Linux\nsudo apt install build-essential libudev-dev pkg-config\n\n# All systems\ncargo install flip-link elf2uf2-rs\n```\n\n## Compiling the Firmware\n\nTo compile the firmware, follow these steps:\n\n1. Clone the repository:\n\n```sh\ngit clone https://github.com/9elements/picoprog.git\ncd picoprog\n```\n\n2. Build the firmware:\n\n```sh\ncargo run --release\n```\n\n3. The compiled binary will be located in the `target/thumbv6m-none-eabi/release` directory.\n\n## Flashing the Firmware\n\nTo flash the firmware onto the Raspberry Pi Pico, follow these steps:\n\n1. Connect the Raspberry Pi Pico to your computer while holding the BOOTSEL button. This will put the Pico into USB mass storage mode.\n\n2. Copy the UF2 file to the Pico:\n\n```sh\n# Linux\ncp target/thumbv6m-none-eabi/release/picoprog.uf2 /media/$USER/RPI-RP2/\n\n# macOS\ncp target/thumbv6m-none-eabi/release/picoprog.uf2 /Volumes/RPI-RP2/\n```\n\n3. The Pico will automatically reboot and start running the new firmware.\n\n## Usage\n\nOnce the firmware is running on the Raspberry Pi Pico, you can use any terminal program to communicate with the UART and SPI peripherals via USB. The device will appear as a USB CDC (Communications Device Class) device. Currently `/dev/ttyACM0` (macOS: `/dev/tty.usbmodemOSFC20241`) is a debug console that prints information about the picos current operation.\n\n### UART Communication\n\nTo communicate with the UART peripheral, open the corresponding serial port (e.g., `/dev/ttyACM1` on Linux, `/dev/tty.usbmodemOSFC20243` on macOS) with your terminal program. For now the Baud is fixed at 115200 but can be changed in code. Dynamic reconfiguration is still planned.\n\n### Using Flashrom or Flashprog\n\nTo interact with the Raspberry Pi Pico for reading and writing SPI flash chips, you can use tools like `flashrom` or `flashprog`. These tools support the `serprog` protocol, which allows communication over a serial interface.\n\n1. Install `flashrom` or `flashprog` e.g.:\n\n```sh\n# Debian or Debian-based Linux distributions\nsudo apt-get install flashrom\n\n# macOS with Homebrew\nbrew install flashrom\n```\n\n2. Use the following command to read from the SPI flash chip:\n\n```sh\nflashrom -p serprog:dev=/dev/ttyACM2 -r backup.bin\n```\n\nThis command reads the contents of the SPI flash chip and saves it to `backup.bin`.\n\n3. Use the following command to write to the SPI flash chip:\n\n```sh\nflashrom -p serprog:dev=/dev/ttyACM2 -w firmware.bin\n```\n\nThis command writes the contents of `firmware.bin` to the SPI flash chip.\n\nMake sure to replace `/dev/ttyACM2` with the correct serial port if your device is connected to a different port or if you're on a different operating system (on macOS it will be `/dev/tty.usbmodemOSFC20245`).\n\n\n## License\n\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9elements%2Fpicoprog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9elements%2Fpicoprog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9elements%2Fpicoprog/lists"}