Skip to content

Commit 987cbab

Browse files
Merge branch 'release/v0.3.0'
2 parents d5ef752 + 55c7b60 commit 987cbab

File tree

16 files changed

+6342
-155
lines changed

16 files changed

+6342
-155
lines changed

.cargo/config.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[target.thumbv6m-none-eabi]
2+
# This will make a UF2 and copy it to the RP2040's Mass Storage Device bootloader
23
# runner = "elf2uf2-rs -d"
3-
runner = "probe-run-rp --chip RP2040"
4+
# This will flash over SWD with any compatible probe it finds. You need 0.3.1 or higher for RP2040 support.
5+
runner = "probe-run --chip RP2040 --measure-stack"
46

57
rustflags = [
68
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x

.github/workflows/build.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
CARGO_TERM_COLOR: always
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
continue-on-error: ${{ matrix.experimental || false }}
12+
strategy:
13+
matrix:
14+
# All code should be running on stable now
15+
rust: [nightly, stable]
16+
include:
17+
# Nightly is only for reference and allowed to fail
18+
- rust: nightly
19+
experimental: true
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v3
23+
with:
24+
submodules: true
25+
26+
- name: Install Rust
27+
uses: actions-rs/toolchain@v1
28+
with:
29+
profile: minimal
30+
toolchain: ${{ matrix.rust }}
31+
override: true
32+
target: thumbv6m-none-eabi
33+
34+
- name: Build Code
35+
run: cargo build --release --verbose
36+
37+
- name: Get Branch Name
38+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
39+
id: branch_name
40+
run: |
41+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
42+
43+
- name: Create Release
44+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
45+
id: create_release
46+
uses: actions/create-release@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
tag_name: ${{ github.ref }}
51+
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
52+
draft: false
53+
prerelease: false
54+
55+
- name: Upload files to Release
56+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
57+
uses: softprops/action-gh-release@v1
58+
with:
59+
files: |
60+
target/thumbv6m-none-eabi/release/neotron-pico
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/clippy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Clippy
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
CARGO_TERM_COLOR: always
7+
8+
jobs:
9+
clippy-check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v3
14+
15+
- name: Install Rust
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
toolchain: stable
19+
components: clippy
20+
target: thumbv6m-none-eabi
21+
22+
- name: Run Clippy
23+
uses: actions-rs/clippy-check@v1
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
args: --all-features --target=thumbv6m-none-eabi

.github/workflows/format.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ name: Format
33
on: [push, pull_request]
44

55
jobs:
6-
check:
7-
6+
format-check:
87
runs-on: ubuntu-latest
9-
108
steps:
11-
- uses: actions/checkout@v1
12-
- name: Add Tool
13-
run: rustup component add rustfmt
14-
- name: Check Format
15-
run: cargo fmt -- --check
9+
- name: Checkout Code
10+
uses: actions/checkout@v3
11+
12+
- name: Install Rust
13+
uses: actions-rs/toolchain@v1
14+
with:
15+
toolchain: stable
16+
components: rustfmt
17+
18+
- name: Check Format
19+
run: cargo fmt -- --check

.github/workflows/release.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/rust.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Changelog
22

3-
## Unreleased Changes ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/master) | [Changes](https://github.com/neotron-compute/neotron-pico-bios/compare/v0.1.0...master))
3+
## Unreleased Changes ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/develop) | [Changes](https://github.com/neotron-compute/neotron-pico-bios/compare/v0.3.0...develop))
44

55
* None
66

7+
## v0.3.0 ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/v0.3.0) | [Release](https://github.com/neotron-compute/neotron-pico-bios/release/tag/v0.3.0))
8+
9+
* Boots OS 0.1.0
10+
* VGA 80x30 text mode (640x480 @ 60Hz)
11+
* Update defmt and other crates
12+
713
## v0.2.0 ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/v0.2.0) | [Release](https://github.com/neotron-compute/neotron-pico-bios/release/tag/v0.2.0))
814

915
* Add RTT debugging using defmt

Cargo.toml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
[package]
22
authors = ["Jonathan 'theJPster' Pallant <[email protected]>"]
33
edition = "2018"
4+
resolver = "2"
45
readme = "README.md"
56
license = "GPL-3.0-or-later"
67
name = "neotron-pico-bios"
7-
version = "0.2.0"
8+
version = "0.3.0"
89

910
[dependencies]
1011
# Useful Cortex-M specific functions (e.g. SysTick)
11-
cortex-m = "0.7.3"
12+
cortex-m = "0.7"
1213
# The Raspberry Pi Pico HAL
13-
pico = { git = "https://github.com/rp-rs/rp-hal.git" }
14+
rp-pico = "0.3"
1415
# Cortex-M run-time (or start-up) code
15-
cortex-m-rt = "0.6.14"
16-
# The BIOS API we export to the OS
17-
neotron-common-bios = { git = "https://github.com/Neotron-Compute/Neotron-Common-BIOS.git" }
16+
cortex-m-rt = "0.7"
17+
# The BIOS to OS API
18+
neotron-common-bios = "0.1.0"
1819
# For time keeping/handling
1920
embedded-time = "0.12"
2021
# For the RP2040 bootloader
21-
rp2040-boot2 = "0.1"
22+
rp2040-boot2 = "0.2"
2223
# For hardware abstraction traits
2324
embedded-hal ="0.2"
2425
# Gives us formatted PC-side logging
25-
defmt = "0.2"
26+
defmt = "0.3"
2627
# Sends defmt logs to the SWD debugger
27-
defmt-rtt = "0.2"
28+
defmt-rtt = "0.3"
2829
# Send panics to the debugger
2930
panic-probe = "0.2"
30-
# Fetches the BIOS version from git
31-
git-version = "0.3"
31+
# RP2040 PIO assembler
32+
pio = "0.2"
33+
# Macros for RP2040 PIO assembler
34+
pio-proc = "0.2"
3235

3336
[features]
3437
default = [

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,27 @@ The Neotron BIOS uses the [defmt](https://crates.io/crates/defmt) crate to provi
4747

4848
2. Flash your *Debugger* Pico with https://github.com/majbthrd/DapperMime firmware (e.g. by copying the UF2 file to the USB Mass Storage device)
4949

50-
3. On your PC, install *probe-rs-rp* from the RP2040-specific [probe-run](https://github.com/knurling-rs/probe-run) fork at https://github.com/rp-rs/probe-run.
50+
3. On your PC, install [*probe-rs*](https://github.com/knurling-rs/probe-run), the programming tool from [Ferrous System's](https://www.ferrous-systems.com) [Knurling Project](https://github.com/knurling).
5151

5252
```console
53-
user@host ~ $ cargo install probe-rs-rp
53+
user@host ~ $ cargo install probe-rs
5454
```
5555

5656
4. Power on your Neotron Pico.
5757

58-
5. Build and load the Neotron BIOS, and view the debug output stream, with `cargo run`:
58+
5. Build the Neotron OS
59+
60+
We use the "neotron-os-pico.ld" linker script to link it at `0x1002_0000`.
61+
62+
```console
63+
user@host ~/neotron-os $ cargo build --release
64+
user@host ~/neotron-os $ arm-none-eabi-objcopy -O binary ./target/thumbv6m-none-eabi/release/flash1002 ../neotron-pico-bios/src/flash1002.bin
65+
```
66+
67+
6. Build and load the Neotron BIOS, and view the debug output stream, with `cargo run --release`:
5968

6069
```console
61-
user@host ~/neotron-pico-bios $ cargo run --release
70+
user@host ~/neotron-pico-bios $ DEFMT_LOG=debug cargo run --release
6271
Compiling neotron-pico-bios v0.1.0 (/home/jonathan/Documents/neotron/neotron-pico-bios)
6372
Finished release [optimized + debuginfo] target(s) in 0.76s
6473
Running `probe-run-rp --chip RP2040 target/thumbv6m-none-eabi/release/neotron-pico-bios`
@@ -75,6 +84,8 @@ user@host ~/neotron-pico-bios $ cargo run --release
7584
└─ neotron_pico_bios::__cortex_m_rt_main @ src/main.rs:128
7685
```
7786

87+
You should see your Neotron Pico boot, both over RTT in the `probe-run` output, and also on the VGA output.
88+
7889
## Changelog
7990

8091
See [CHANGELOG.md](./CHANGELOG.md)

build.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,22 @@ fn main() {
2828
// here, we ensure the build script is only re-run when
2929
// `memory.x` is changed.
3030
println!("cargo:rerun-if-changed=memory.x");
31+
32+
// Get git version
33+
if let Ok(cmd_output) = std::process::Command::new("git")
34+
.arg("describe")
35+
.arg("--all")
36+
.arg("--dirty")
37+
.arg("--long")
38+
.output()
39+
{
40+
let git_version = std::str::from_utf8(&cmd_output.stdout).unwrap();
41+
println!(
42+
"cargo:rustc-env=BIOS_VERSION={} (git:{})",
43+
env!("CARGO_PKG_VERSION"),
44+
git_version.trim()
45+
);
46+
} else {
47+
println!("cargo:rustc-env=BIOS_VERSION={}", env!("CARGO_PKG_VERSION"));
48+
}
3149
}

0 commit comments

Comments
 (0)