Skip to content

Commit

Permalink
- Added examples lora_spi_send, lora_spi_receive, and lora_spi_gps. T…
Browse files Browse the repository at this point in the history
…hese work on

  several different MCUs. Documentation for building and running is in lora_spi_send.rs.

- Added directory memoryMaps/ and build.rs to simplify linking.

- Added workflow in .github/workflow/rust.yml for checking examples.

- Added reference to examples in README.
  • Loading branch information
pdgilbert committed Mar 11, 2021
1 parent 8a97603 commit ff27826
Show file tree
Hide file tree
Showing 29 changed files with 3,517 additions and 270 deletions.
29 changes: 29 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.thumbv7m-none-eabi]
#runner = 'arm-none-eabi-gdb'
runner = "gdb-multiarch -q -x openocd.gdb"
rustflags = [
"-C", "link-arg=-Tlink.x",
]

[target.thumbv7em-none-eabi]
#runner = 'arm-none-eabi-gdb'
runner = "gdb-multiarch -q -x openocd.gdb"
rustflags = [
"-C", "link-arg=-Tlink.x",
]

[target.thumbv7em-none-eabihf]
#runner = 'arm-none-eabi-gdb'
runner = "gdb-multiarch -q -x openocd.gdb"
rustflags = [
"-C", "link-arg=-Tlink.x",
]

[target.riscv32imac-unknown-none-elf]
#runner = 'riscv64-unknown-elf-gdb -x openocd.gdb'
runner = "gdb-multiarch -q -x openocd.gdb"
rustflags = [
#"-C", "link-arg=-memory-CB.x",
"-C", "link-arg=-Tlink.x",
]
202 changes: 143 additions & 59 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust

on:
push:
branches: [ master ]
branches: [ master, testing-e-h_0.2.4, examples-testing ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
Expand All @@ -26,24 +26,26 @@ jobs:
use_cross: false
experimental: false
args: --features util,driver-pal/hal-cp2130,driver-pal/hal-linux
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
output: sx127x-util
use_cross: false
experimental: true
args: --features util,driver-pal/hal-cp2130,driver-pal/hal-linux
- target: x86_64-apple-darwin
os: macos-latest
output: sx127x-util
use_cross: false
experimental: false
args: --no-default-features --features util,driver-pal/hal-cp2130
- target: x86_64-pc-windows-msvc
os: windows-latest
output: sx127x-util.exe
use_cross: false
experimental: true
args: --no-default-features --features util,driver-pal/hal-cp2130
#
# probably want all this on master, but it time consuming when testing examples
# - target: armv7-unknown-linux-gnueabihf
# os: ubuntu-latest
# output: sx127x-util
# use_cross: false
# experimental: true
# args: --features util,driver-pal/hal-cp2130,driver-pal/hal-linux
# - target: x86_64-apple-darwin
# os: macos-latest
# output: sx127x-util
# use_cross: false
# experimental: false
# args: --no-default-features --features util,driver-pal/hal-cp2130
# - target: x86_64-pc-windows-msvc
# os: windows-latest
# output: sx127x-util.exe
# use_cross: false
# experimental: true
# args: --no-default-features --features util,driver-pal/hal-cp2130

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -93,47 +95,129 @@ jobs:
key: ${{ matrix.os }}-${{ matrix.target }}
path: $VCPKG_DIRECTORY

- name: Build release
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.use_cross }}
command: build
args: --target ${{ matrix.target }} --release ${{ matrix.args }}

- name: Copy / Rename utility
run: |
cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }}-${{ matrix.target }}
tar -cvf sx127x-util-${{ matrix.target }}.tgz ${{ matrix.output }}-${{ matrix.target }}
- name: Upload utility artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.output }}-${{ matrix.target }}
path: ${{ matrix.output }}-${{ matrix.target }}

- name: Upload utility binary to release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sx127x-util-${{ matrix.target }}.tgz
asset_name: sx127x-util-${{ matrix.target }}.tgz
tag: ${{ github.ref }}
overwrite: true

release:
name: Create release
test_examples:
name: Test examples
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
continue-on-error: true
strategy:
matrix:
mcu: [stm32f042, stm32f030xc, stm32f103, stm32f100, stm32f101, stm32f303xc,
stm32f401, stm32f411, stm32h742, stm32l0x2, stm32l100, stm32l151, stm32l4x2, ]
include:
- mcu: stm32f042
hal: "stm32f0xx"
trg: "thumbv6m-none-eabi"
- mcu: stm32f030xc
hal: "stm32f0xx"
trg: "thumbv6m-none-eabi"
- mcu: stm32f100
hal: "stm32f1xx"
trg: "thumbv7m-none-eabi"
- mcu: stm32f101
hal: "stm32f1xx"
trg: "thumbv7m-none-eabi"
- mcu: stm32f103
hal: "stm32f1xx"
trg: "thumbv7m-none-eabi"
- mcu: stm32f303xc
hal: "stm32f3xx"
trg: "thumbv7em-none-eabihf"
- mcu: stm32f401
hal: "stm32f4xx"
trg: "thumbv7em-none-eabihf"
- mcu: stm32f411
hal: "stm32f4xx"
trg: "thumbv7em-none-eabihf"
- mcu: stm32h742
hal: "stm32h7xx"
trg: "thumbv7em-none-eabihf"
- mcu: stm32l0x2
hal: "stm32l0xx"
trg: "thumbv6m-none-eabi"
- mcu: stm32l100
hal: "stm32l1xx"
trg: "thumbv7m-none-eabi"
- mcu: stm32l151
hal: "stm32l1xx"
trg: "thumbv7m-none-eabi"
- mcu: stm32l4x2
hal: "stm32l4xx"
trg: "thumbv7em-none-eabi"
steps:

- name: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
#- name: Build
# uses: actions-rs/cargo@v1
# with:
# command: build
# args: --no-default-features --release --features ${{ matrix.mcu }}
- name: Build example lora_spi_send
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --release --target ${{ matrix.trg }} --features ${{ matrix.hal }},${{ matrix.mcu }} --example lora_spi_send
use-cross: true
- name: Build example lora_spi_receive
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --release --target ${{ matrix.trg }} --features ${{ matrix.hal }},${{ matrix.mcu }} --example lora_spi_receive
use-cross: true
- name: Build example lora_spi_gps
uses: actions-rs/cargo@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Release ${{ github.ref }}
command: build
args: --no-default-features --release --target ${{ matrix.trg }} --features ${{ matrix.hal }},${{ matrix.mcu }} --example lora_spi_gps
use-cross: true

#
# probably want all this on master, but not on forks and branches
# - name: Build release
# uses: actions-rs/cargo@v1
# with:
# use-cross: ${{ matrix.use_cross }}
# command: build
# args: --target ${{ matrix.target }} --release ${{ matrix.args }}
#
# - name: Copy / Rename utility
# run: |
# cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }}-${{ matrix.target }}
# tar -cvf sx127x-util-${{ matrix.target }}.tgz ${{ matrix.output }}-${{ matrix.target }}
#
# - name: Upload utility artifacts
# uses: actions/upload-artifact@v1
# with:
# name: ${{ matrix.output }}-${{ matrix.target }}
# path: ${{ matrix.output }}-${{ matrix.target }}
#
# - name: Upload utility binary to release
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: sx127x-util-${{ matrix.target }}.tgz
# asset_name: sx127x-util-${{ matrix.target }}.tgz
# tag: ${{ github.ref }}
# overwrite: true

#
# probably want all this on master, but not on forks and branches
# release:
# name: Create release
# runs-on: ubuntu-latest
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# steps:
#
# - name: Create Release
# uses: actions/create-release@v1
# id: create_release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: Release ${{ github.ref }}

39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit ff27826

Please sign in to comment.