Difference between `framework-arduino-avr` and `toolchain-atmelavr` directory?

I was looking for TWI_FREQ macro definition in twi.h file and I’ve found twi.h file in two different locations. The contents of the two files are different and only one had the macro definition I was looking for.

The file that had that had the macro I was looking for was in C:\Users\<username>\.platformio\packages\framework-arduino-avr\libraries\Wire\src\utility

The file that didn’t have the macro I was looking for was in C:\Users\<username>\.platformio\packages\toolchain-atmelavr\avr\include\util

What’s the difference betweenframework-arduino-avr and toolchain-atmelavr? Do I need to clean up my system?

Framework is a set of source files which implement Arduino specification. Toolchain is a compiler which converts source files into machine code. You need both.

Regarding two header files: one in Arduino framework folder implements Wire class to use in your program. Another one in toolchain folder contains AVR hardware register definitions and maybe low level functions. The latter is used by the former inside. So they are different indeed and both are needed for Arduino framework.

1 Like