# Raspberry Pi Pico H

## Specs

- Dual core Arm Cortex M0+ 133 MHz
- 264kB multi-bank high performance SRAM
- 2MiB external flash
- Datasheet: [pico-datasheet.pdf](https://wiki.hexadust.net/attachments/51)

### Pinout

- `VBUS` **40** - micro-USB input voltage, connected to micro-USB port pin 1. This is nominally 5V (or 0V if the USB is not  
    connected or not powered).
- `VSYS` **39** - main system input voltage, which can vary in the allowed range 1.8V to 5.5V, and is used by the on-board  
    SMPS to generate the 3.3V for the RP2040 and its GPIO.
- `GND` **38** - ground.
- UART TX **1** / RI **2**
- `LED` (`GP25`) - LED is connected to GPIO 25.

## [![pico-pinout.png](https://wiki.hexadust.net/uploads/images/gallery/2024-12/scaled-1680-/vO9Xd85WyfglJ6a0-pico-pinout.png)](https://wiki.hexadust.net/uploads/images/gallery/2024-12/vO9Xd85WyfglJ6a0-pico-pinout.png)Rust

### Dependencies

```bash
rustup target install thumbv6m-none-eabi
cargo install flip-link
cargo install --locked elf2uf2-rs
```

Set up mount point for RP2 device in `/etc/fstab`:

```
LABEL="RPI-RP2" /mnt/rp2 auto defaults,user,noauto,nosuid,nodev,noexec 0 0
```

### Template project setup

Template project: [https://github.com/rp-rs/rp2040-project-template](https://github.com/rp-rs/rp2040-project-template)

1. Uncomment `elf2uf2-rs -d` runner in `.cargo/config.toml`: ```diff
    diff --git a/.cargo/config.toml b/.cargo/config.toml
    index a565984..04a72c4 100644
    --- a/.cargo/config.toml
    +++ b/.cargo/config.toml
    @@ -2,8 +2,8 @@
     # Choose a default "cargo run" tool (see README for more info)
     # - `probe-rs` provides flashing and defmt via a hardware debugger, and stack unwind on panic
     # - elf2uf2-rs loads firmware over USB when the rp2040 is in boot mode
    -runner = "probe-rs run --chip RP2040 --protocol swd"
    -# runner = "elf2uf2-rs -d"
    +#runner = "probe-rs run --chip RP2040 --protocol swd"
    +runner = "elf2uf2-rs -d"
    
     rustflags = [
       "-C", "linker=flip-link",
    ```
2. Connect (while holding `BOOTSEL` button) and mount RP2 device: `mount /mnt/rp2`
3. Build and run: `cargo run --release`

# zeptoforth

- Install doc: [https://github.com/tabemann/zeptoforth/wiki/Installing-and-Building-zeptoforth-and-Using-the-zeptoforth-Console](https://github.com/tabemann/zeptoforth/wiki/Installing-and-Building-zeptoforth-and-Using-the-zeptoforth-Console "Installing and Building zeptoforth and Using the zeptoforth Console")
    - Download latest release from tag: [https://github.com/tabemann/zeptoforth/releases](https://github.com/tabemann/zeptoforth/releases)
    - Untar
    - Press **bootsel** and plug in Pico and mount USB volume
    - Copy `zeptoforth_full_usb-*.uf2` from `bin/*/rp2040_big` to Pico USB volume
    - Use `tio /dev/ttyACM0` to connect to Forth console