Skip to content

Commit eb48b52

Browse files
committed
made wording in warning more precise
1 parent c28a7f1 commit eb48b52

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

scripts/progmemcheck.bat

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
@echo off
22
REM Windows batch file equivalent of progmemcheck.sh
33
REM Checks if PROGMEM section is too large (over 65535 bytes)
4-
REM Usage: progmemcheck.bat <objdump_tool> <object_file>
4+
REM Usage: progmemcheck.bat <symbol_tool> <object_file>
55

66
if "%1"=="" goto usage
77
if "%2"=="" goto usage
88

9-
REM Execute objdump command and extract the address (should be decimal with -t d option)
9+
REM Execute symbol extraction command (avr-nm) and extract the address (should be decimal with -t d option)
1010
for /f "tokens=1" %%i in ('%1 -t d %2 ^| findstr "__ctors_start"') do set progmem_end=%%i
1111

1212
REM Check if we got a result
@@ -37,16 +37,18 @@ set line="^| Severe Warning: PROGMEM section too large by %excess% bytes.
3737
echo.
3838
echo _______________________________________________________________
3939
echo %line:~1,63%^|
40-
echo ^| Your program will most probably be unstable! ^|
41-
echo ^| Use the macros PROGMEM_FAR from ^<progmem_far.h^> and ^|
42-
echo ^| pgm_get_far_address/pgm_read_xxxx_far from ^<avr/pgmspace.h^>.^|
40+
echo ^| Your program will most probably be unstable! Use the macro ^|
41+
echo ^| PROGMEM_FAR from the "progmem_far" library (available from ^|
42+
echo ^| Arduino Library Manager), and use pgm_get_far_address and ^|
43+
echo ^| pgm_read_xxxx_far from Arduino's "pgmspace" library to ^|
44+
echo ^| access the PROGMEM_FAR data. ^|
4345
echo ^|_____________________________________________________________^|
4446
echo.
4547
goto end
4648

4749
:usage
48-
echo Usage: %0 ^<objdump_tool^> ^<object_file^>
49-
echo Example: %0 avr-objdump firmware.elf
50+
echo Usage: %0 ^<symbol_tool^> ^<object_file^>
51+
echo Example: %0 avr-nm firmware.elf
5052
exit /b 1
5153

5254
:end

scripts/progmemcheck.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ if [ "x$progmem_end" != "x" ] && [ $progmem_end -gt 65535 ]; then
44
warning="| Severe Warning: PROGMEM section too large by $(expr $progmem_end - 65535) bytes. "
55
echo "_______________________________________________________________"
66
echo "${warning:0:62}|"
7-
echo "| Your program will most probably be unstable! |"
8-
echo "| Use the macros PROGMEM_FAR from <progmem_far.h> and |"
9-
echo "| pgm_get_far_address/pgm_read_xxxx_far from <avr/pgmspace.h>.|"
7+
echo "| Your program will most probably be unstable! Use the macro |"
8+
echo "| PROGMEM_FAR from the \"progmem_far\" library (available from |"
9+
echo "| Arduino Library Manager), and use pgm_get_far_address and |"
10+
echo "| pgm_read_xxxx_far from Arduino's \"pgmspace\" library to |"
11+
echo "| access the PROGMEM_FAR data. |"
1012
echo "|_____________________________________________________________|"
1113
fi

0 commit comments

Comments
 (0)