Question
External loader issue with STM32H743 and W25Q512
Hi all,
I am working on the development of an external loader for STM32CubeProgrammer.
CPU is STM32H743, flash memory is W25Q512 in quadspi mode.
I have a problem in indirect mode: it's working (read and write), but in read I have long timeouts:
//Send command
if (HAL_QSPI_Command(&FLASH_QSPI_PORT, &sCommand, QFLASH_DEF_TIMEOUT) != HAL_OK)
{
return HAL_ERROR;
}
// Receive data
if (HAL_QSPI_Receive(&FLASH_QSPI_PORT, buffer, QFLASH_DEF_TIMEOUT) != HAL_OK)
{
return HAL_ERROR;
}It seems that HAL_QSPI_Receive goes ok on the first chunk of data, then when cubeprogrammer calls a Read for the following chunks I always have a timeout in HAL_QSPI_Receive, as if this call never finds the FTF or TCF flags active (QUADSPI_SR):
HAL_StatusTypeDef HAL_QSPI_Receive:
.....
while(hqspi->RxXferCount > 0U)
{
/* Wait until FT or TC flag is set to read received data */
status = QSPI_WaitFlagStateUntilTimeout(hqspi, (QSPI_FLAG_FT | QSPI_FLAG_TC), SET, tickstart, Timeout);
if (status != HAL_OK)
{
break;
}
*hqspi->pRxBuffPtr = *((__IO uint8_t *)data_reg);
hqspi->pRxBuffPtr++;
hqspi->RxXferCount--;
}
...any suggestions ?
Thanks !!
Lucio
