don't inline version info on device side, keeps 1.5kB out of the AppMain stack frame

SendVersion holds three PM3_CMD_DATA_SIZE sized buffers. Inlined into AppMain they sat in its frame for the whole main loop, not just while CMD_VERSION was handled. Marking it noinline makes the frame transient.

AppMain frame 2160 -> 1160 bytes, measured with -fstack-usage.  Thanks Claude!
This commit is contained in:
iceman1001
2026-08-30 11:34:17 +02:00
parent 2714628baf
commit 87cea09fd7
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Changed version data on device side not to be inlined. Moving from main thread ram to .bss. (@iceman1001)
- Changed `lf pcf7931` - now use bigbuf_calloc and much smaller array (@iceman1001)
- Changed `hf 15 sniff` - now uses bigbuf_calloc and lessen ram footprint on device (@iceman1001)
- Added individual json dump formats for ht2, ht1, htS, htU. No more .bin files either for hitag (@iceman1001)
+3 -1
View File
@@ -398,7 +398,9 @@ extern uint32_t _bootphase1_version_pointer[], _flash_start[], _flash_end[], __d
#ifndef WITH_COMPRESSION
extern uint32_t _bootrom_end[], _bootrom_start[], __os_size__[];
#endif
static void SendVersion(void) {
// noinline: this holds three PM3_CMD_DATA_SIZE sized buffers. Inlined into AppMain they
// would sit in its frame for the whole main loop, not just while CMD_VERSION is handled
static void __attribute__((noinline)) SendVersion(void) {
char temp[PM3_CMD_DATA_SIZE - 12]; /* Limited data payload in USB packets */
char VersionString[PM3_CMD_DATA_SIZE - 12] = { '\0' };