Attiny85 compiled file is different than the one compile with arduino IDE

Hi there,

First time I’m using platformio. Seems to be a great way to developp!

I’m trying to compile a project which work fine when used with the Arduino IDE.

With platformio, the project compile fine but the generated binary is not the same and does not run on my attiny85.

The base framework I’m using is the same with Arduino IDE and platformio (framework-arduino-avr-attiny 1.5.2).

The project is a small temperature sensor (bme280) with a 433mhz transmitter (cheap chinese one).

All the code and libraries are strictely the same. The fuse configuration is ok. I cannot figure what’s going wrong with platformio.

Has anyone a hint for me?

Here the complete source code of the app (https://drive.google.com/file/d/1gIqAp1BJ9HeIW_2udJcTDyQLolRM_-s1/view?usp=sharing)

In the compressed folder, I added the elf and hex arduino generated files (which work fine).

Thx

ok, I’ve found the solution!

When comparing the compilation parameters between the Arduino IDE and platformio, I’ve found that platformio pass the parameter “-DCLOCK_SOURCE=6” which for me is false…

By addind these lines to my platformio.ini file :

build_unflags =
-DCLOCK_SOURCE=6
build_flags =
-DCLOCK_SOURCE=0

all work fine on my attiny85 !