(Solved) Mbed-os 6 SPI on stmH743ZI2

I am a new on mbed OS.
I am working on SPI for mbed-os 6.15 on H743ZI2.

I am using the SPI for encoder as5048a with library Saxion-Lectoraat-MT https://os.mbed.com/teams/Saxion-Lectoraat-MT/code/AS5048/.
I do get values from my SPI pin, but the value is not correct. It does not show the expected value for encoder, the value is more like randomly jump.

If someone familiar with stmH7, please help me.

My code:

#include “mbed.h”
#include <as5048spi.h>

// The sensors connection are attached to pins 5-8
As5048Spi sensor(PB_5, PB_4,PB_3, PA_4, 1);
static BufferedSerial serial_port(TARGET_TX_PIN, TARGET_RX_PIN, 9600);
FileHandle mbed::mbed_override_console(int fd)
return &serial_port;
int main() {
while(1) {
const int
angles = sensor.read_angle();
int angle = angles[0];

    // The read angle returns the value returned over the SPI bus, including parity bit
    printf("Read result: %x\r\n", angle);
    if( As5048Spi::parity_check(angle) )
        // Convert range from 0 to 2^14-1 to 0 - 360 degrees
        int degrees = As5048Spi::degrees(angle)/100;
        printf("Parity check succesfull.\r\n");
        printf("Angle: %i degrees\r\n", degrees );
        printf("Parity check failed.\r\n");


It solved. It turns out I did not set the correct external power to my AS5048a.