2025-06-09 10:56 PM
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; }
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
2025-06-10 12:50 AM
Hello @lucky65 and welcome to the community;
Are you using TIM6 for Tick timebase?
If you use TIM6, please try to enable the SysTick instead of TIM6 timebase.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-06-10 4:24 AM
Hi Kaouthar,
thanks for your reply.
Actually I am using a "nop loop" for the delay, interrupts are disabled ; the problem seems that the call to
status = QSPI_WaitFlagStateUntilTimeout(hqspi, (QSPI_FLAG_FT | QSPI_FLAG_TC), SET, tickstart, Timeout);
does not exit with QSPI_FLAG_FT | QSPI_FLAG_TC condition.
Work in progress, up to now I have no explanation for this.
Thanks,
best regards
Lucio
2025-06-10 6:19 AM - edited 2025-06-10 6:19 AM
Hello @lucky65;
Is the QUADSPI configured in indirect read with only data phase activated?
Are you get a BUSY flag of the QUADSPI_SR register?
Could you please check the STM32H743 errata sheet.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.