Compile error : soc/soc_caps.h: No such file

Hi wizards,
I try to get the AS5048A working on a ESP32 over (V)SPI.
I’ve sampled a test code from various sFOC examples together, but in every version I tried to compile, I get the same error:
C:\Users\USER\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32\esp32_ledc_mcu.cpp:21:26: fatal error: soc/soc_caps.h: No such file or directory

The latest code I tried:

#include "Arduino.h"
#include "Wire.h"
#include "SPI.h"
#include <SimpleFOC.h>
#include "SimpleFOCDrivers.h"
#include "encoders/as5048a/MagneticSensorAS5048A.h"

#define SENSOR1_CS 2 // some digital pin that you're using as the nCS pin

// alternative pinout for esp32_SPI
#define VSPI_MISO 19
#define VSPI_MOSI 23
#define VSPI_SCLK 18

SPIClass SPI_1(VSPI);
MagneticSensorAS5048A sensor(SENSOR1_CS);



void setup() {
  // monitoring port
  Serial.begin(115200);

  // start the newly defined spi communication
  SPI_1.begin(VSPI_SCLK, VSPI_MISO, VSPI_MOSI, SENSOR1_CS); //SCLK, MISO, MOSI, SS 
  // initialise magnetic sensor hardware
  sensor.init(&SPI_1);

  Serial.println("Sensor ready");
  _delay(1000);
}

void loop() {
  // iterative function updating the sensor internal variables
  // it is usually called in motor.loopFOC()
  // this function reads the sensor hardware and 
  // has to be called before getAngle nad getVelocity
  sensor.update();
  // display the angle and the angular velocity to the terminal
  Serial.print(sensor.getAngle());
  Serial.print("\t");
  Serial.println(sensor.getVelocity());
}

I’m running out of ideas
Olaf

IIRC this error means you need to upgrade the ESP32 platform / board files…

2 Likes

That’s quite possible.
My ESP32 database is a mess. I installed tons of libraries for all sorts of stuff.
I’m currently installing the latest espressif systems library.

Fingers crossed

I had to update arduinoIDE from 1.8.x to 2.1.x and also the esp32 lib was stone-age.
Now I can compile, but it takes forever.
I checked with taskmanager and the IDE and my antimalware program were very busy.

Do I have to change some settings to speed it up? Start IDE as admin?

Hey,

Great it’s compiling!

The speed issue has two parts, I think.

I use mostly use Mac at home, I have a fast Mac, and even there ArduinoIDE is very slow at compiling compared to other tools/environments. PlatformIO is a big improvement, if you care to learn it.

But on Windows systems I have often had the problem that the virus scanner slows down compilers, sometimes by 10x. Depending on your setup, the solution can be to exclude the directories used by arduino from the “on access” scanning, and just scan those folders overnight or something like that…

2 Likes