-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,473 additions
and
826 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
on: [push, pull_request] | ||
name: Upload Release | ||
|
||
jobs: | ||
build: | ||
name: Build and release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
with: | ||
submodules: true | ||
|
||
- name: Add targets | ||
run: | | ||
rustup target add thumbv6m-none-eabi | ||
rustup target add thumbv7em-none-eabihf | ||
- 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-nucleo | ||
run: | | ||
cd neotron-bmc-nucleo | ||
cargo build --release --verbose --target=thumbv7em-none-eabihf | ||
- name: Get Branch Name | ||
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') | ||
id: branch_name | ||
run: | | ||
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} | ||
- name: Create Release | ||
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload files to Release | ||
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
neotron-bmc-pico/target/thumbv6m-none-eabi/release/neotron-bmc-pico-f030 | ||
neotron-bmc-pico/target/thumbv6m-none-eabi/release/neotron-bmc-pico-f031 | ||
neotron-bmc-nucleo/target/thumbv7em-none-eabihf/release/neotron-bmc-nucleo | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/target | ||
Cargo.lock | ||
*/target | ||
target/ | ||
*Cargo.lock* | ||
*/Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[target.'cfg(all(target_arch = "arm", target_os = "none"))'] | ||
runner = "probe-run --chip STM32F401RETx" | ||
rustflags = [ | ||
"-C", "linker=flip-link", | ||
"-C", "link-arg=-Tlink.x", | ||
"-C", "link-arg=-Tdefmt.x", | ||
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x | ||
# See https://github.com/rust-embedded/cortex-m-quickstart/pull/95 | ||
"-C", "link-arg=--nmagic", | ||
] | ||
|
||
[build] | ||
target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 | ||
|
||
[alias] | ||
rb = "run --bin" | ||
rrb = "run --release --bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[package] | ||
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" | ||
|
||
[dependencies] | ||
cortex-m = "0.7.1" | ||
cortex-m-rt = "0.7" | ||
defmt = "0.3.0" | ||
defmt-rtt = "0.3.0" | ||
cortex-m-rtic = "1.0" | ||
panic-probe = { version = "0.3.0", features = ["print-defmt"] } | ||
stm32f4xx-hal = { version = "0.11", features = ["stm32f401", "rt"] } | ||
debouncr = "0.2" | ||
heapless= "0.7" | ||
fugit = "0.3" | ||
|
||
[features] | ||
# set logging levels here | ||
default = [ | ||
"defmt-default", | ||
# "dependency-a/defmt-trace", | ||
] | ||
|
||
# do NOT modify these features | ||
defmt-default = [] | ||
defmt-trace = [] | ||
defmt-debug = [] | ||
defmt-info = [] | ||
defmt-warn = [] | ||
defmt-error = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Neotron-BMC-Nucleo | ||
|
||
## Introduction | ||
|
||
This folder is for the Board Management Controller (BMC) when running on an STM32F4 Nucleo board. | ||
|
||
## Hardware Interface | ||
|
||
The NBMC also supports running 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) | ||
* 512 KiB Flash | ||
* 96 KiB SRAM | ||
* LQFP64 package (10 * 10 mm) | ||
|
||
| CPU Pin | Nucleo-64 Pin | Name | Signal | Function | | ||
| ------- | ------------- | ---- | ----------- | ----------------------------------------- | | ||
| 2 | CN7 23 | PC13 | BUTTON_nPWR | Power Button Input (active low) | | ||
| 33 | CN10 16 | PB12 | BUTTON_nRST | Reset Button Input (active low) | | ||
| 34 | CN10 30 | PB13 | MON_3V3 | 3.3V rail monitor Input (1.65V nominal) | | ||
| 35 | CN10 28 | PB14 | MON_5V | 5.0V rail monitor Input (1.65V nominal) | | ||
| 36 | CN10 26 | PB15 | nSYS_RESET | System Reset Output (active low) | | ||
| 8 | CN8 6 | PC0 | DC_ON | PSU Enable Output (active high) | | ||
| 20 | CN8 3 | PA4 | SPI1_NSS | SPI Chip Select Input (active low) ?? | | ||
| 21 | CN5 6 | PA5 | SPI1_SCK | SPI Clock Input | | ||
| 22 | CN5 5 | PA6 | SPI1_MISO | SPI Data Output | | ||
| 23 | CN5 4 | PA7 | SPI1_MOSI | SPI Data Input | | ||
| 9 | CN6 5 | PC1 | POWER_LED | Output for Power LED | | ||
| 10 | CN7 35 | PC2 | STATUS_LED | Output for Status LED | | ||
| 11 | CN7 37 | PC3 | IRQ_nHOST | Interrupt Output to the Host (active low) | | ||
| 42 | CN10 21 | PA9 | USART1_TX | UART Transmit Output | | ||
| 43 | CN10 33 | PA10 | USART1_RX | UART Receive Input | | ||
| 44 | CN10 14 | PA11 | USART1_CTS | UART Clear-to-Send Output | | ||
| 45 | CN10 12 | PA12 | USART1_RTS | UART Ready-to-Receive Input | | ||
| 46 | CN7 13 | PA13 | SWDIO | SWD Progamming Data Input | | ||
| 49 | CN7 15 | PA14 | SWCLK | SWD Programming Clock Input | | ||
| 25 | CN10 6 | PC5 | PS2_CLK0 | Keyboard Clock Input | | ||
| 26 | CN8 4 | PB0 | PS2_CLK1 | Mouse Clock Input | | ||
| 27 | CN10 24 | PB1 | PS2_DAT0 | Keyboard Data Input | | ||
| 28 | CN10 22 | PB2 | PS2_DAT1 | Mouse Data Input | | ||
| 58 | CN10 17 | PB6 | I2C1_SCL | I²C Clock | | ||
| 59 | CN7 21 | PB7 | I2C1_SDA | I²C Data | | ||
|
||
## Build Requirements | ||
|
||
1. rustup and Rust | ||
- see https://www.rust-lang.org | ||
2. The `thumbv7em-none-eabi` target | ||
- run `rustup target add target=thumbv7em-none-eabi` | ||
3. `probe-run` | ||
- run `cargo install probe-run` from your `$HOME` dir (not this folder!) | ||
4. `flip-link` | ||
- run `cargo install flip-link` from your `$HOME` dir (not this folder!) | ||
|
||
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//! This is the build-script for the Neotron BMC. | ||
//! | ||
//! It just copies the memory.x file somewhere Cargo can find it, then generates a version header. | ||
use std::env; | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
// Put the linker script somewhere the linker can find it | ||
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | ||
File::create(out.join("memory.x")) | ||
.unwrap() | ||
.write_all(include_bytes!("memory.x")) | ||
.unwrap(); | ||
println!("cargo:rustc-link-search={}", out.display()); | ||
println!("cargo:rerun-if-changed=memory.x"); | ||
|
||
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"); | ||
} |
Oops, something went wrong.