I am learning to program my ATtiny85 without a bootloader using a MiniPro, and I want to generate a hex file. First I try to compile my file using the avr-gcc
command, but I get an error that states:
Fatal error: unknown MCU: gcc-isr
This is the command I use to compile my file
avr-gcc -Wall -mmcu=avr25 -Os -DF_CPU=8000000 -c main.c -o main.o
And this is the code I'm trying to compile
#define __AVR_ATtiny85__
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB = 0b00001000;
while (1)
{
PORTB = 0b00001000;
_delay_ms(20);
PORTB = 0b00000000;
_delay_ms(20);
PORTB = 0b00001000;
_delay_ms(200);
PORTB = 0b00000000;
_delay_ms(200);
}
return 1;
}
I am not entirely sure what the error means and why it appears in the first place, since my mcu is explicitly specified as avr25 category, which the attiny85 falls into. The same error is produced if I set the mmcu variable to attiny85
explicitly
Output of avr-gcc --version
% avr-gcc --version
avr-gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I also installed the latest binutils-avr
and avr-libc
packages from AUR (2.20 and 2.1.0 respectively)