Is there an existing issue for this?
Current Behavior
pebble build for Emery reports:
Total footprint in RAM: 60232 bytes / 128.0KB
Padding the same app's .bss by 8KB (60232 -> 68440 bytes) makes the next build step fail instead:
Exception: App virtual size is 68440 bytes (.text + .data + .bss).
Must be 65535 bytes or smaller, because PebbleProcessInfo.virtual_size is a uint16_t.
Firmware duplicates this cap unconditionally, regardless of platform:
app_storage.c's APP_MAX_SIZE = 0x10000, checked in app_storage_get_process_info() before process_loader_storage.c's own correct, platform-aware virtual_size > segment_size check (Emery's real segment is 135168 bytes / ~132KB, per Kconfig's APP_RAM_EMERY_SEGMENT_SIZE) ever runs.
So every layer — SDK build tool and firmware — actually enforces ~64K for Emery/Gabbro, same as Basalt/Chalk/Flint, despite ~2x the real RAM and despite the build report and official docs ("Max App Size: 128k") both claiming 128K.
Expected Behavior
Either Emery/Gabbro can use meaningfully more of their real ~132KB segment for code+data (needs virtual_size/load_size widened from uint16_t, and the app_storage.c check fixed/removed), or the report and docs should say 64K, not 128K.
Steps To Reproduce
pebble build an Emery app; note the reported "X / 128.0KB".
- Add an 8KB static buffer, referenced once (e.g. from
init()) so it isn't optimized out, pushing virtual_size just over 65535 bytes.
pebble build again — it now fails with the uint16_t error above, contradicting the 128KB figure the same app reported a moment earlier.
Version
v4.33.0-24-g70c24aa86 (Pebble SDK 4.33.1 / pebble-tool 5.0.39)
Host OS
macOS 15
Watch
Pebble Time 2 (Obelix)
Anything else?
Reproduced via the build pipeline + firmware source; not tried on real hardware, since the build tooling itself already blocks producing an oversized binary.
--
Two separate fixes, not one:
- Trivial:
app_storage.c's APP_MAX_SIZE check is redundant with the uint16_t field limit already enforced at build time — could be deleted in favor of the existing segment_size check.
- Real fix: widening
virtual_size/load_size to uint32_t is a breaking change to PebbleProcessInfo, documented as shared ABI with inject_metadata.py and iOS's PBBundle.m — a coordinated change, not a one-liner.
Is there an existing issue for this?
Current Behavior
pebble buildfor Emery reports:Padding the same app's
.bssby 8KB (60232 -> 68440 bytes) makes the next build step fail instead:Firmware duplicates this cap unconditionally, regardless of platform:
app_storage.c'sAPP_MAX_SIZE = 0x10000, checked inapp_storage_get_process_info()beforeprocess_loader_storage.c's own correct, platform-awarevirtual_size > segment_sizecheck (Emery's real segment is 135168 bytes / ~132KB, perKconfig'sAPP_RAM_EMERY_SEGMENT_SIZE) ever runs.So every layer — SDK build tool and firmware — actually enforces ~64K for Emery/Gabbro, same as Basalt/Chalk/Flint, despite ~2x the real RAM and despite the build report and official docs ("Max App Size: 128k") both claiming 128K.
Expected Behavior
Either Emery/Gabbro can use meaningfully more of their real ~132KB segment for code+data (needs
virtual_size/load_sizewidened fromuint16_t, and theapp_storage.ccheck fixed/removed), or the report and docs should say 64K, not 128K.Steps To Reproduce
pebble buildan Emery app; note the reported "X / 128.0KB".init()) so it isn't optimized out, pushingvirtual_sizejust over 65535 bytes.pebble buildagain — it now fails with theuint16_terror above, contradicting the 128KB figure the same app reported a moment earlier.Version
v4.33.0-24-g70c24aa86(Pebble SDK 4.33.1 / pebble-tool 5.0.39)Host OS
macOS 15
Watch
Pebble Time 2 (Obelix)
Anything else?
Reproduced via the build pipeline + firmware source; not tried on real hardware, since the build tooling itself already blocks producing an oversized binary.
--
Two separate fixes, not one:
app_storage.c'sAPP_MAX_SIZEcheck is redundant with theuint16_tfield limit already enforced at build time — could be deleted in favor of the existingsegment_sizecheck.virtual_size/load_sizetouint32_tis a breaking change toPebbleProcessInfo, documented as shared ABI withinject_metadata.pyand iOS'sPBBundle.m— a coordinated change, not a one-liner.