From cc5d5fafdba26cf31c7c3e01220995d120b5b35d Mon Sep 17 00:00:00 2001 From: Jesse Rusak Date: Wed, 12 Jun 2024 09:50:15 -0400 Subject: [PATCH] Make rust emitted code compatible with Rev A Playdate hardware The FPU settings above are `-mfpu=fpv5-sp-d16`, the `-sp-` part means that double precision floating point is unsupported. The [rust docs](https://doc.rust-lang.org/nightly/rustc/platform-support/thumbv7em-none-eabi.html#table-of-supported-cpus-for-thumbv7em-none-eabihf) show that getting this same effect from rustc-emitted code requires this additional target feature. Without this, I was getting "undefined instruction" errors for f64 instructions on the original Playdate hardware, with this change it seems to be resolved. --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 28c9817..94b3e0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -660,6 +660,7 @@ impl Build { "RUSTFLAGS", [ "-Ctarget-cpu=cortex-m7", + "-Ctarget-feature=-fp64", // Rev A hardware seems to not have 64-bit floating point support "-Clink-args=--emit-relocs", "-Crelocation-model=pic", "-Cpanic=abort",