Closed Granjow closed 2 years ago
@Granjow Thanks for the detailed description here as it helped me get a project build fixed much faster than I expected. I've opened up a PR with your suggested change.
Hi @Granjow @rholder ! Thanks for reporting, should be fixed in the dev branch. Please retest with the upstream version of the platform:
[env:attiny85]
platform = https://github.com/platformio/platform-atmelavr.git
framework = arduino
board = attiny85
I don't know where the correct place to fix #255 is, but the attiny85.json definitely isn't because it is not even possible to override the clock source setting with board_build.clocksource = 0.
It's was possible to override simply by specifying your own define -DCLOCK_SOURCE=0
. Anyway, as you requested, it's now also possible to configure these settings via the board configuration:
[env:attiny85]
platform = atmelavr
framework = arduino
board = attiny85
board_build.f_cpu = 16000000L
board_build.clock_source = 6
@rholder Glad to hear!
@valeros Thanks a lot for the fix! Can I use pio platform install
to test the upstream version?
@Granjow Yes, simply run pio platform install https://github.com/platformio/platform-atmelavr.git
, but to avoid any conflicts I'd recommend to delete the stable version beforehand.
@valeros That worked. Can confirm that with this patch the problem is solved and the ATtiny85 now runs as expected. Thanks again!
For people who came here from a websearch if your attyiny85 runs at half speed through Platformio and works fine through Arduino IDE
I'd assume that the next release will fix it, but until then these are your only options
temporary fix: add next line to platformio.ini [env:...]
build_flags = -DCLOCK_SOURCE=0
Commit 012de336af56472e65e2db2e6c2d95d9a137803d, which was released with version 3.4.0, breaks ATtiny support when using frequencies other than 16 MHz. When setting
board_build.f_cpu = 8000000L
, the code is still compiled for 16 MHz due to the clock source and therefore the code only runs half as fast.I don't know where the correct place to fix #255 is, but the attiny85.json definitely isn't because it is not even possible to override the clock source setting with
board_build.clocksource = 0
. A local workaround would probably be to setboard_build.clocksource = 6
e.g. for the ATtiny85 in theplatformio.ini
.