homebrew-avr icon indicating copy to clipboard operation
homebrew-avr copied to clipboard

Add support for new devices for `avr-size`

Open chenzhuoyu opened this issue 2 years ago • 4 comments
trafficstars

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

  • ATtiny202
  • ATtiny204
  • ATtiny212
  • ATtiny214
  • ATtiny402
  • ATtiny404
  • ATtiny406
  • ATtiny412
  • ATtiny414
  • ATtiny416
  • ATtiny417
  • ATtiny424
  • ATtiny426
  • ATtiny427
  • ATtiny804
  • ATtiny806
  • ATtiny807
  • ATtiny814
  • ATtiny816
  • ATtiny817
  • ATtiny824
  • ATtiny826
  • ATtiny827
  • ATtiny1604
  • ATtiny1606
  • ATtiny1607
  • ATtiny1614
  • ATtiny1616
  • ATtiny1617
  • ATtiny1624
  • ATtiny1626
  • ATtiny1627
  • ATtiny3216
  • ATtiny3217
  • ATtiny3224
  • ATtiny3226
  • ATtiny3227
  • ATmega808
  • ATmega809
  • ATmega1608
  • ATmega1609
  • ATmega3208
  • ATmega3209
  • ATmega4808
  • ATmega4809
  • AVR32DA28
  • AVR32DA32
  • AVR32DA48
  • AVR64DA28
  • AVR64DA32
  • AVR64DA48
  • AVR64DA64
  • AVR128DA28
  • AVR128DA32
  • AVR128DA48
  • AVR128DA64
  • AVR32DB28
  • AVR32DB32
  • AVR32DB48
  • AVR64DB28
  • AVR64DB32
  • AVR64DB48
  • AVR64DB64
  • AVR128DB28
  • AVR128DB32
  • AVR128DB48
  • AVR128DB64
  • AVR16DD14
  • AVR16DD20
  • AVR16DD28
  • AVR16DD32
  • AVR32DD14
  • AVR32DD20
  • AVR32DD28
  • AVR32DD32
  • AVR64DD14
  • AVR64DD20
  • AVR64DD28
  • AVR64DD32

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)

chenzhuoyu avatar Sep 11 '23 11:09 chenzhuoyu

thanks @chenzhuoyu for the PR.

where is the patch from?

ladislas avatar Sep 12 '23 07:09 ladislas

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 avatar Sep 12 '23 09:09 chenzhuoyu

@ladislas Any updates on this?

chenzhuoyu avatar Sep 26 '23 09:09 chenzhuoyu

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.

ladislas avatar Nov 08 '23 23:11 ladislas