Hi,
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 platform.io
[platformio]
env_default=attiny
[env:attiny]
board=attiny24
framework=arduino
What do I have to do in order to get AtTiny24 support?
TIA
Hmm. Really such a strange questions, nobody can answer?
After installing framework atmelavr this seems to be a good platform.in
[platformio]
env_default=attiny
[env:attiny]
board=attiny24
platform=atmelavr
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)
{
_delay_ms(500);
// 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:
:1000000010C015C014C013C012C011C010C00FC062
:100010000EC00DC00CC00BC00AC009C008C007C08C
:1000200006C011241FBECFEDCDBF02D008C0E8CF5F
:1000300080E287BB90E288B3892788BBFCCFF89425
:02004000FFCFF0
:00000001FF
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
opened 01:47PM - 25 Apr 17 UTC
bug
ts seems there are a few bugs when programming ATTiny's using Platformio and the… standard atmelavr packages. (Example: warning: "BIN" redefined #define BIN 2) I know its just a warning but who wants to look at that every time they build. I thought it would be nice to use ATTinyCore. After looking through Platformio's folders the folder format is very different, as compared to Arduino. How would I go through creating a package install for Platformio?
https://github.com/SpenceKonde/ATTinyCore