I am new to working with STM32 Microcontrollers. When I analyze the SPI Communication I get the clock signal, which you can see in pic 1 below. The clock is jumping between a frequenzy of 1.333 MhZ and 2 Mhz. I also used STM32DUINO with a basic Arduino SPI snippet and testet it with the Arduino Uno. With the Uno the clock is working properly. I also changed the SPI Channel of my STM32 board from SPI1 to SPI3. Both isn't working.
I used the normal configurator which CubeIDE has (Pic 2). Here is my STM32CubeIDE code:
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET);
HAL_Delay(10);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET);
HAL_SPI_TransmitReceive(&hspi3,(uint8_t *) 0xA1, (uint8_t *) spi_buf, 1, 100);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET);
Thank you for your help in advance!