Avr/io.h: No such file or directory error when using Adafruit BNO08x library in PlatformIO
Opened this issue · 0 comments
Hello everybody,
I connected adafruit bno085 sensor to my ESP32-S3 devkit. Uploading with arduino ide works without any problem. But when i am trying to upload the same program with platform io i got an error.
This is my ini file:
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
; change MCU frequency
board_build.f_cpu = 240000000L
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries
build_flags = -I lib
upload_rate = 115200
lib_deps = Adafruit BNO08x@^1.2.5
This is my header file:
#include <Arduino.h>/
#include <Adafruit_BNO08x.h>
#define SDA 8
#define SCL 9
#define BNO08x_DEFAULT_I2CADDR 0x4A
extern Adafruit_BNO08x bno08x;
extern sh2_SensorValue_t sensorValue;
extern bool startProcess;
extern long intervalUs;
extern int deviceID;
This is my main.cpp:
#include <Adafruit_BNO08x.h>
#include <Wire.h>
#include <Arduino.h>
#include “main.h”
Adafruit_BNO08x bno08x(-1);
sh2_SensorValue_t sensorValue;
bool startProcess = false;
long intervalUs = 66666;
int deviceID = 0;
//Initialize I2C bus
TwoWire I2CBNO080 = TwoWire(0);
void setup() {
I2CBNO080.begin(SDA,SCL,400000);
if (bno08x.begin_I2C(BNO08x_DEFAULT_I2CADDR,&I2CBNO080,deviceID)) {
delay(10);
if(bno08x.enableReport(SH2_ARVR_STABILIZED_RV,intervalUs)){
startProcess = true;
}
}
else{
//some other stuff
}
}
void loop{
runIMU();
delay(50);
}
And this is my imu file:
void runIMU(){
if (startProcess == true){
//do stuff
}
}
When i run this, i got this error
Processing esp32-s3-devkitc-1 (platform: espressif32; board: esp32-s3-devkitc-1; framework: arduino)
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (6.5.0) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM)
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
tool-esptoolpy @ 1.40501.0 (4.5.1)
toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 48 compatible libraries
Scanning dependencies…
Dependency Graph
|-- Wire @ 2.0.0
|-- ESP32 BLE Arduino @ 2.0.0
|-- Adafruit BNO08x @ 1.2.5
|-- Preferences @ 2.0.0
Building in release mode
Compiling .pio\build\esp32-s3-devkitc-1\src\main.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\coolant_control.c.o
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\eeprom.c.o
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\gcode.c.o
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\jog.c.o
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\limits.c.o
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\main.c.o
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\motion_control.c.o
In file included from C:/Users/HP/Documents/Arduino/libraries/grbl/coolant_control.c:21:
C:/Users/HP/Documents/Arduino/libraries/grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
Compiling .pio\build\esp32-s3-devkitc-1\liba92\grbl\nuts_bolts.c.o
C:/Users/HP/Documents/Arduino/libraries/grbl/eeprom.c:24:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\coolant_control.c.o] Error 1
In file included from C:/Users/HP/Documents/Arduino/libraries/grbl/gcode.c:22:
C:/Users/HP/Documents/Arduino/libraries/grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
In file included from C:/Users/HP/Documents/Arduino/libraries/grbl/jog.c:21:
C:/Users/HP/Documents/Arduino/libraries/grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\eeprom.c.o] Error 1
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\gcode.c.o] Error 1
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\jog.c.o] Error 1
In file included from C:/Users/HP/Documents/Arduino/libraries/grbl/limits.c:22:
C:/Users/HP/Documents/Arduino/libraries/grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
In file included from C:/Users/HP/Documents/Arduino/libraries/grbl/main.c:22:
C:/Users/HP/Documents/Arduino/libraries/grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
In file included from C:/Users/HP/Documents/Arduino/libraries/grbl/motion_control.c:22:
C:/Users/HP/Documents/Arduino/libraries/grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
In file included from C:/Users/HP/Documents/Arduino/libraries/grbl/nuts_bolts.c:22:
C:/Users/HP/Documents/Arduino/libraries/grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\limits.c.o] Error 1
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\motion_control.c.o] Error 1
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\main.c.o] Error 1
*** [.pio\build\esp32-s3-devkitc-1\liba92\grbl\nuts_bolts.c.o] Error 1
What am i doing wrong?