Just for the record.
When I compile my project I get an error in the assembler file:
relocation truncated to fit: R_AVR_7_PCREL against 'no symbol'
I get the error in two different parts of the assembler code, and it is always on a brne instruction.
cpi R30, RECEIVE brne Check_State_Is_IDLE ; this line causes the error State_RECEIVE: ...
ldi R16, 8 cp BitCounter, R16 brne INT1_vect_End ; this line causes the error State_RECEIVE_Store_byte: ...
Yes the lables State_RECEIVE and INT1_vect_End exists, I use them in other parts of the assembler code and they work when replacing the brne. I have also tried to rename the lables but it didn't work. The problem is that the branch instructions can only branch a maximum of +/- 64 words.
The solution is to use rjmp instead which can jump +/-2k words (or jmp if rjmp is not enough):
cpi R30, RECEIVE ;brne Check_State_Is_IDLE ; this line causes the error breq State_RECEIVE rjmp Check_State_Is_IDLE State_RECEIVE: ...
ldi R16, 8 cp BitCounter, R16 ;brne INT1_vect_End ; this line causes the error breq State_RECEIVE_Store_byte rjmp INT1_vect_End State_RECEIVE_Store_byte: ...
I hope this will save some headache for someone.
/COLA