I'm learning about assembly programming for Arduino over GNU/Linux, using as test board an Arduino UNO R3 with AVR Atmega 16u2 microcontroller.
As I read in this article https://www.cypherpunk.at/2014/09/native-assembler-programming-on-arduino/ the instructions must be:
avr-as -g -mmcu=atmega16u2 -o simple_led_blink.o simple_led_blink.s
#to assemble
avr-ld -o simple_led_blink.elf simple_led_blink.o
#to link
But, when I try to execute this second instruction, it shows this error:
avr-ld: avr:35 architecture of input file `simple_led_blink.o' is incompatible with avr output
I've checked in avr-as architecture support, and this architecture is supported.
What could be the problem?
Update: Finally, as David says, the main microcontroller is the 328p,not 16u2 I use the instructions as been written in the guide, and it runs well
atmega16u2
. Try withatmega328
– Sniper