1

im trying to solve this issue for a few days now and i cant find any solution. I got myself an Atmega88A and i want to program it on fedora. I tried to program C with gcc and that went well. But as i tried to include the avr/io.h, i always get the failure that it didnt found anything. I tried to get the new version of gcc, but that gives me an error too. Would it be enough to just download the avr/io.h library and implement it somewhere in my files? or is there any way to download this all together, including also all the other libraries that i need (e.g. util/delay.h)

2 Answers 2

3

You need to use a version of GCC that is specifically built to target AVR chips, you cannot just use the normal gcc executable for your system because it will produce the wrong kind of program. If you download a correctly-configured toolchain, then lines like #include <avr/io.h> should work automatically because the toolchain's default include search paths will be set up properly.

Many Linux distributions provide an avr-gcc package that you can just install with your package manager, including Fedora. You might have to install the avr-libc package to get the avr/io.h header.

If that doesn't work for some reason, you could try downloading Microchip's official AVR toolchain from this page:

http://www.microchip.com/avr-support/avr-and-arm-toolchains-(c-compilers)

Sign up to request clarification or add additional context in comments.

8 Comments

I don't use fedora myself, but pretty sure they have avr-gcc packages fedoraproject.org/wiki/…
Example Fedora 27 : Available "avr-" → avr-binutils avr-gcc avr-gcc-c++ avr-libc dl.fedoraproject.org/pub/fedora/linux/releases/27/Everything/…
thanks, ill try downloading GCC. Seems like it all fails when i want to download gcc-libc. It alwys says "Wrong C Compiler found, check the PATH". But i got just gcc installed, could that be the issue, that the version of gcc is simply just wrong? How do i find out what i need then?
Please edit your question to include Fedora version. ... Install "avr" : # dnf install avr-binutils avr-gcc avr-gcc-c++ avr-libc About avr/io.h : The path is /usr/avr/include/avr/io.h ... ... ( Provided by 'avr-libc' ). Please set -I/usr/avr/include
Jonny: please include the exact command you ran and the full output from it so I can have more clues about the error. Also, what AVR tools did you install and how did you install them?
|
1

What fixed this problem for me was this missing package: avr-gcc-c++. Running the command:

dnf install avr-gcc-c++

fixed it.

1 Comment

This is not an answer but a comment please visit and check how to answer a question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.