PlatformIO Community

[SOLVED] Replace Generic ATtiny85 core with custom core (tiny-core) for RF24 project

Hello I’m making a project using ATtiny85, I have tried using the Generic ATtiny85 board in platformio and it works as it is. But my project requires the use of the RF24 library by TMRh20.

I am using the example provided in the library (https://tmrh20.github.io/RF24/rf24ping85_8ino-example.html).

It doesn’t work since it needs the tiny-core by CodingBadly (https://github.com/Coding-Badly/TinyCore1). I have tried using the Arduino IDE and followed the instructions provided by CodingBadly and it worked. It made use of the hardware folder to add extra boards.

Is there a way to do this in PlatformIO? Since I prefer doing my projects here rather than the Arduino IDE.

Edit. Example code for ATtiny85 RF24, compiles successfully for both PlatformIO and Arduino IDE, but when testing, data is not transmitted through RF24 when using PlatformIO.

Edit2. I solved it by creating a custom board. I downloaded the tiny-core library and copied the “tiny” folder in platformio’s cores_dir. For the custom board, I copied the generic attiny85’s json, and replaced
the “core” option in the build flags with the custom tiny core.

Summary

This text will be hidden

Summary

This text will be hidden

1 Like

Great to know, and thanks for the notes in-case anyone else has issues! :slight_smile:

So it doesn’t work with the ATTinyCore that PlatformIO uses? (This is the library from https://github.com/nRF24/RF24, isn’t it?) If so, it might be worth letting Spence know as if it doesn’t work with his core, but does with another, it’s most likely a bug. There was another user reporting issues with an ATTiny84 (rather than the 85), but they said they got it working…

Yes thats the library I’m using, there were no build or upload issues but the examples provided (GettingStarted.ino - Arduino Uno and rf24ping85.ino - ATtiny85) by the library was always failing when I was testing it. Btw, it also failed using the Arduino IDE before I installed the tiny-core.

Then I found out in the rf24ping85.ino example. It was stated “The ATtiny85 uses the tiny-core by CodingBadly(https://code.google.com/p/arduino-tiny/)”. Then I downloaded and tried it using the arduino ide, it worked and I came to this.

That sounds right… Arduino IDE doesn’t have support for the ATTiny85 out of the box… so you wouldn’t have been about to pick that MCU type.

Just wondering if something is broken in SpenceKonde’s ATTinyCore or if it’s just something that needs setting differently…

Just a further addendum after going through old atmelavr issues… it seems this issue is related, and was suggesting using that using lib_ldf_mode = chain+ fixed it. Just can’t tell if this is still the case without putting something together to test it…