I'm new to assembler and ATmega128.
The problem I have is I can't compile my assembly file. After this step I'd want to upload the program to an STK-300.
Here's the code
.include "avr/io.h"
.org 0x0000
rjmp reset
reset:
ldi r16,0xff
out DDRB,r16
loop:
in r16,PIND
ori r16,0b00000010
andi r16,0b11110111
out PORTB,r16
rjmp loop
And I tried compiling it with
~ avr-gcc -mmcu=atmega128 -I/usr/lib/avr/include -o main.elf main.S
/tmp/cctvJInM.s: Assembler messages:
/tmp/cctvJInM.s:5: Error: can't open avr/io.h for reading: No such file or directory
Now I have installed avr-gcc, avr-libc and binutils-avr.
I don't really know how to debug this. I checked the avr directory and found the files
~ ls /usr/lib/avr/include/avr/
boot.h ioa6285.h iom168p.h iom32.h iom88pa.h iotn828.h iox256a3.h
builtins.h ioa6286.h iom169a.h iom32hvb.h iom88pb.h iotn841.h iox256a3u.h
common.h ioa6289.h iom169.h iom32hvbrevb.h iom88p.h iotn84a.h iox256c3.h
cpufunc.h ioa6612c.h iom169pa.h iom32m1.h iom8a.h iotn84.h iox256d3.h
crc16.h ioa6613c.h iom169p.h iom32u2.h iom8.h iotn85.h iox32a4.h
delay.h ioa6614q.h iom16a.h iom32u4.h iom8hva.h iotn861a.h iox32a4u.h
eeprom.h ioa6616c.h iom16.h iom32u6.h iom8u2.h iotn861.h iox32c3.h
fuse.h ioa6617c.h iom16hva2.h iom406.h iomx8.h iotn87.h iox32c4.h
interrupt.h ioa664251.h iom16hva.h iom48a.h iomxx0_1.h iotn88.h iox32d3.h
io1200.h ioa8210.h iom16hvb.h iom48.h iomxx4.h iotn9.h iox32d4.h
io2313.h ioa8510.h iom16hvbrevb.h iom48pa.h iomxxhva.h iotnx4.h iox32e5.h
io2323.h ioat94k.h iom16m1.h iom48pb.h iotn10.h iotnx5.h iox384c3.h
io2333.h iocan128.h iom16u2.h iom48p.h iotn11.h iotnx61.h iox384d3.h
...
I tried to include the more specific header file with .include "avr/iom128.h (but I don't really know which one I'd need exactly).
Does anybody know what the issue is, or has any tips to debug?
Thanks in advance.
avr-libcshould contain theio.hWhat OS are you using and what is the package version?avr-gcc (GCC) 5.4.0dpkg -S avr/io.hand/ordpkg -L avr-libc | grep io.h?