Skip to content

Commit 9cf257f

Browse files
authored
Merge pull request #9 from rp-rs/AsafFisher-ci
Create ci.yml
2 parents c43c67d + 58d8916 commit 9cf257f

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Install Dependencies
20+
run: |
21+
sudo apt update
22+
rustup component add rust-src
23+
cargo install cargo-binutils
24+
rustup component add llvm-tools-preview
25+
- name: Build
26+
run: |
27+
./build.sh
28+
- name: Run tests
29+
run: cargo test --verbose

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
This is a flash algorithm for the RP2040 chip, used in the Raspberry Pi Pico board.
44
It implements the CMSIS-Pack ABI, so it's compatible with any tools that use it, including probe-rs.
55

6+
## Dependencies
7+
8+
Run the following requirements:
9+
```bash
10+
cargo install cargo-binutils && rustup component add llvm-tools-preview rust-src
11+
```
612
## Building
713

814
Building requires nightly Rust.

build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ set -euo pipefail
55
cargo build --release
66
ELF=target/thumbv6m-none-eabi/release/flash-algo
77

8-
llvm-objdump --disassemble $ELF > target/disassembly.s
9-
llvm-objdump -x $ELF > target/dump.txt
10-
llvm-nm $ELF -n > target/nm.txt
8+
rust-objdump --disassemble $ELF > target/disassembly.s
9+
rust-objdump -x $ELF > target/dump.txt
10+
rust-nm $ELF -n > target/nm.txt
1111

1212
function bin {
13-
llvm-objcopy $ELF -O binary - | base64 -w0
13+
rust-objcopy $ELF -O binary - | base64 -w0
1414
}
1515

1616
function sym {
17-
echo $((0x$(llvm-nm $ELF | grep -w $1 | cut -d ' ' -f 1) + 1))
17+
echo $((0x$(rust-nm $ELF | grep -w $1 | cut -d ' ' -f 1) + 1))
1818
}
1919

2020
cat <<EOF

0 commit comments

Comments
 (0)