Make sure RAMFUNC is not inlined, else it won't be in RAM.
Ubuntu Build and Test / ubuntu-make (push) Successful in 5m35s
Ubuntu Build and Test / ubuntu-make-btaddon (push) Successful in 5m11s
Ubuntu Build and Test / ubuntu-cmake (push) Failing after 4m33s
Windows Build and Test / proxspace (push) Has been cancelled
Windows Build and Test / wsl (push) Has been cancelled
MacOS Build and Test / macos-make (push) Has been cancelled
MacOS Build and Test / macos-make-btaddon (push) Has been cancelled
MacOS Build and Test / macos-cmake (push) Has been cancelled
CodeQL / Analyze (python) (push) Failing after 2m7s
CodeQL / Analyze (cpp) (push) Failing after 9m27s

Some static RAMFUNC got inlined which means they weren't relocated in RAM.
By forcing noinline on RAMFUNC, the following functions move to RAM:

F .data 00000034 optimizedSniff
F .data 00000148 skipSniff
F .data 000002c8 ManchesterDecoding_Thinfilm

But ManchesterDecoding_Thinfilm worked fine without being in RAM,
so we remove its RAMFUNC attribute and it works as previously,
and avoid eating some RAM bytes.

In summary, impacted command is only:

hf sniff
This commit is contained in:
Philippe Teuwen
2026-02-11 14:19:05 +01:00
parent 7c4758f40b
commit d6f74b342e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -695,7 +695,7 @@ RAMFUNC int ManchesterDecoding(uint8_t bit, uint16_t offset, uint32_t non_real_t
// Thinfilm, Kovio mangles ISO14443A in the way that they don't use start bit nor parity bits.
static RAMFUNC int ManchesterDecoding_Thinfilm(uint8_t bit) {
static int ManchesterDecoding_Thinfilm(uint8_t bit) {
if (Demod.len == Demod.output_len) {
// Flush last parity bits
+1 -1
View File
@@ -92,7 +92,7 @@ extern bool g_tearoff_enabled;
//#define RAMFUNC __attribute((long_call, section(".ramfunc")))
#define RAMFUNC __attribute((long_call, section(".ramfunc"))) __attribute__((target("arm")))
#define RAMFUNC __attribute((long_call, section(".ramfunc"))) __attribute__((target("arm"))) __attribute__((noinline))
#ifndef PM3_ROTR
# define PM3_ROTR(x,n) (((uintmax_t)(x) >> (n)) | ((uintmax_t)(x) << ((sizeof(x) * 8) - (n))))