Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ jobs:
build:
runs-on: ubuntu-latest

continue-on-error: ${{ matrix.experimental || false }}

strategy:
matrix:
rust:
- 1.63.0
- nightly-2022-08-12 #Since Rust 1.63.0 came out Aug 11 2022, we use nightly from the day after.
include:
- rust: nightly-2022-08-12
experimental: true

steps:
- uses: actions/checkout@v2

Expand All @@ -30,7 +19,7 @@ jobs:
pip3 install --user python-dateutil linkchecker

- name: Cache installed binaries
uses: actions/cache@v4
uses: actions/cache@v4
id: cache-bin
with:
path: ~/cache-bin
Expand All @@ -57,9 +46,9 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: 1.89.0
override: true
components: rustfmt, clippy, llvm-tools-preview
components: rustfmt, clippy, llvm-tools
target: thumbv7m-none-eabi

- name: Install arm-none-eabi-gcc and qemu
Expand All @@ -85,8 +74,6 @@ jobs:

- name: Test
run: bash ci/script.sh
env:
RUST_VERSION: ${{ matrix.rust }}

deploy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion ci/asm/app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
edition = "2018"
edition = "2024"
name = "app"
version = "0.1.0"

Expand Down
33 changes: 19 additions & 14 deletions ci/asm/app/release.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ app: file format elf32-littlearm

Disassembly of section .text:

<HardFault>:
b 0x40 <HardFault> @ imm = #-0x4
00000040 <HardFault>:
40: push {r7, lr}
42: mov r7, sp
44: b 0x44 <HardFault+0x4> @ imm = #-0x4

<main>:
b 0x42 <main> @ imm = #-0x4
00000046 <main>:
46: push {r7, lr}
48: mov r7, sp
4a: b 0x4a <main+0x4> @ imm = #-0x4

<Reset>:
push {r7, lr}
mov r7, sp
bl 0x42 <main> @ imm = #-0xa
trap
0000004c <Reset>:
4c: push {r7, lr}
4e: mov r7, sp
50: bl 0x46 <main> @ imm = #-0xe

<UsageFault>:
b 0x4e <UsageFault> @ imm = #-0x4
00000054 <UsageFault>:
54: push {r7, lr}
56: mov r7, sp
58: b 0x58 <UsageFault+0x4> @ imm = #-0x4

<HardFaultTrampoline>:
mrs r0, msp
b 0x40 <HardFault> @ imm = #-0x18
0000005a <HardFaultTrampoline>:
5a: mrs r0, msp
5e: b 0x40 <HardFault> @ imm = #-0x22
8 changes: 4 additions & 4 deletions ci/asm/app/release.vector_table
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

app: file format elf32-littlearm
Contents of section .vector_table:
0000 00000120 45000000 4f000000 51000000 ... E...O...Q...
0010 4f000000 4f000000 4f000000 00000000 O...O...O.......
0020 00000000 00000000 00000000 4f000000 ............O...
0030 00000000 00000000 4f000000 4f000000 ........O...O...
0000 00000120 4d000000 55000000 5b000000 ... M...U...[...
0010 55000000 55000000 55000000 00000000 U...U...U.......
0020 00000000 00000000 00000000 55000000 ............U...
0030 00000000 00000000 55000000 55000000 ........U...U...
2 changes: 1 addition & 1 deletion ci/asm/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() -> ! {
}

#[allow(non_snake_case)]
#[no_mangle]
#[unsafe(no_mangle)]
pub fn HardFault(_ef: *const u32) -> ! {
loop {}
}
2 changes: 1 addition & 1 deletion ci/asm/app2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
edition = "2018"
edition = "2024"
name = "app"
version = "0.1.0"

Expand Down
2 changes: 1 addition & 1 deletion ci/asm/rt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
edition = "2018"
edition = "2024"
name = "rt"
version = "0.1.0"
authors = ["Jorge Aparicio <jorge@japaric.io>"]
Expand Down
28 changes: 13 additions & 15 deletions ci/asm/rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
use core::panic::PanicInfo;
// use core::ptr;

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn Reset() -> ! {
// Omitted to simplify the `objdump` output
// Initialize RAM
extern "C" {
unsafe extern "C" {
// static mut _sbss: u8;
// static mut _ebss: u8;

Expand All @@ -23,16 +23,16 @@ pub unsafe extern "C" fn Reset() -> ! {
// ptr::copy_nonoverlapping(&_sidata as *const u8, &mut _sdata as *mut u8, count);

// Call user entry point
extern "Rust" {
fn main() -> !;
unsafe extern "Rust" {
safe fn main() -> !;
}

main()
}

// The reset vector, a pointer into the reset handler
#[link_section = ".vector_table.reset_vector"]
#[no_mangle]
#[unsafe(link_section = ".vector_table.reset_vector")]
#[unsafe(no_mangle)]
pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;

#[panic_handler]
Expand All @@ -43,22 +43,22 @@ fn panic(_panic: &PanicInfo<'_>) -> ! {
#[macro_export]
macro_rules! entry {
($path:path) => {
#[export_name = "main"]
#[unsafe(export_name = "main")]
pub unsafe fn __main() -> ! {
// type check the given path
let f: fn() -> ! = $path;

f()
}
}
};
}

pub union Vector {
reserved: u32,
handler: unsafe extern "C" fn(),
}

extern "C" {
unsafe extern "C" {
fn NMI();
fn HardFaultTrampoline(); // <- CHANGED!
fn MemManage();
Expand All @@ -69,16 +69,14 @@ extern "C" {
fn SysTick();
}

#[link_section = ".vector_table.exceptions"]
#[no_mangle]
#[unsafe(link_section = ".vector_table.exceptions")]
#[unsafe(no_mangle)]
pub static EXCEPTIONS: [Vector; 14] = [
Vector { handler: NMI },
Vector { handler: HardFaultTrampoline }, // <- CHANGED!
Vector { handler: MemManage },
Vector { handler: BusFault },
Vector {
handler: UsageFault,
},
Vector { handler: UsageFault },
Vector { reserved: 0 },
Vector { reserved: 0 },
Vector { reserved: 0 },
Expand All @@ -90,7 +88,7 @@ pub static EXCEPTIONS: [Vector; 14] = [
Vector { handler: SysTick },
];

#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn DefaultExceptionHandler() {
loop {}
}
2 changes: 1 addition & 1 deletion ci/asm/rt2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
edition = "2018"
edition = "2024"
name = "rt"
version = "0.1.0"
authors = ["Jorge Aparicio <jorge@japaric.io>"]
2 changes: 1 addition & 1 deletion ci/dma/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
edition = "2018"
edition = "2024"
name = "shared"
version = "0.1.0"

Expand Down
2 changes: 1 addition & 1 deletion ci/exceptions/app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
edition = "2018"
edition = "2024"
name = "app"
version = "0.1.0"

Expand Down
Loading
Loading