Skip to content

Commit 4b3f7d6

Browse files
committed
Merge branch 'release/v0.3.0'
2 parents 4011af3 + 483a22d commit 4b3f7d6

File tree

29 files changed

+1473
-826
lines changed

29 files changed

+1473
-826
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
on: [push, pull_request]
2+
name: Upload Release
3+
4+
jobs:
5+
build:
6+
name: Build and release
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v1
11+
with:
12+
submodules: true
13+
14+
- name: Add targets
15+
run: |
16+
rustup target add thumbv6m-none-eabi
17+
rustup target add thumbv7em-none-eabihf
18+
19+
- name: Install flip-link
20+
run: cd / && cargo install --debug flip-link
21+
22+
- name: Build neotron-bmc-pico for F030
23+
run: |
24+
cd neotron-bmc-pico
25+
cargo build --release --verbose --target=thumbv6m-none-eabi --features=stm32f030x6
26+
cd target/thumbv6m-none-eabi/release
27+
mv neotron-bmc-pico neotron-bmc-pico-f030
28+
29+
- name: Build neotron-bmc-pico for F031
30+
run: |
31+
cd neotron-bmc-pico
32+
cargo build --release --verbose --target=thumbv6m-none-eabi --features=stm32f031
33+
cd target/thumbv6m-none-eabi/release
34+
mv neotron-bmc-pico neotron-bmc-pico-f031
35+
36+
- name: Build neotron-bmc-nucleo
37+
run: |
38+
cd neotron-bmc-nucleo
39+
cargo build --release --verbose --target=thumbv7em-none-eabihf
40+
41+
- name: Get Branch Name
42+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
43+
id: branch_name
44+
run: |
45+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
46+
47+
- name: Create Release
48+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
49+
id: create_release
50+
uses: actions/create-release@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
tag_name: ${{ github.ref }}
55+
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
56+
draft: false
57+
prerelease: false
58+
59+
- name: Upload files to Release
60+
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
61+
uses: softprops/action-gh-release@v1
62+
with:
63+
files: |
64+
neotron-bmc-pico/target/thumbv6m-none-eabi/release/neotron-bmc-pico-f030
65+
neotron-bmc-pico/target/thumbv6m-none-eabi/release/neotron-bmc-pico-f031
66+
neotron-bmc-nucleo/target/thumbv7em-none-eabihf/release/neotron-bmc-nucleo
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/format.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ jobs:
99
- uses: actions/checkout@v1
1010
- name: Add Tool
1111
run: rustup component add rustfmt
12-
- name: Check Format
13-
run: cargo fmt -- --check
12+
- name: Check format neotron-bmc-pico
13+
run: cd neotron-bmc-pico && cargo fmt -- --check
14+
- name: Check format neotron-bmc-nucleo
15+
run: cd neotron-bmc-nucleo && cargo fmt -- --check

.github/workflows/release.yml

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

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
/target
2-
Cargo.lock
1+
*/target
2+
target/
3+
*Cargo.lock*
4+
*/Cargo.lock

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
* None
66

7+
## v0.3.0
8+
* Add STM32F030 support to neotron-bmc-pico
9+
710
## v0.2.0
811
* Change to blink power LED when in standby
912
* Actually controls DC power and reset (but doesn't check the voltage rails yet)

README.md

Lines changed: 12 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -20,56 +20,17 @@ The NBMC appears to the main Neotron system processor as an Expansion Device. As
2020

2121
## Hardware Interface
2222

23-
The NBMC firmware is designed to run on an ST Micro STM32F0 (STM32F031K6T6) microcontroller
24-
25-
* 32-bit Arm Cortex-M0+ Core
26-
* 3.3V I/O (5V tolerant)
27-
* 32 KiB Flash
28-
* 4 KiB SRAM
29-
* LQFP-32 package (0.8mm pitch)
30-
31-
32-
| Pin | Name | Signal | Function |
33-
| :--- | :--- | :---------- | :------------------------------------------- |
34-
| 02 | PF0 | BUTTON_nPWR | Power Button Input (active low) |
35-
| 03 | PF1 | BUTTON_nRST | Reset Button Input (active low) |
36-
| 06 | PA0 | MON_3V3 | 3.3V rail monitor Input (1.65V nominal) |
37-
| 07 | PA1 | MON_5V | 5.0V rail monitor Input (1.65V nominal) |
38-
| 08 | PA2 | nSYS_RESET | System Reset Output (active low) |
39-
| 09 | PA3 | DC_ON | PSU Enable Output (active high) |
40-
| 10 | PA4 | SPI1_nCS | SPI Chip Select Input (active low) |
41-
| 11 | PA5 | SPI1_SCK | SPI Clock Input |
42-
| 12 | PA6 | SPI1_CIPO | SPI Data Output |
43-
| 13 | PA7 | SPI1_COPI | SPI Data Input |
44-
| 14 | PB0 | LED0 | Output for Power LED |
45-
| 15 | PB1 | LED1 | Output for Status LED |
46-
| 18 | PA8 | IRQ_nHOST | Interrupt Output to the Host (active low) |
47-
| 19 | PA9 | USART1_TX | UART Transmit Output |
48-
| 20 | PA10 | USART1_RX | UART Receive Input |
49-
| 21 | PA11 | USART1_CTS | UART Clear-to-Send Output |
50-
| 22 | PA12 | USART1_RTS | UART Ready-to-Receive Input |
51-
| 23 | PA13 | SWDIO | SWD Progamming Data Input |
52-
| 24 | PA14 | SWCLK | SWD Programming Clock Input |
53-
| 25 | PA15 | PS2_CLK0 | Keyboard Clock Input |
54-
| 26 | PB3 | PS2_CLK1 | Mouse Clock Input |
55-
| 27 | PB4 | PS2_DAT0 | Keyboard Data Input |
56-
| 28 | PB5 | PS2_DAT1 | Mouse Data Input |
57-
| 29 | PB6 | I2C1_SCL | I²C Clock |
58-
| 30 | PB7 | I2C1_SDA | I²C Data |
59-
60-
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).
61-
62-
This design should also be pin-compatible with the following SoCs (although this firmware may need changes):
63-
64-
* STM32F042K4Tx
65-
* STM32F042K6Tx
66-
* STM32L071KBTx
67-
* STM32L071KZTx
68-
* STM32L072KZTx
69-
* STM32L081KZTx
70-
* STM32L082KZTx
71-
72-
Note that not all STM32 pins are 5V-tolerant, and the PS/2 protocol is a 5V open-collector system, so ensure that whichever part you pick has 5V-tolerant pins (marked `FT` or `FTt` in the datasheet) for the PS/2 signals. All of the parts above _should_ be OK, but they haven't been tested. Let us know if you try one!
23+
### Neotron Pico
24+
25+
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).
26+
27+
See the [board-specific README](./neotron-bmc-pico/README.md)
28+
29+
### Nucleo-F401
30+
31+
The NBMC firmware can also run on an ST Micro STM32F4 Nucleo board.
32+
33+
See the [board-specific README](./neotron-bmc-nucleo/README.md)
7334

7435
## SPI Communications Protocol
7536

@@ -346,20 +307,7 @@ TODO
346307

347308
## Build Requirements
348309

349-
1. rustup and Rust
350-
- see https://www.rust-lang.org
351-
2. The `thumbv6m-none-eabi` target
352-
- run `rustup target add thumbv6m-none-eabi`
353-
3. `probe-run`
354-
- run `cargo install probe-run` from your `$HOME` dir (not this folder!)
355-
4. `flip-link`
356-
- run `cargo install flip-link` from your `$HOME` dir (not this folder!)
357-
358-
Then to build and flash, connect a probe supported by probe-rs (such as a SEGGER J-Link, or an ST-Link) and run:
359-
360-
```
361-
$ cargo run --bin neotron-bmc --release
362-
```
310+
Build requirements are available for [Neotron-BMC-pico](neotron-bmc-pico/README.md) and [Neotron-BMC-nucleo](neotron-bmc-nucleo/README.md).
363311

364312
## Licence
365313

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2+
runner = "probe-run --chip STM32F401RETx"
3+
rustflags = [
4+
"-C", "linker=flip-link",
5+
"-C", "link-arg=-Tlink.x",
6+
"-C", "link-arg=-Tdefmt.x",
7+
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
8+
# See https://github.com/rust-embedded/cortex-m-quickstart/pull/95
9+
"-C", "link-arg=--nmagic",
10+
]
11+
12+
[build]
13+
target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7
14+
15+
[alias]
16+
rb = "run --bin"
17+
rrb = "run --release --bin"

neotron-bmc-nucleo/Cargo.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[package]
2+
authors = ["Jonathan 'theJPster' Pallant <github@thejpster.org.uk>", "Aïssata 'Ai' Maiga <aimaiga2@gmail.com>"]
3+
name = "neotron-bmc-nucleo"
4+
edition = "2018"
5+
version = "0.3.0"
6+
7+
[dependencies]
8+
cortex-m = "0.7.1"
9+
cortex-m-rt = "0.7"
10+
defmt = "0.3.0"
11+
defmt-rtt = "0.3.0"
12+
cortex-m-rtic = "1.0"
13+
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
14+
stm32f4xx-hal = { version = "0.11", features = ["stm32f401", "rt"] }
15+
debouncr = "0.2"
16+
heapless= "0.7"
17+
fugit = "0.3"
18+
19+
[features]
20+
# set logging levels here
21+
default = [
22+
"defmt-default",
23+
# "dependency-a/defmt-trace",
24+
]
25+
26+
# do NOT modify these features
27+
defmt-default = []
28+
defmt-trace = []
29+
defmt-debug = []
30+
defmt-info = []
31+
defmt-warn = []
32+
defmt-error = []

neotron-bmc-nucleo/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Neotron-BMC-Nucleo
2+
3+
## Introduction
4+
5+
This folder is for the Board Management Controller (BMC) when running on an STM32F4 Nucleo board.
6+
7+
## Hardware Interface
8+
9+
The NBMC also supports running on an ST Nucleo-F401RE, for development and debugging purposes. The STM32F401RET6U MCU has:
10+
11+
* 32-bit Arm Cortex-M4 Core
12+
* 3.3V I/O (5V tolerant)
13+
* 512 KiB Flash
14+
* 96 KiB SRAM
15+
* LQFP64 package (10 * 10 mm)
16+
17+
| CPU Pin | Nucleo-64 Pin | Name | Signal | Function |
18+
| ------- | ------------- | ---- | ----------- | ----------------------------------------- |
19+
| 2 | CN7 23 | PC13 | BUTTON_nPWR | Power Button Input (active low) |
20+
| 33 | CN10 16 | PB12 | BUTTON_nRST | Reset Button Input (active low) |
21+
| 34 | CN10 30 | PB13 | MON_3V3 | 3.3V rail monitor Input (1.65V nominal) |
22+
| 35 | CN10 28 | PB14 | MON_5V | 5.0V rail monitor Input (1.65V nominal) |
23+
| 36 | CN10 26 | PB15 | nSYS_RESET | System Reset Output (active low) |
24+
| 8 | CN8 6 | PC0 | DC_ON | PSU Enable Output (active high) |
25+
| 20 | CN8 3 | PA4 | SPI1_NSS | SPI Chip Select Input (active low) ?? |
26+
| 21 | CN5 6 | PA5 | SPI1_SCK | SPI Clock Input |
27+
| 22 | CN5 5 | PA6 | SPI1_MISO | SPI Data Output |
28+
| 23 | CN5 4 | PA7 | SPI1_MOSI | SPI Data Input |
29+
| 9 | CN6 5 | PC1 | POWER_LED | Output for Power LED |
30+
| 10 | CN7 35 | PC2 | STATUS_LED | Output for Status LED |
31+
| 11 | CN7 37 | PC3 | IRQ_nHOST | Interrupt Output to the Host (active low) |
32+
| 42 | CN10 21 | PA9 | USART1_TX | UART Transmit Output |
33+
| 43 | CN10 33 | PA10 | USART1_RX | UART Receive Input |
34+
| 44 | CN10 14 | PA11 | USART1_CTS | UART Clear-to-Send Output |
35+
| 45 | CN10 12 | PA12 | USART1_RTS | UART Ready-to-Receive Input |
36+
| 46 | CN7 13 | PA13 | SWDIO | SWD Progamming Data Input |
37+
| 49 | CN7 15 | PA14 | SWCLK | SWD Programming Clock Input |
38+
| 25 | CN10 6 | PC5 | PS2_CLK0 | Keyboard Clock Input |
39+
| 26 | CN8 4 | PB0 | PS2_CLK1 | Mouse Clock Input |
40+
| 27 | CN10 24 | PB1 | PS2_DAT0 | Keyboard Data Input |
41+
| 28 | CN10 22 | PB2 | PS2_DAT1 | Mouse Data Input |
42+
| 58 | CN10 17 | PB6 | I2C1_SCL | I²C Clock |
43+
| 59 | CN7 21 | PB7 | I2C1_SDA | I²C Data |
44+
45+
## Build Requirements
46+
47+
1. rustup and Rust
48+
- see https://www.rust-lang.org
49+
2. The `thumbv7em-none-eabi` target
50+
- run `rustup target add target=thumbv7em-none-eabi`
51+
3. `probe-run`
52+
- run `cargo install probe-run` from your `$HOME` dir (not this folder!)
53+
4. `flip-link`
54+
- run `cargo install flip-link` from your `$HOME` dir (not this folder!)
55+
56+
Then to build and flash, connect a probe supported by probe-rs (such as a SEGGER J-Link, or an ST-Link) and run:
57+
58+
```
59+
$ cargo run --release
60+
```

0 commit comments

Comments
 (0)