Closed therealbstern closed 5 months ago
@mciantyre I'm going to make the changes suggested above; I'll ping you when this is complete.
Unless you have no interest in this PR, in which case you can close it.
@mciantyre I think this is ready for you if you are interested in it.
I'm interested in the feature, and I'd prefer to maintain it outside of the BSP if possible. I think the main change here could look something like
diff --git a/build.rs b/build.rs
index 201ff96..861d6be 100644
--- a/build.rs
+++ b/build.rs
@@ -10,8 +10,10 @@ fn main() {
})
.heap(Memory::Ocram)
.heap_size(16 * 1024)
+ .heap_size_env_override("TEENSY4_HEAP_SIZE")
.stack(Memory::Dtcm)
.stack_size(16 * 1024)
+ .stack_size_env_override("TEENSY4_STACK_SIZE")
.vectors(Memory::Dtcm)
.text(Memory::Itcm)
.data(Memory::Dtcm)
with the behavior described in the PR summary. We move this support into the runtime. imxrt-rs/imxrt-rt#13 proposes the feature.
Note that changing the environment variables doesn't trigger a rebuild without a
cargo clean
.
Take a look at cargo:rerun-if-env-changed
in the build scripts documentation.
We move this support into the runtime. imxrt-rs/imxrt-rt#13 proposes the feature.
Great, I'm perfectly happy with you putting it wherever makes the most sense to you.
Take a look at cargo:rerun-if-env-changed in the build scripts documentation.
Thank you, that's ideal.
If you want to close this because it's superseded, that's fine with me.
This allows setting an environment variable at build time to change the stack and/or heap sizes without having to fork
teensy4-rs
and/or patchingbuild.rs
. The variables in question areTEENSY4_HEAP_SIZE
andTEENSY4_STACK_SIZE
and they default to the current values inbuild.rs
if they're not present or won'tparse::<usize>()
.It is recommended to set the variables in the
[env]
section ofCargo.toml
but not required.Note that changing the environment variables doesn't trigger a rebuild without a
cargo clean
. I'm open to suggestions on how to make rebuilds happen.