2025-05-04 2:32 AM - edited 2025-05-04 3:06 AM
Besides, I don't know whether this configuration of MX is correct.
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_GPDMA1_Init();
MX_SPI2_Init();
MX_ICACHE_Init();
MX_I2C1_Init();
MX_RTC_Init();
/* USER CODE BEGIN 2 */
HAL_I2C_MspInit(&hi2c1);
HAL_SPI_MspInit(&hspi2);
HAL_RTC_MspInit(&hrtc);