FOC Init Fails with iPower GM6208 (28 poles) + AMT103 Encoder + STM32 Nucleo F446RE

It’s all good, I was able to solve my problem.
First, you need to set the number of pole pairs, not the total number of poles.
So I changed:

BLDCMotor motor = BLDCMotor(28);

to :

BLDCMotor motor = BLDCMotor(14);

Then, you need to add the interrupt for the index pin:

void doIndex() { sensor.handleIndex(); }

And modify the interrupt initialization from:

sensor.enableInterrupts(doA, doB);

to:

sensor.enableInterrupts(doA, doB, doIndex);