Skip to content

Add ATtiny port with avr25 CPU support and fix AVR vector tables - #923

Merged
mattnite merged 16 commits into
mainfrom
attiny
May 21, 2026
Merged

mattnite merged 16 commits into
mainfrom
attiny

Conversation

@mattnite

@mattnite mattnite commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

A bare minimum start for attiny:

Comment thread examples/microchip/attiny/src/blinky84.zig Outdated
@mattnite
mattnite force-pushed the attiny branch 2 times, most recently from d24d37b to 9ab36bb Compare May 19, 2026 05:01

@mattnite mattnite left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Feels like there's a lot of duplication in the cpu files, will have to comb through and trim it down.

Comment thread core/src/cpus/avr5.zig Outdated
Comment thread core/src/cpus/avr25.zig Outdated
Comment thread build.zig
mattnite and others added 6 commits May 19, 2026 14:33
Add a new port for Microchip ATtiny (ATtiny85, ATtiny84) with HAL,
board definitions (Digispark, Adafruit Trinket, Adafruit Gemma),
and blinky examples including an interrupt handler example.

Also fix the AVR startup logic for both avr25 and avr5:
- Place vector table in microzig_flash_start section so it lands at
  address 0x0 where the hardware expects it
- Emit full vector table with entries for all interrupt vectors, not
  just the reset vector
- Add InterruptOptions so users can specify interrupt handlers via
  microzig_options, which get wired into the vector table
- Update calling convention names for zig 0.15.2 compatibility
  (.avr_signal/.avr_interrupt/.auto, .@"fn")

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@mattnite mattnite left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

More comments and verifications that need to be made before merging

Comment thread examples/microchip/attiny/src/blinky_interrupt.zig Outdated
Comment thread port/microchip/attiny/src/boards/adafruit_gemma.zig Outdated
Comment thread port/microchip/attiny/src/boards/adafruit_trinket.zig
Comment thread port/microchip/attiny/src/boards/digispark.zig Outdated
Comment thread port/microchip/attiny/src/hals/ATtiny84.zig Outdated
Comment thread port/microchip/attiny/build.zig
Comment thread port/microchip/attiny/build.zig
Comment thread port/microchip/attiny/build.zig Outdated
Comment thread port/microchip/attiny/build.zig
Comment thread port/microchip/attiny/build.zig
@mattnite
mattnite merged commit a9c8631 into main May 21, 2026
59 checks passed
@mattnite
mattnite deleted the attiny branch May 21, 2026 20:18
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.

2 participants