osx-cross / homebrew-avr

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

Add support for new devices for `avr-size` #318

Open chenzhuoyu opened 12 months ago

chenzhuoyu commented 12 months ago

This PR adds support for these (comprehensive list) new AVR devices into avr-size:

Now it reports the correct device and memory usage rather than "Unknown":

$ avr-size --format=avr --mcu=attiny1614 example.elf
AVR Memory Usage
----------------
Device: attiny1614

Program:    1420 bytes (8.7% Full)
(.text + .data + .bootloader)

Data:        276 bytes (13.5% Full)
(.data + .bss + .noinit)
ladislas commented 12 months ago

thanks @chenzhuoyu for the PR.

where is the patch from?

chenzhuoyu commented 12 months ago

thanks @chenzhuoyu for the PR.

where is the patch from?

  1. I noticed that the patch file applied in Formula/avr-binutils.rb is NOT the one in this repo, and they are quite different. So I replaced Patch/avr-binutils-size.patch with the one referenced in Formula/avr-binutils.rb (Is there any reasons for the discrepancy?)
  2. I wrote a script to diff between the current avr-libc and avrdudes/avr-libc to find out all the newly added parts. It turns out there are 79 of them, which I listed above.
  3. I wrote another script to scrape all the EEPROM / Flash / Internal SRAM sizes from each ioxxx.h for the new parts, verified some of them manually, and updated the patch file.
chenzhuoyu commented 11 months ago

@ladislas Any updates on this?

ladislas commented 10 months ago

it's in my long long todo list, but I'm a bit overwhelmed at the moment 😓

I also don't use avr/arduino that much now, so getting the pieces to test this is not an easy task.

@osx-cross/team what's your take on this?

@chenzhuoyu give me a few more days to dive into it.