Significantly increase internal RAM heap size

This commit is contained in:
Jakub Hlusička 2026-03-01 00:51:46 +01:00
parent a24774c925
commit 014b099986
3 changed files with 75 additions and 36 deletions

55
firmware/Cargo.lock generated
View file

@ -2068,18 +2068,17 @@ dependencies = [
[[package]] [[package]]
name = "esp-backtrace" name = "esp-backtrace"
version = "0.18.1" version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899#114977583886be4ed866ad7b7c6f16865148e899"
checksum = "3318413fb566c7227387f67736cf70cd74d80a11f2bb31c7b95a9eb48d079669"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"document-features", "document-features",
"esp-config 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "esp-config 0.6.1 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
"esp-metadata-generated 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "esp-metadata-generated 0.3.0 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
"esp-println", "esp-println",
"heapless 0.9.2", "heapless 0.9.2",
"riscv", "riscv",
"semihosting", "semihosting",
"xtensa-lx 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "xtensa-lx 0.13.0 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
] ]
[[package]] [[package]]
@ -2113,6 +2112,18 @@ dependencies = [
"somni-expr", "somni-expr",
] ]
[[package]]
name = "esp-config"
version = "0.6.1"
source = "git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899#114977583886be4ed866ad7b7c6f16865148e899"
dependencies = [
"document-features",
"esp-metadata-generated 0.3.0 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
"serde",
"serde_yaml",
"somni-expr",
]
[[package]] [[package]]
name = "esp-config" name = "esp-config"
version = "0.6.1" version = "0.6.1"
@ -2212,6 +2223,11 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a93e39c8ad8d390d248dc7b9f4b59a873f313bf535218b8e2351356972399e3" checksum = "9a93e39c8ad8d390d248dc7b9f4b59a873f313bf535218b8e2351356972399e3"
[[package]]
name = "esp-metadata-generated"
version = "0.3.0"
source = "git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899#114977583886be4ed866ad7b7c6f16865148e899"
[[package]] [[package]]
name = "esp-metadata-generated" name = "esp-metadata-generated"
version = "0.3.0" version = "0.3.0"
@ -2235,12 +2251,11 @@ dependencies = [
[[package]] [[package]]
name = "esp-println" name = "esp-println"
version = "0.16.1" version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899#114977583886be4ed866ad7b7c6f16865148e899"
checksum = "5a30e6c9fbcc01c348d46706fef8131c7775ab84c254a3cd65d0cd3f6414d592"
dependencies = [ dependencies = [
"document-features", "document-features",
"esp-metadata-generated 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "esp-metadata-generated 0.3.0 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
"esp-sync 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "esp-sync 0.1.1 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
"log", "log",
"portable-atomic", "portable-atomic",
] ]
@ -2358,6 +2373,20 @@ dependencies = [
"xtensa-lx 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "xtensa-lx 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "esp-sync"
version = "0.1.1"
source = "git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899#114977583886be4ed866ad7b7c6f16865148e899"
dependencies = [
"cfg-if",
"document-features",
"embassy-sync 0.6.2",
"embassy-sync 0.7.2",
"esp-metadata-generated 0.3.0 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
"riscv",
"xtensa-lx 0.13.0 (git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899)",
]
[[package]] [[package]]
name = "esp-sync" name = "esp-sync"
version = "0.1.1" version = "0.1.1"
@ -8562,6 +8591,14 @@ dependencies = [
"critical-section", "critical-section",
] ]
[[package]]
name = "xtensa-lx"
version = "0.13.0"
source = "git+https://github.com/Limeth/esp-hal.git?rev=114977583886be4ed866ad7b7c6f16865148e899#114977583886be4ed866ad7b7c6f16865148e899"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "xtensa-lx" name = "xtensa-lx"
version = "0.13.0" version = "0.13.0"

View file

@ -454,32 +454,34 @@ async fn initialize_display_and_renderer(
let st7701s = display_peripherals.into_display().await; let st7701s = display_peripherals.into_display().await;
static FRAMEBUFFER: StaticCell<Framebuffer> = StaticCell::new(); static FRAMEBUFFER: StaticCell<Framebuffer> = StaticCell::new();
let framebuffer = FRAMEBUFFER.init(Framebuffer::new( let framebuffer = FRAMEBUFFER.init_with(move || {
dma_ch0, Framebuffer::new(
spi2.into(), dma_ch0,
st7701s.dpi, spi2.into(),
BurstConfig { st7701s.dpi,
internal_memory: InternalBurstConfig::Enabled, BurstConfig {
external_memory: ExternalBurstConfig::Size32, internal_memory: InternalBurstConfig::Enabled,
}, external_memory: ExternalBurstConfig::Size32,
// The burst config (16/32/64) doesn't seem to affect the alignment of the row size. },
// // The burst config (16/32/64) doesn't seem to affect the alignment of the row size.
// | | ( displayed range ) | //
// | [ pad ] [ pad ] // | | ( displayed range ) |
// | [ DMA-transmissible range ] // | [ pad ] [ pad ]
// [ DMA-t. left overscan ] | | | // | [ DMA-transmissible range ]
// 0 112 120 360 368 (index of u16 pixel) // [ DMA-t. left overscan ] | | |
// ^ aligned ^ aligned ^ aligned // 0 112 120 360 368 (index of u16 pixel)
// // ^ aligned ^ aligned ^ aligned
// TODO: Compute the appropriate ranges to pass to the renderer and DPI peripheral. //
// The renderer should pass the size of the `pad`ding to the GUI is parameters, // TODO: Compute the appropriate ranges to pass to the renderer and DPI peripheral.
// to align the content to the displayed range. // The renderer should pass the size of the `pad`ding to the GUI is parameters,
112, // to align the content to the displayed range.
368 - 112, 112,
960, 368 - 112,
16, 960,
true, 16,
)); true,
)
});
info!("Framebuffer created!"); info!("Framebuffer created!");

View file

@ -13,7 +13,7 @@ use log::{info, warn};
// ``` // ```
/// Total heap size /// Total heap size
pub const HEAP_SIZE: usize = 112 * 1024; pub const HEAP_SIZE: usize = 196 * 1024;
/// Size of the app core's stack /// Size of the app core's stack
pub const STACK_SIZE_CORE_APP: usize = 80 * 1024; pub const STACK_SIZE_CORE_APP: usize = 80 * 1024;