Dear @rambros - sorry to keep you waiting, I did not manage to get to it until now. I have fixed this error, and updated the simplefoc_arduino_boards repository. It seems a new version of stm32duino requires some extra defines, which I have now added.
If you pull these changes and restart the Arduino IDE it should work for the Lepton board. For your board definition I am not sure if GitHub reflects the current state of your development on it, but I sent you a PR with some changes here:
this can be added to the variant files, to make it automatic…
What’s the exact output you get? Do you have debug output switched on?
For low side current sense you do have to link the driver, but I assume you tried that.
I’ve swapped to the hardware variant of the DRV8316 and tried current sensing again. During the aligning I keep getting an error for phase B. This is the serial output during start-up:
Current sense init success!
MOT: Monitor enabled!
MOT: Init
MOT: Enable driver.
MOT: Align sensor.
MOT: sensor_direction==CCW
MOT: PP check: OK!
MOT: Zero elec. angle: 4.19
MOT: Align current sense.
CS: Inv A
CS: Err align B
MOT: Align error!
MOT: Init FOC failed.
Motor ready.
Not sure what to try for troubleshooting this error. I’m using this config: LowsideCurrentSense current_sense = LowsideCurrentSense(2700, PA2, PA1, PA0);.
I don’t have a oscilloscope right now to measure the phase currents, that will have to wait till next week.