Internal error: out of range error when building custom bootloader
i'm attempting build custom bootloader arduino mega2560 arduino ide 1.8.0 under windows 7.
in platform.txt i've appended ",--section-start=.text=0x3e000" compiler.c.elf.flags, should put bootloader in last 8k of 256k flash.
when verify application following warnings:
this behavior reproduceable empty sketch, modification being additional linker option.
the linker command below:
the line linker complaining main.cpp is:
serialeventrun declared weak symbol.
without "--section-start=.text=0x3e000", sketch compiled without warnings. also, relocating .text section anywhere upto 0x20000 allows sketch compiled without warnings.
any ideas on how avoid warnings? there wrong way trying compile bootloader?
in platform.txt i've appended ",--section-start=.text=0x3e000" compiler.c.elf.flags, should put bootloader in last 8k of 256k flash.
when verify application following warnings:
code: [select]
c:\program files (x86)\arduino\hardware\arduino\avr\cores\arduino/main.cpp:47: warning: internal error: out of range error
c:\program files (x86)\arduino\hardware\arduino\avr\cores\arduino/main.cpp:47: warning: internal error: out of range error
this behavior reproduceable empty sketch, modification being additional linker option.
code: [select]
void setup() {
// put setup code here, run once:
}
void loop() {
// put main code here, run repeatedly:
}
the linker command below:
code: [select]
"c:\program files (x86)\arduino\hardware\tools\avr/bin/avr-gcc" -w -os -g -flto -fuse-linker-plugin -wl,--gc-sections,--section-start=.text=0x3e000,--relax -mmcu=atmega2560 -o "c:\users\username\appdata\local\temp\arduino_build_249361/sketch_jan05a.ino.elf" "c:\users\username\appdata\local\temp\arduino_build_249361\sketch\sketch_jan05a.ino.cpp.o" "c:\users\username\appdata\local\temp\arduino_build_249361/core\core.a" "-lc:\users\username\appdata\local\temp\arduino_build_249361" -lm
the line linker complaining main.cpp is:
code: [select]
if (serialeventrun) serialeventrun();
serialeventrun declared weak symbol.
without "--section-start=.text=0x3e000", sketch compiled without warnings. also, relocating .text section anywhere upto 0x20000 allows sketch compiled without warnings.
any ideas on how avoid warnings? there wrong way trying compile bootloader?
i still don't understand reason linker error, however, able work around commenting out following line in main.cpp
code: [select]
if (serialeventrun) serialeventrun();
Arduino Forum > Using Arduino > Programming Questions > Internal error: out of range error when building custom bootloader
arduino
Comments
Post a Comment