cancel
Showing results for 
Search instead for 
Did you mean: 

External loader issue with STM32H743 and W25Q512

lucky65
Associate II

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

3 REPLIES 3
KDJEM.1
ST Employee

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.

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

KDJEM.1
ST Employee

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.