Skip to content

Commit 72c5ff3

Browse files
author
test
committed
feat: update heap size for MQTT demo and adjust binary path in flash script
1 parent 77958fa commit 72c5ff3

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ resolver = "2"
4747
# Note: build aimdb-core only by default. Use make all to build the full workspace!
4848
default-members = ["aimdb-core"]
4949

50+
# debug = 2 embeds full DWARF location info; without it, probe-rs/defmt can't
51+
# resolve file:line for release-profile embedded binaries ("insufficient
52+
# DWARF info" at runtime). No effect on codegen or binary size — only debug
53+
# sections grow.
54+
[profile.release]
55+
debug = 2
56+
5057
[workspace.package]
5158
version = "1.1.0"
5259
edition = "2021"

docs/design/044-embassy-mqtt-tls.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,14 @@ EMQX credential (issue 007) land.
177177

178178
## 8. Cost
179179

180-
On the reference STM32H563ZI (640 KB RAM / 2 MB flash), the TLS build adds
181-
~21 KB of statically-allocated RAM (16 640 + 4 096 record buffers, D10) plus
182-
the handshake's stack transient, and roughly 150–250 KB of flash
183-
(p256 + rsa + p384 + SHA-2 + embedded-tls). Comfortable here; a smaller
184-
part could drop `rsa`/`p384` (features are additive pass-throughs) and pin
180+
On the reference STM32H563ZI (640 KB RAM / 2 MB flash), measured on
181+
`embassy-mqtt-connector-demo` (`arm-none-eabi-size`, release profile): the
182+
TLS build adds 21 568 bytes of statically-allocated RAM (16 640 + 4 096
183+
record buffers, D10, matching the estimate exactly) plus the handshake's
184+
stack transient, and ~351 KB of flash — p256 + rsa + p384 + SHA-2 +
185+
embedded-tls, plus the embedded CA and the TLS-path additions to the
186+
mountain-mqtt fork port. Comfortable here; a smaller part could drop
187+
`rsa`/`p384` (features are additive pass-throughs) and pin
185188
its broker CA chain to P-256.
186189

187190
## 9. Open questions

examples/embassy-mqtt-connector-demo/flash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
set -e
88

9-
BINARY="../../target/thumbv8m.main-none-eabihf/debug/embassy-mqtt-connector-demo"
9+
BINARY="../../target/thumbv8m.main-none-eabihf/release/embassy-mqtt-connector-demo"
1010

1111
if [ ! -f "$BINARY" ]; then
1212
echo "Error: Binary not found at $BINARY"

examples/embassy-mqtt-connector-demo/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ async fn main(spawner: Spawner) {
221221
// Initialize heap for the allocator
222222
{
223223
use core::mem::MaybeUninit;
224-
const HEAP_SIZE: usize = 49152; // 48KB heap (MQTT + serial AimX server JSON)
224+
const HEAP_SIZE: usize = 98304; // 96KB heap (MQTT + serial AimX server JSON)
225225
static mut HEAP: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
226226
unsafe {
227227
let heap_ptr = core::ptr::addr_of_mut!(HEAP);

0 commit comments

Comments
 (0)