[avr-gcc-list] gcc-avr 4.9.2 -Os messes with interrupt vectors
From:
avr
Subject:
[avr-gcc-list] gcc-avr 4.9.2 -Os messes with interrupt vectors
Date:
Sun, 8 May 2016 10:10:33 +0100 (BST)
Hello,
I have been working on a project for some time and at some point, everything just stopped working. It appears that as soon as I include an ISR in my C code, the main function won't even be called anymore. I reduced my code to this:
#include <avr/io.h> #include <avr/interrupt.h>
int main (void) { cli(); DDRB = 0xff; while(1) PORTB |= (1 << PB5); return 0; }
ISR(TIMER0_OVF_vect) {}
But the LED just won't turn on. The strange thing is: If I remove the ISR at the bottom without changing anything else, even keeping the include, everything works. If I remove the -Os option from gcc but keep the ISR, everything works.
I use these commands to compile, link and flash it: