How to program attiny24


I would like to use platformio for developing a program for an AtTiny24. AFAIK there is generic support for ATTiny24 contained in Arduino framework.

I can’t make pio run with this



What do I have to do in order to get AtTiny24 support?


Hmm. Really such a strange questions, nobody can answer?

After installing framework atmelavr this seems to be a good



Could you provide a build output?

OK, found a little sample script:

#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>

int main(void)
    // make the LED pin an output for PORTB5
    DDRB = 1 << 5;

    while (1)

        // toggle the LED
        PORTB ^= 1 << 5;
    return 0;

Compiled with

pio run -v

[Thu Apr 27 21:58:15 2017] Processing attiny (platform: atmelavr, board: attiny24)
Collected 0 compatible libraries
Looking for dependencies...
Project does not have dependencies
avr-gcc -o .pioenvs/attiny/src/main.o -c -std=gnu11 -fno-fat-lto-objects -g -Os -Wall -ffunction-sections -fdata-sections -flto -mmcu=attiny24 -DF_CPU=8000000L -DPLATFORMIO=30300 -DARDUINO_ARCH_AVR -DARDUINO_AVR_ATTINY24 -Isrc src/main.c
avr-gcc -o .pioenvs/attiny/firmware.elf -Os -mmcu=attiny24 -Wl,--gc-sections -flto -fuse-linker-plugin .pioenvs/attiny/src/main.o -L.pioenvs/attiny -Wl,--start-group -lm -Wl,--end-group
avr-size --mcu=attiny24 -C -d .pioenvs/attiny/firmware.elf
avr-objcopy -O ihex -R .eeprom .pioenvs/attiny/firmware.elf .pioenvs/attiny/firmware.hex
AVR Memory Usage
Device: attiny24

Program:      84 bytes (4.1% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)

Got .hex and .elf. .Hex here:


Could disassemble:

~/.platformio/packages/toolchain-atmelavr/avr/bin/objdump -j .sec1 -d -m avr .pioenvs/attiny/firmware.hex

Looks OK (at least changes like cli() appeared in the disassembly)

Could you program attiny24 with Arduino IDE using Arduino framework?

Don’t use the IDE. Not necessary

We have an opened issue for that