~repos /rp2350

#zig#raspberry-pi

git clone https://pyrossh.dev/repos/rp2350.git

code to drive rp2350



readme.md



# RP2350 Dev Board
## Setup
1. `brew install zig open-ocd arm-none-eabi-gdb`
2. Test
If open-ocd doesn't work build from source,
`brew remove open-ocd`
`brew install pkg-config autoconf automake texinfo libfdti hidpi jimtcl`
`untar docs/openocd.tar.gz`
`./boostrap`
`./configure --enable-target=rp2350 --enable-interface=jtag`
`make`
`sudo make install`
## Run
1. `zig build`
2. `picotool load -x zig-out/firmware/rp2350.uf2 -f`
# Start OCD Server
`sudo openocd -s tcl -f interface/cmsis-dap.cfg -f target/rp2350.cfg -c "adapter speed 5000"sudo openocd -s tcl -f interface/cmsis-dap.cfg -f target/rp2350.cfg -c "adapter speed 5000"`
# Flash OCD Program
`sudo openocd -f interface/cmsis-dap.cfg -f target/rp2350.cfg -c "adapter speed 5000" -c "program zig-out/firmware/rp2350.elf verify reset exit"`
```c
// Flash allocation map 4MB for pico 2W
//
// |------------------------------------------------|
// | A | B | C | D |
// |----------------|---|-----------|---------------|
// | 1024K |64K| 1472K | 1536K |
// |------------------------------------------------|
// |----------- flash.c -----------|
// |------ 1MB -----|------------- 3MB -------------|
// |---------------------- 4MB ---------------------|
//
// - A : binary (firmware)
// - B : storage (key-value database)
// - C : user program (js)
// - D : file system (lfs)
// (Total : 4MB)
// file system on flash (1024K)
// - sector base : 400
// - sector count : 384
// - use block device : new Flash(400, 384)
```