BotoX / xiaomi-m365-compatible-bms

Xiaomi M365 compatible, open source firmware for ATMega328p+BQ769x0 BMS. Ninebot in proto_test branch
193 stars 45 forks source link

Problem collect2.exe: error: ld returned 1 exit status #50

Closed Adri-Dax closed 3 years ago

Adri-Dax commented 3 years ago

Goodnight. I am trying to compile the software for the botox bms. I always get this error even if I don't modify any data and I try to get this error. Because it can be? Thanks a lothttps://gyazo.com/b96deac829e8d47a71749b10672722d6 Compiling .pio\build\sp15s001\FrameworkArduino\wiring_analog.c.o Compiling .pio\build\sp15s001\FrameworkArduino\wiring_digital.c.o Compiling .pio\build\sp15s001\FrameworkArduino\wiring_pulse.S.o Compiling .pio\build\sp15s001\FrameworkArduino\wiring_pulse.c.o Compiling .pio\build\sp15s001\FrameworkArduino\wiring_shift.c.o Archiving .pio\build\sp15s001\libFrameworkArduino.a Linking .pio\build\sp15s001\firmware.elf C:\Users\Adri\AppData\Local\Temp\ccviLg1E.ltrans0.ltrans.o: In function `_Li2c_read_bit':

:(.text+0xe6c): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' :(.text+0xe70): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' :(.text+0xe7c): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' C:\Users\Adri\AppData\Local\Temp\ccviLg1E.ltrans0.ltrans.o: In function `_Li2c_put_ack_high': :(.text+0xe9c): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' :(.text+0xea8): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' :(.text+0xeaa): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' C:\Users\Adri\AppData\Local\Temp\ccviLg1E.ltrans0.ltrans.o: In function `_Li2c_write_high': :(.text+0xeda): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' :(.text+0xee8): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' C:\Users\Adri\AppData\Local\Temp\ccviLg1E.ltrans0.ltrans.o: In function `_Ldelay_scl_high': :(.text+0xef0): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' C:\Users\Adri\AppData\Local\Temp\ccviLg1E.ltrans0.ltrans.o: In function `_Li2c_get_ack': :(.text+0xefc): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' C:\Users\Adri\AppData\Local\Temp\ccviLg1E.ltrans0.ltrans.o: In function `_Li2c_ack_wait': :(.text+0xf0a): additional relocation overflows omitted from the output collect2.exe: error: ld returned 1 exit status *** [.pio\build\sp15s001\firmware.elf] Error 1 ========================== [FAILED] Took 4.11 seconds ==========================
mottscanley commented 3 years ago

add some older versions of framework-arduino-avr and toolchain-atmelavr to platform_packages in .ini file seems something in code is deprecated or not working properly with newer tools

BotoX commented 3 years ago

Seems to be an issue with https://github.com/felias-fogg/SoftI2CMaster and Atmel AVR 3.3 (worked on 2.2) I've found some forum post where they've replaced all rjmp with jmp and rcall with call in SoftI2CMaster.h Done that and it compiles for me now. See: https://github.com/felias-fogg/SoftI2CMaster/issues/50

I've pushed a commit which should fix that for you.