osx-cross / homebrew-avr

Homebrew AVR Toolchain
BSD 2-Clause "Simplified" License
394 stars 78 forks source link

Support for tinyAVR 1-series, megaAVR 0-series and AVR-Dx series MCUs #317

Closed chenzhuoyu closed 10 months ago

chenzhuoyu commented 10 months ago

The official avr-libc lacks support for tinyAVR 1-series (e.g. ATtiny1614), megaAVR 0-series (e.g. ATmega4809) and AVR-Dx series (e.g. AVR128DB28), which makes avr-gcc complain when building for these devices:

$ avr-gcc -mmcu=attiny1614 -DF_CPU=20000000 -Wall -Wextra -Os -c -o build/iotiny.o iotiny.c
In file included from iotiny.c:1:
/opt/homebrew/Cellar/avr-gcc@12/12.2.0_2/avr/include/avr/io.h:581:6: warning: #warning "device type not defined" [-Wcpp]
  581 | #    warning "device type not defined"
      |      ^~~~~~~

Are there any plans to support these new devices?

P.S. I noticed that the repository https://github.com/avrdudes/avr-libc mentioned in another issue (#268) do include those headers, is it possible to switch from the official avr-libc to this version?

ladislas commented 10 months ago

this is tricky. We don't handle this ourselves.

If you want to support more devices, you can submit a patch like this one: https://github.com/osx-cross/homebrew-avr/blob/main/Patch/avr-libc-add-mcu-atmega168pb.patch

As for the github repo for avr-libc, we are waiting for them to make a new release in order to use it here. Only then will the new devices be usable here.

I'll close the issue for now, but I'm happy to review a PR, either for a patch or when avr-libc makes a new release.