Skip to content

Commit

Permalink
Merge branch 'release/v0.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
thejpster committed Aug 24, 2022
2 parents 4b3f7d6 + 4134b22 commit 50df318
Show file tree
Hide file tree
Showing 16 changed files with 156 additions and 125 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,11 @@ jobs:
- name: Install flip-link
run: cd / && cargo install --debug flip-link

- name: Build neotron-bmc-pico for F030
run: |
cd neotron-bmc-pico
cargo build --release --verbose --target=thumbv6m-none-eabi --features=stm32f030x6
cd target/thumbv6m-none-eabi/release
mv neotron-bmc-pico neotron-bmc-pico-f030
- name: Build neotron-bmc-pico for F031
run: |
cd neotron-bmc-pico
cargo build --release --verbose --target=thumbv6m-none-eabi --features=stm32f031
cd target/thumbv6m-none-eabi/release
mv neotron-bmc-pico neotron-bmc-pico-f031
- name: Build neotron-bmc-pico
run: cd neotron-bmc-pico && DEFMT_LOG=info cargo build --release --verbose --target=thumbv6m-none-eabi

- name: Build neotron-bmc-nucleo
run: |
cd neotron-bmc-nucleo
cargo build --release --verbose --target=thumbv7em-none-eabihf
run: cd neotron-bmc-nucleo && DEFMT_LOG=info cargo build --release --verbose --target=thumbv7em-none-eabihf

- name: Get Branch Name
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* None

## v0.3.1
* Reset button triggers 250ms low pulse
* Fix STM32F030 support and remove STM32F031 support for neotron-bmc-pico

## v0.3.0
* Add STM32F030 support to neotron-bmc-pico

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The NBMC appears to the main Neotron system processor as an Expansion Device. As

### Neotron Pico

The NBMC firmware is designed to run on an ST Micro STM32F0 (STM32F031K6T6) microcontroller, as fitted to a [Neotron Pico](https://github.com/neotron-compute/neotron-pico).
The NBMC firmware is designed to run on an ST Micro STM32F0 (STM32F030K6T6) microcontroller, as fitted to a [Neotron Pico](https://github.com/neotron-compute/neotron-pico).

See the [board-specific README](./neotron-bmc-pico/README.md)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed datasheets/ds10111-stm32f031k6.pdf.gz
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion neotron-bmc-nucleo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Jonathan 'theJPster' Pallant <github@thejpster.org.uk>", "Aïssata 'Ai' Maiga <aimaiga2@gmail.com>"]
name = "neotron-bmc-nucleo"
edition = "2018"
version = "0.3.0"
version = "0.3.1"

[dependencies]
cortex-m = "0.7.1"
Expand Down
2 changes: 1 addition & 1 deletion neotron-bmc-nucleo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This folder is for the Board Management Controller (BMC) when running on an STM3

## Hardware Interface

The NBMC also supports running on an ST Nucleo-F401RE, for development and debugging purposes. The STM32F401RET6U MCU has:
This firmware runs on an ST Nucleo-F401RE, for development and debugging purposes. The STM32F401RET6U MCU has:

* 32-bit Arm Cortex-M4 Core
* 3.3V I/O (5V tolerant)
Expand Down
17 changes: 10 additions & 7 deletions neotron-bmc-nucleo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
//! Neotron BMC Firmware
//!
//! This is the firmware for the Neotron Board Management Controller (BMC). It
//! controls the power, reset, UART and PS/2 ports, but running on an ST Nucleo
//! instead of a real Neotron board. For more details, see the `README.md` file.
//!
//! # Licence
//! This source code as a whole is licensed under the GPL v3. Third-party crates
//! are covered by their respective licences.

#![no_main]
#![no_std]

///! Neotron BMC Firmware
///!
///! This is the firmware for the Neotron Board Management Controller (BMC). It controls the power, reset, UART and PS/2 ports on a Neotron mainboard.
///! For more details, see the `README.md` file.
///!
///! # Licence
///! This source code as a whole is licensed under the GPL v3. Third-party crates are covered by their respective licences.
use cortex_m::interrupt::free as disable_interrupts;
use heapless::spsc::{Consumer, Producer, Queue};
use rtic::app;
Expand Down
2 changes: 1 addition & 1 deletion neotron-bmc-pico/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-run --chip STM32F031K6Tx"
runner = "probe-run --chip STM32F030K6Tx"
rustflags = [
"-C", "linker=flip-link",
"-C", "link-arg=-Tlink.x",
Expand Down
44 changes: 18 additions & 26 deletions neotron-bmc-pico/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
authors = ["Jonathan 'theJPster' Pallant <github@thejpster.org.uk>"]
name = "neotron-bmc-pico"
edition = "2018"
version = "0.3.0"
version = "0.3.1"

[dependencies]
defmt = "0.3"
cortex-m = { version = "0.7.5", features = ["inline-asm"] }
defmt-rtt = "0.3"
cortex-m-rtic = "1.0"
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
stm32f0xx-hal = { version = "0.18", features = ["rt"] }
debouncr = "0.2"
defmt = "0.3"
defmt-rtt = "0.3"
heapless= "0.7"
systick-monotonic = "1.0.0"
panic-probe = { version = "0.3", features = ["print-defmt"] }
stm32f0xx-hal = { version = "0.17", features = ["stm32f030x6", "rt"] }
systick-monotonic = "1.0"

[features]
# set logging levels here
Expand All @@ -36,44 +36,36 @@ defmt-error = []
[profile.dev]
codegen-units = 1
debug = 2
debug-assertions = true # <-
debug-assertions = true
incremental = false
opt-level = 3 # <-
overflow-checks = true # <-
opt-level = 3
overflow-checks = true

# cargo test
[profile.test]
codegen-units = 1
debug = 2
debug-assertions = true # <-
debug-assertions = true
incremental = false
opt-level = 3 # <-
overflow-checks = true # <-
opt-level = 3
overflow-checks = true

# cargo build/run --release
[profile.release]
codegen-units = 1
debug = 2
debug-assertions = false # <-
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 3 # <-
overflow-checks = false # <-
opt-level = 3
overflow-checks = false

# cargo test --release
[profile.bench]
codegen-units = 1
debug = 2
debug-assertions = false # <-
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 3 # <-
overflow-checks = false # <-

# uncomment this to switch from the crates.io version of defmt to its git version
# check app-template's README for instructions
# [patch.crates-io]
# defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
# defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
# defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
opt-level = 3
overflow-checks = false
27 changes: 13 additions & 14 deletions neotron-bmc-pico/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

## Introduction

This folder is for the Board Management Controller (BMC) on a [Neotron Pico](https://github.com/neotron-compute/neotron-pico).
This firmware is designed to run on an ST Micro STM32F0 (STM32F030K6T6) microcontroller as fitted to the Neotron Pico.

## Hardware Interface

The NBMC firmware is designed to run on an ST Micro STM32F0 (STM32F031K6T6 or STM32F030K6T6) microcontroller
The MCU has:

* 32-bit Arm Cortex-M0+ Core
* 3.3V I/O (5V tolerant)
* 3.3V I/O (mostly 5V tolerant)
* 32 KiB Flash
* 4 KiB SRAM
* LQFP-32 package (0.8mm pitch, 7mm x 7mm)
* LQFP-32 package (0.8mm pitch)


| Pin | Name | Signal | Function |
Expand All @@ -27,8 +25,8 @@ The NBMC firmware is designed to run on an ST Micro STM32F0 (STM32F031K6T6 or ST
| 11 | PA5 | SPI1_SCK | SPI Clock Input |
| 12 | PA6 | SPI1_CIPO | SPI Data Output |
| 13 | PA7 | SPI1_COPI | SPI Data Input |
| 14 | PB0 | LED0 | Output for Power LED |
| 15 | PB1 | LED1 | Output for Status LED |
| 14 | PB0 | LED | Output for Power LED |
| 15 | PB1 | BUZZER | PWM Output for Buzzer |
| 18 | PA8 | IRQ_nHOST | Interrupt Output to the Host (active low) |
| 19 | PA9 | USART1_TX | UART Transmit Output |
| 20 | PA10 | USART1_RX | UART Receive Input |
Expand All @@ -45,8 +43,9 @@ The NBMC firmware is designed to run on an ST Micro STM32F0 (STM32F031K6T6 or ST

Note that in the above table, the UART signals are wired as _Data Terminal Equipment (DTE)_ (i.e. like a PC, not like a Modem). Connect the NMBC *UART Transmit Output* pin to the *Input* pin of something like an FTDI TTL-232R-3V3 cable.

This hardware design should also be pin-compatible with the following SoCs (although this firmware may need changes):
This design should also be pin-compatible with the following SoCs (although this firmware may need changes):

* STM32F031K6Tx
* STM32F042K4Tx
* STM32F042K6Tx
* STM32L071KBTx
Expand All @@ -59,7 +58,7 @@ Note that not all STM32 pins are 5V-tolerant, and the PS/2 protocol is a 5V open

## Build Requirements

1. rustup and Rust
1. `rustup` and Rust
- see https://www.rust-lang.org
2. The `thumbv6m-none-eabi` target
- run `rustup target add thumbv6m-none-eabi`
Expand All @@ -71,17 +70,17 @@ Note that not all STM32 pins are 5V-tolerant, and the PS/2 protocol is a 5V open
Then to build and flash for an STM32F031K6T6, connect a probe supported by probe-rs (such as a SEGGER J-Link, or an ST-Link) and run:

```
$ cargo run --release --features stm32f031
$ DEFMT_LOG=info cargo run --release
```

For an STM32F030K6T6, run:
You should see logging messages from the board on your terminal. To increase the logging level, try:

Then to build and flash, connect a probe supported by probe-rs (such as a SEGGER J-Link, or an ST-Link) and run:

```
$ cargo run --release --features stm32f030x6
$ DEFMT_LOG=debug cargo run --release
```

## Licence

This source code as a whole is licensed under the GPL v3. Third-party crates are covered by their respective licences.

8 changes: 7 additions & 1 deletion neotron-bmc-pico/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ fn main() {
println!("cargo:rustc-link-search={}", out.display());
println!("cargo:rerun-if-changed=memory.x");

// Generate a file containing the firmware version
let version_output = std::process::Command::new("git")
.current_dir(env::var_os("CARGO_MANIFEST_DIR").unwrap())
.args(&["describe", "--tags", "--all", "--dirty"])
.output()
.expect("running git-describe");
assert!(version_output.status.success());

std::fs::write(out.join("version.txt"), version_output.stdout).expect("writing version file");
// Remove the trailing newline
let mut output = version_output.stdout;
output.pop();

// Write the file
std::fs::write(out.join("version.txt"), output).expect("writing version file");
}
5 changes: 4 additions & 1 deletion neotron-bmc-pico/openocd.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ source [find interface/stlink.cfg]

transport select hla_swd

gdb_flash_program enable
gdb_breakpoint_override hard

set WORKAREASIZE 0x2000
source [find target/stm32f0x.cfg]

reset_config srst_only
# reset_config srst_only

0 comments on commit 50df318

Please sign in to comment.