platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
140 stars 105 forks source link

ATTiny Support #47

Open chappy1978 opened 7 years ago

chappy1978 commented 7 years ago

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

ivankravets commented 7 years ago

@valeros Please push all changes to https://github.com/platformio/platformio-pkg-framework-arduinoavr

ivankravets commented 7 years ago

@chappy1978 @Thijxx could you re-test it?

  1. Uninstall existing stable version of Atmel AVR development platform via pio platform uninstall atmelavr
  2. Install development version: pio platform install https://github.com/platformio/platform-atmelavr.git

See all board manifests: https://github.com/platformio/platform-atmelavr/tree/develop/boards

Does it work?

ghost commented 7 years ago

I can see the changes made but I have no clue how to select the board.

[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino

This is not it, maybe you could shine a light on the config or better, point me to the right spot in the documentation :D

edit It is in fact a complete mess now, no matter what code I try to build it always fails on the RadioHead library, it is not even included nor is it anywhere in the project folder. But this may be a whole new issue.

ivankravets commented 7 years ago

@Thijxx Could you provide a demo project to reproduce this issue?

ghost commented 7 years ago

This is the project folder. It looks like it is missing the SPI data. I expect these to be available: https://github.com/SpenceKonde/ATTinyCore/tree/master/avr/libraries

attiny85_spencekondetest.zip

valeros commented 7 years ago

Hi @Thijxx! Probably you should use software SPI as mentioned in the RadionHead library:

lib/TinyHead/RadioHead.h:786:4: warning: #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead.

In ATTiny Core README said that with ATtiny x5 (25/45/85) you can use SPI USI library.

Have you tried to build your project in Arduino IDE?

ghost commented 7 years ago

Yes, this works in the Arduino IDE. Below is the verbose compile log from the Arduino IDE based on the same code. There are many warnings but no errors.

/usr/share/arduino/arduino-builder -dump-prefs -logger=machine -hardware /usr/share/arduino/hardware -hardware /home/thijs/.arduino15/packages -hardware /home/thijs/Documents/Arduino/hardware -tools /usr/share/arduino/tools-builder -tools /home/thijs/.arduino15/packages -libraries /home/thijs/Documents/Arduino/libraries -fqbn=ATTinyCore-master:avr:attinyx5:LTO=disable,TimerClockSource=default,chip=85,clock=8internal,bod=disable -ide-version=10802 -build-path /tmp/arduino_build_937199 -warnings=default -build-cache /tmp/arduino_cache_229451 -prefs=build.warn_data_percentage=75 -verbose /tmp/arduino_modified_sketch_875097/Blink.ino
/usr/share/arduino/arduino-builder -compile -logger=machine -hardware /usr/share/arduino/hardware -hardware /home/thijs/.arduino15/packages -hardware /home/thijs/Documents/Arduino/hardware -tools /usr/share/arduino/tools-builder -tools /home/thijs/.arduino15/packages -libraries /home/thijs/Documents/Arduino/libraries -fqbn=ATTinyCore-master:avr:attinyx5:LTO=disable,TimerClockSource=default,chip=85,clock=8internal,bod=disable -ide-version=10802 -build-path /tmp/arduino_build_937199 -warnings=default -build-cache /tmp/arduino_cache_229451 -prefs=build.warn_data_percentage=75 -verbose /tmp/arduino_modified_sketch_875097/Blink.ino
Using board 'attinyx5' from platform in folder: /home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr
Using core 'tiny' from platform in folder: /home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr
Detecting libraries used...
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics   -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/tmp/arduino_build_937199/sketch/Blink.ino.cpp" -o "/dev/null"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics   -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/tmp/arduino_build_937199/sketch/Blink.ino.cpp" -o "/dev/null"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics   -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/home/thijs/Documents/Arduino/libraries/TinyHead/RHCRC.cpp" -o "/dev/null"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics   -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/home/thijs/Documents/Arduino/libraries/TinyHead/RHGenericDriver.cpp" -o "/dev/null"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics   -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/home/thijs/Documents/Arduino/libraries/TinyHead/RH_ASK.cpp" -o "/dev/null"
Generating function prototypes...
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics   -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/tmp/arduino_build_937199/sketch/Blink.ino.cpp" -o "/tmp/arduino_build_937199/preproc/ctags_target_for_gcc_minus_e.cpp"
"/usr/bin/arduino-ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_937199/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/tmp/arduino_build_937199/sketch/Blink.ino.cpp" -o "/tmp/arduino_build_937199/sketch/Blink.ino.cpp.o"
In file included from /home/thijs/Documents/Arduino/libraries/TinyHead/RHGenericDriver.h:9:0,
                 from /home/thijs/Documents/Arduino/libraries/TinyHead/RH_ASK.h:9,
                 from /tmp/arduino_modified_sketch_875097/Blink.ino:5:
/home/thijs/Documents/Arduino/libraries/TinyHead/RadioHead.h:786:4: warning: #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead. [-Wcpp]
   #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead.
    ^
Compiling libraries...
Compiling library "TinyHead"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/home/thijs/Documents/Arduino/libraries/TinyHead/RHCRC.cpp" -o "/tmp/arduino_build_937199/libraries/TinyHead/RHCRC.cpp.o"
In file included from /home/thijs/Documents/Arduino/libraries/TinyHead/RHCRC.h:12:0,
                 from /home/thijs/Documents/Arduino/libraries/TinyHead/RHCRC.cpp:43:
/home/thijs/Documents/Arduino/libraries/TinyHead/RadioHead.h:786:4: warning: #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead. [-Wcpp]
   #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead.
    ^
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/home/thijs/Documents/Arduino/libraries/TinyHead/RHGenericDriver.cpp" -o "/tmp/arduino_build_937199/libraries/TinyHead/RHGenericDriver.cpp.o"
In file included from /home/thijs/Documents/Arduino/libraries/TinyHead/RHGenericDriver.h:9:0,
                 from /home/thijs/Documents/Arduino/libraries/TinyHead/RHGenericDriver.cpp:6:
/home/thijs/Documents/Arduino/libraries/TinyHead/RadioHead.h:786:4: warning: #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead. [-Wcpp]
   #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead.
    ^
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "-I/home/thijs/Documents/Arduino/libraries/TinyHead" "/home/thijs/Documents/Arduino/libraries/TinyHead/RH_ASK.cpp" -o "/tmp/arduino_build_937199/libraries/TinyHead/RH_ASK.cpp.o"
In file included from /home/thijs/Documents/Arduino/libraries/TinyHead/RHGenericDriver.h:9:0,
                 from /home/thijs/Documents/Arduino/libraries/TinyHead/RH_ASK.h:9,
                 from /home/thijs/Documents/Arduino/libraries/TinyHead/RH_ASK.cpp:6:
/home/thijs/Documents/Arduino/libraries/TinyHead/RadioHead.h:786:4: warning: #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead. [-Wcpp]
   #warning Arduino TinyCore does not support hardware SPI. Use software SPI instead.
    ^
Compiling core...
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -c -g -Os  -std=gnu11 -ffunction-sections -fdata-sections -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/WInterrupts.c" -o "/tmp/arduino_build_937199/core/WInterrupts.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -c -g -Os  -std=gnu11 -ffunction-sections -fdata-sections -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/wiring.c" -o "/tmp/arduino_build_937199/core/wiring.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -c -g -Os  -std=gnu11 -ffunction-sections -fdata-sections -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/wiring_analog.c" -o "/tmp/arduino_build_937199/core/wiring_analog.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -c -g -Os  -std=gnu11 -ffunction-sections -fdata-sections -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/wiring_digital.c" -o "/tmp/arduino_build_937199/core/wiring_digital.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -c -g -Os  -std=gnu11 -ffunction-sections -fdata-sections -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/wiring_pulse.c" -o "/tmp/arduino_build_937199/core/wiring_pulse.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -c -g -Os  -std=gnu11 -ffunction-sections -fdata-sections -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/wiring_shift.c" -o "/tmp/arduino_build_937199/core/wiring_shift.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/HardwareSerial.cpp" -o "/tmp/arduino_build_937199/core/HardwareSerial.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/Print.cpp" -o "/tmp/arduino_build_937199/core/Print.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/Stream.cpp" -o "/tmp/arduino_build_937199/core/Stream.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/TinySoftwareSerial.cpp" -o "/tmp/arduino_build_937199/core/TinySoftwareSerial.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/Tone.cpp" -o "/tmp/arduino_build_937199/core/Tone.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/WMath.cpp" -o "/tmp/arduino_build_937199/core/WMath.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/WString.cpp" -o "/tmp/arduino_build_937199/core/WString.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD  -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR   "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny" "-I/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/variants/tinyX5" "/home/thijs/Documents/Arduino/hardware/ATTinyCore-master/avr/cores/tiny/main.cpp" -o "/tmp/arduino_build_937199/core/main.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/WInterrupts.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/wiring.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/wiring_analog.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/wiring_digital.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/wiring_pulse.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/wiring_shift.c.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/HardwareSerial.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/Print.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/Stream.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/TinySoftwareSerial.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/Tone.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/WMath.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/WString.cpp.o"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-ar" rcs  "/tmp/arduino_build_937199/core/core.a" "/tmp/arduino_build_937199/core/main.cpp.o"
Archiving built core (caching) in: /tmp/arduino_cache_229451/core/core_ATTinyCore-master_avr_attinyx5_LTO_disable,TimerClockSource_default,chip_85,clock_8internal,bod_disable_f4697a13a0e708cd609d188b74bfe921.a
Linking everything together...
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc"  -Os  -Wl,--gc-sections -mmcu=attiny85  -o "/tmp/arduino_build_937199/Blink.ino.elf" "/tmp/arduino_build_937199/sketch/Blink.ino.cpp.o" "/tmp/arduino_build_937199/libraries/TinyHead/RHCRC.cpp.o" "/tmp/arduino_build_937199/libraries/TinyHead/RHGenericDriver.cpp.o" "/tmp/arduino_build_937199/libraries/TinyHead/RH_ASK.cpp.o" "/tmp/arduino_build_937199/core/core.a" "-L/tmp/arduino_build_937199" -lm
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "/tmp/arduino_build_937199/Blink.ino.elf" "/tmp/arduino_build_937199/Blink.ino.eep"
"/home/thijs/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom  "/tmp/arduino_build_937199/Blink.ino.elf" "/tmp/arduino_build_937199/Blink.ino.hex"
Using library TinyHead in folder: /home/thijs/Documents/Arduino/libraries/TinyHead (legacy)
Sketch uses 5048 bytes (61%) of program storage space. Maximum is 8192 bytes.
Global variables use 393 bytes (76%) of dynamic memory, leaving 119 bytes for local variables. Maximum is 512 bytes.
Low memory available, stability problems may occur.
valeros commented 7 years ago

Could you please try to manually disable SPI library in your project?

[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino
lib_ignore = SPI
ghost commented 7 years ago

This seems to work. Could you please elaborate on why this works the way it does? I'd expect the Arduino IDE to show the same behaviour..

[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino
lib_ignore = SPI

How the core switching works is still not clear to me, don't I need to include core = tiny or anything in the ini file?

valeros commented 7 years ago

Actually, there is no core option in platformio.ini at all. core option is specified in the board configuration file attiny85.json and you cannot change it in your platformio.ini. As for the error with SPI library, there is no default SPI implementation for tiny core, so PlatformIO build system decided to compile a generic one for all AVR boards. We will fix this behavior in the next framework update.

ghost commented 7 years ago

@ivankravets, you may want to close this issue again. Thanks.

ivankravets commented 7 years ago

I've just deployed new Arduino framework. @Thijxx could you try pio update, clean project via pio run -t clean and build again with commented this line lib_ignore = SPI.

Does it work now?

ghost commented 7 years ago

If I comment the lib_ignore so it looks like ;lib_ignore = SPI I get the same error again.

ivankravets commented 7 years ago

@Thijxx could you try keeping this line commented and add

lib_ldf_mode = chain+

See http://docs.platformio.org/en/latest/librarymanager/ldf.html#dependency-finder-mode

ghost commented 7 years ago

This works, so does it mean I need to doublecheck the library for an IF statement that still points to the SPI library?

ivankravets commented 7 years ago

Now, please remove both lines lib_ldf_mode and lib_ignore. Run pio update, clean project and rebuild.

ghost commented 7 years ago

🎉 awesome, thanks y'all

ghost commented 6 years ago

This is back again, please re-open ticket and re-repair :D The solution is adding lib_ldf_mode = chain+ again.

vitormhenrique commented 6 years ago

Hello everyone, I'm also having a problem with the attiny core, trying to use the tone with the default platformio does not work, but using arduino IDE and SpenceKonde core with the same code does work, is there a work around?

glucee commented 6 years ago

I have tried the Spark Attiny AVR Programmer, it works well. You could check my repo to try my config.

hwacookie commented 6 years ago

Until this is fixed in platformio (which I really love, and I really do appreciate the work @ivankravets and his fellows are putting into it), just a hint for anyone stumbling upon this like I did: I can confirm that compiling the exact same source-code does work in the Arduino IDE.

eddnshoulders commented 5 years ago

Just in case this has been forgotten or not marked as closed on the last fix, I've just had this same problem with arduino framework 4.1.2 on core 4.1.0.

Thanks to those above for providing a workaround.