2019-10-24 06:47 AM
I can't get the sample running on my stm32F746-discovery. I followed the instructions in https://www.youtube.com/watch?v=43qQhrXc3n4.
After changing MX_QUADSPI_Init(void) to the values in
the stm32746g_discovery_qspi.c I get a picture with a button but it seems not
to refresh. The touch is working as it can be tested with the debugger.
static void MX_QUADSPI_Init(void)
{
/* USER CODE BEGIN QUADSPI_Init 0 */
/* USER CODE END QUADSPI_Init 0 */
/* USER CODE BEGIN QUADSPI_Init 1 */
/* USER CODE END QUADSPI_Init 1 */
/* QUADSPI parameter configuration*/
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 255;
hqspi.Init.FifoThreshold = 1;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
hqspi.Init.FlashSize = 1;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
hqspi.Init.FlashID = QSPI_FLASH_ID_1;
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
if (HAL_QSPI_Init(&hqspi) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN QUADSPI_Init 2 */
HAL_QSPI_DeInit(&hqspi);
hqspi.Init.ClockPrescaler = 1; /* QSPI freq = 216 MHz/(1+1) = 108 Mhz */
hqspi.Init.FifoThreshold = 4;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
hqspi.Init.FlashSize = POSITION_VAL(0x1000000) - 1; //#define N25Q128A_FLASH_SIZE 0x1000000
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
hqspi.Init.FlashID = QSPI_FLASH_ID_1;
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
if (HAL_QSPI_Init(&hqspi) != HAL_OK)
{
Error_Handler();
}
/* USER CODE END QUADSPI_Init 2 */
}
It would be very helpful if someone could share a working project out of the newest STM32CubeIDE 1.1.0. With that it's possible to compare the settings in the Cube. There might be other values that have to be changed like those from MX_QUADSPI_Init()
2019-11-06 02:11 AM
The display is running yet. Problem was that the Cube (STM32CubeIDE 1.1.0) generates wrong settings for MX_QUADSPI_Init(). It works with those from the BSP. See user code section.
1. static void MX_QUADSPI_Init(void)
2. {
3.
4. /* USER CODE BEGIN QUADSPI_Init 0 */
5.
6. /* USER CODE END QUADSPI_Init 0 */
7.
8. /* USER CODE BEGIN QUADSPI_Init 1 */
9.
10. /* USER CODE END QUADSPI_Init 1 */
11. /* QUADSPI parameter configuration*/
12. hqspi.Instance = QUADSPI;
13. hqspi.Init.ClockPrescaler = 255;
14. hqspi.Init.FifoThreshold = 1;
15. hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
16. hqspi.Init.FlashSize = 1;
17. hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE;
18. hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
19. hqspi.Init.FlashID = QSPI_FLASH_ID_1;
20. hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
21. if (HAL_QSPI_Init(&hqspi) != HAL_OK)
22. {
23. Error_Handler();
24. }
25. /* USER CODE BEGIN QUADSPI_Init 2 */
26. BSP_QSPI_Init();
27. BSP_QSPI_MemoryMappedMode();
28. HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
29. /* USER CODE END QUADSPI_Init 2 */
30.
31. }