|
1 | 1 | @echo off
|
2 | 2 | REM Windows batch file equivalent of progmemcheck.sh
|
3 | 3 | 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> |
5 | 5 |
|
6 | 6 | if "%1"=="" goto usage
|
7 | 7 | if "%2"=="" goto usage
|
8 | 8 |
|
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) |
10 | 10 | for /f "tokens=1" %%i in ('%1 -t d %2 ^| findstr "__ctors_start"') do set progmem_end=%%i
|
11 | 11 |
|
12 | 12 | REM Check if we got a result
|
@@ -37,16 +37,18 @@ set line="^| Severe Warning: PROGMEM section too large by %excess% bytes.
|
37 | 37 | echo.
|
38 | 38 | echo _______________________________________________________________
|
39 | 39 | 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. ^| |
43 | 45 | echo ^|_____________________________________________________________^|
|
44 | 46 | echo.
|
45 | 47 | goto end
|
46 | 48 |
|
47 | 49 | :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 |
50 | 52 | exit /b 1
|
51 | 53 |
|
52 | 54 | :end
|
|
0 commit comments