I’m very confused.
I have set the flag to disable debug in my platform.local.txt file. I’ve set debug to look for serial 3, I’ve tried mapping my Serial port to Serial instead of Serial 3 that I have been using. No matter what, I get the same error.
I’m trying to get linear halls working with the Qvadrans. I was able to get open loop running but something here is causing the failure.
I also have my serial mapped to Serial3 so I can use an esp32 as a uart to usb converter.
My code isn’t fleshed out yet since I can’t get past compilation.
#include <SimpleFOC.h>
#include <SimpleFOCDrivers.h>
#include <encoders/linearhall/LinearHall.h>
// set RX and TX pins
HardwareSerial Serial3(PC11, PC10);
// Set the debug to try to squash the error
#define DebugSerial Serial3
// Set the pins for the hall sensors
#define LinHall0 PB0
#define LinHall1 PB1
// BLDCMotor( pole_pairs , ( phase_resistance Ohm, KV_rating optional) )
BLDCMotor motor = BLDCMotor(7, 0.024, 2800);
// Set the pings for x6 PWM
BLDCDriver6PWM driver = BLDCDriver6PWM(PA8, PB13, PA9, PB14, PA10, PB15);
// Set up the hall effect sensors
LinearHall sensor = LinearHall(LinHall0, LinHall1, 1);
// velocity set point variable
float target_velocity = 6;
void setup()
{
// use monitoring with serial
Serial3.begin(115200, SERIAL_8N1); // initialize Serial3
Serial3.println(F("Motor ready."));
Serial3.println(F("Set the target velocity using serial terminal:"));
_delay(1000);
}
void loop() {
Serial3.println("Comms work");
delay(500);
}
Error:
In file included from ~/Arduino/libraries/Simple_FOC/src/drivers/hardware_api.h:6,
from ~/Arduino/libraries/Simple_FOC/src/drivers/BLDCDriver3PWM.h:8,
from ~/Arduino/libraries/Simple_FOC/src/SimpleFOC.h:108,
from ~/Documents/Project/Code/STM32G431/STM32G431_SimpleFoc_Linear_Hall_Test/STM32G431_SimpleFoc_Linear_Hall_Test.ino:1:
~/Arduino/libraries/Simple_FOC/src/drivers/…/communication/SimpleFOCDebug.h:41:45: error: ‘Serial’ was not declared in this scope; did you mean ‘Serial4’?
41 | static void enable(Print* debugPrint = &Serial);
| ^~~~~~
| Serial4
exit status 1
Compilation error: exit status 1