Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new devices for avr-size #318

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chenzhuoyu
Copy link

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)

@ladislas
Copy link
Member

thanks @chenzhuoyu for the PR.

where is the patch from?

@@ -27,8 +27,8 @@ class AvrBinutils < Formula

# Support for -C in avr-size
patch do
url "https://raw.githubusercontent.com/archlinux/svntogit-community/c3efadcb76f4d8b1a3784015e7c472f59dbfa7de/avr-binutils/repos/community-x86_64/avr-size.patch"
sha256 "7aed303887a8541feba008943d0331dc95dd90a309575f81b7a195650e4cba1e"
url "https://raw.githubusercontent.com/chenzhuoyu/homebrew-avr/2676e4caa70022cf7b087f7c1bb676e368343190/Patch/avr-binutils-size.patch"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this must point to the patch in this repository, not in yours

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... but how do I put this patch file into this repo before... well putting this patch file into this repo? Should I split this into two PRs where the first one adds a patch file, and the second one applies the patch?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ladislas I reverted the changes in avr-binutils.rb for this PR. After this PR got merged, I will open another PR to apply the patch.

@chenzhuoyu
Copy link
Author

chenzhuoyu commented Sep 12, 2023

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
Copy link
Author

@ladislas Any updates on this?

@ladislas
Copy link
Member

ladislas commented Nov 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants