From 3e8a5beec5f96a3c219b840dc26df34f76e4ab1e Mon Sep 17 00:00:00 2001 From: Adam Greig Date: Fri, 25 Feb 2022 01:19:34 +0000 Subject: Fix cortex-m-rt qemu test by removing 'nomem' from semihosting_syscall asm, add inline to most cortex_m::asm methods --- cortex-m-rt/examples/qemu.rs | 30 +++++++++++++----------------- cortex-m-rt/link.x.in | 2 ++ cortex-m-rt/src/lib.rs | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) (limited to 'cortex-m-rt') diff --git a/cortex-m-rt/examples/qemu.rs b/cortex-m-rt/examples/qemu.rs index e903404..a8ffd20 100644 --- a/cortex-m-rt/examples/qemu.rs +++ b/cortex-m-rt/examples/qemu.rs @@ -1,28 +1,24 @@ -// #![feature(stdsimd)] #![no_main] #![no_std] -extern crate cortex_m; -extern crate cortex_m_rt as rt; -extern crate cortex_m_semihosting as semihosting; +use core::fmt::Write; -extern crate panic_halt; - -use cortex_m::asm; -use rt::entry; - -#[entry] +#[cortex_m_rt::entry] fn main() -> ! { - use core::fmt::Write; let x = 42; loop { - asm::nop(); - - // write something through semihosting interface - let mut hstdout = semihosting::hio::hstdout().unwrap(); + let mut hstdout = cortex_m_semihosting::hio::hstdout().unwrap(); write!(hstdout, "x = {}\n", x).unwrap(); - // exit from qemu - semihosting::debug::exit(semihosting::debug::EXIT_SUCCESS); + cortex_m_semihosting::debug::exit(cortex_m_semihosting::debug::EXIT_SUCCESS); + } +} + +// Define a panic handler that uses semihosting to exit immediately, +// so that any panics cause qemu to quit instead of hang. +#[panic_handler] +fn panic(_: &core::panic::PanicInfo) -> ! { + loop { + cortex_m_semihosting::debug::exit(cortex_m_semihosting::debug::EXIT_FAILURE); } } diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in index 92004b7..deff376 100644 --- a/cortex-m-rt/link.x.in +++ b/cortex-m-rt/link.x.in @@ -66,6 +66,8 @@ SECTIONS /* ### Vector table */ .vector_table ORIGIN(FLASH) : { + __vector_table = .; + /* Initial Stack Pointer (SP) value */ LONG(_stack_start); diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 793b928..1e977c6 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -439,9 +439,9 @@ extern crate cortex_m_rt_macros as macros; -use core::fmt; #[cfg(cortex_m)] use core::arch::global_asm; +use core::fmt; // HardFault exceptions are bounced through this trampoline which grabs the stack pointer at // the time of the exception and passes it to th euser's HardFault handler in r0. -- cgit v1.2.3 18e5c935b4ea9d17&follow=1'>root/src (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2024-08-28Fix incorrect key for `child_database` block objectfix-block-child-db-keyGravatar Anshul Gupta 1-3/+3
2024-08-13chore: Release notion version 0.6.0v0.6.0Gravatar Jake Swenson 1-1/+1
2024-08-12add new props (#66)Gravatar Ivy Pierlot 2-23/+115
2023-02-25Add new CreateBlock children to page creation (#49)Gravatar Mark Cola 13-747/+924
2023-01-23move And and Or variants to FilterCondition to support recursive nesting (#52)Gravatar Mark Cola 1-14/+84
2023-01-07chore: Release notion version 0.5.1v0.5.1Gravatar Jake Swenson 1-1/+1
2023-01-07Fixed properties docs and added Status (#46)Gravatar AusCyberman 1-32/+70
2023-01-02chore: Release notion version 0.5.0v0.5.0Gravatar Jake Swenson 1-1/+1
2023-01-02style(clippy+fmt): Format code and fix clippy issuesGravatar Jake Swenson 3-3/+6
2023-01-02Add create page functionality (#44)Gravatar ahmetrehaseker 5-12/+42
2022-11-19style(cargo fmt): Add rustfmt config, and fmt codeGravatar Jake Swenson 8-32/+78
2022-11-19chore(docs+deps): Update dependencies, update docs to discuss contributing an...Gravatar Jake Swenson 2-3/+28
2022-05-17(cargo-release) version 0.4.1v0.4.1Gravatar Jake Swenson 1-1/+1
2022-05-17style(cargo fmt): Format codeGravatar Jake Swenson 5-347/+393
2022-05-17(cargo-release) version 0.4.0v0.4.0Gravatar Jake Swenson 1-1/+1
2022-05-17Upgrade notion version (#39)Gravatar Shashank Pachava 16-44/+1189
2022-03-15(cargo-release) version 0.3.5v0.3.5Gravatar Jake Swenson 1-1/+1
2022-03-12Add support for quote and equation blocks (#38)Gravatar Neil Blakey-Milner 1-1/+18
2022-01-11(cargo-release) version 0.3.4v0.3.4Gravatar Jake Swenson 1-1/+1
2022-01-11fix(cargo-release): Fix deprecated cargo release propertyGravatar Jake Swenson 1-1/+1
2022-01-11Add support for code blocks (#35)Gravatar Neil Blakey-Milner 1-1/+13
2021-12-28(cargo-release) version 0.3.3v0.3.3Gravatar Jake Swenson 1-1/+1
2021-12-28fix(#32): Fix rollup value parsing issues (#33)Gravatar Jake Swenson 3-9/+130
2021-12-18(cargo-release) version 0.3.2v0.3.2Gravatar Jake Swenson 1-1/+1
2021-12-17Url property can be null (#26)Gravatar Dmitry Gavrovsky 1-1/+1