I'm opening this issue to track some of the explorations into decreasing the ents kernel's binary size.
Starting Kernel Size 82Kb
Starting Point
Size as of current upstream (f4f86b4)
Finished `release` profile [optimized + debuginfo] target(s) in 0.04s
text data bss dec hex filename
81964 0 17620 99584 18500 tock/target/thumbv7em-none-eabi/release/lora_e5_mini
Removing some debug/io module
Removing the functionality to print output from panics, specifically:
- remove import of
io mod
- replace panic handler with:
/// todo
#[panic_handler]
pub unsafe fn panic_fmt(info: &core::panic::PanicInfo) -> ! {
loop {}
}
This results in 15kb of code size savings!
Finished `release` profile [optimized + debuginfo] target(s) in 0.04s
text data bss dec hex filename
65580 0 17620 83200 14500 tock/target/thumbv7em-none-eabi/release/lora_e5_mini
Removing the console / process printer:
This gets rid of another ~20Kb!
Finished `release` profile [optimized + debuginfo] target(s) in 0.04s
text data bss dec hex filename
47148 0 15520 62668 f4cc tock/target/thumbv7em-none-eabi/release/lora_e5_mini
Update debug!() macro to replace with noop - ()
2Kb decrease
Finished `release` profile [optimized + debuginfo] target(s) in 1.15s
text data bss dec hex filename
45100 0 13320 58420 e434 tock/target/thumbv7em-none-eabi/release/lora_e5_mini
Lowest Possible Kernel Size: 45K
Decreasing the stack size
Going down from 0x2000 to 0x1000 for the kernel stack size further shaves down the bss by 4kb. This helps us for the RAM limits on our board. We can likely only shrink this by this much if we aren't doing debugs statements.
Finished `release` profile [optimized + debuginfo] target(s) in 1.16s
text data bss dec hex filename
45100 0 9224 54324 d434 tock/target/thumbv7em-none-eabi/release/lora_e5_mini
I'm opening this issue to track some of the explorations into decreasing the ents kernel's binary size.
Starting Kernel Size 82Kb
Starting Point
Size as of current upstream (f4f86b4)
Removing some debug/io module
Removing the functionality to print output from panics, specifically:
iomodThis results in 15kb of code size savings!
Removing the console / process printer:
This gets rid of another ~20Kb!
Update
debug!()macro to replace with noop -()2Kb decrease
Lowest Possible Kernel Size: 45K
Decreasing the stack size
Going down from 0x2000 to 0x1000 for the kernel stack size further shaves down the bss by 4kb. This helps us for the RAM limits on our board. We can likely only shrink this by this much if we aren't doing debugs statements.