From d4c978714e3a0c26522275ab65bc1968994f74e0 Mon Sep 17 00:00:00 2001 From: muhammekocak0 Date: Wed, 25 Mar 2026 22:10:25 +0300 Subject: [PATCH] fix(builder): fix Flash/RAM size reporting for MSP430 large memory model When building for targets that use -mlarge (e.g. MSP430FR2476), the MSP430 GCC toolchain emits prefixed section names like .lower.text, .lower.bss, .upper.data, etc. The old SIZEPROGREGEXP / SIZEDATAREGEXP only matched standard section names, so PlatformIO reported near-zero memory usage even though thousands of bytes were uploaded. Extend both regexes to match the lower./upper. prefixed variants, as well as .lowtext, .rodata2, .persistent, .heap, and individual __interrupt_vector_* / __reset_vector symbols. Backward-compatible: the prefix group is optional, so MSP430G2553 (standard memory model) continues to work unchanged. Fixes: MSP430FR2476 Flash/RAM always showing 0.0%/0.2% --- builder/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/main.py b/builder/main.py index 693db52..40453f1 100644 --- a/builder/main.py +++ b/builder/main.py @@ -35,8 +35,8 @@ PIODEBUGFLAGS=["-O0", "-g3", "-ggdb", "-gdwarf-2"], - SIZEPROGREGEXP=r"^(?:\.text|\.data|\.rodata|\.vectors)\s+([0-9]+).*", - SIZEDATAREGEXP=r"^(?:\.data|\.bss|\.noinit)\s+(\d+).*", + SIZEPROGREGEXP=r"^(?:\.(?:(?:lower|upper)\.)?(?:text|data|rodata)|\.rodata2|\.lowtext|\.persistent|\.vectors|__(?:interrupt_vector_\d+|reset_vector))\s+([0-9]+).*", + SIZEDATAREGEXP=r"^(?:\.(?:(?:lower|upper)\.)?(?:data|bss)|\.noinit|\.heap)\s+(\d+).*", SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES',