External Nor flash - HAL_NOR_MspWait makes a delay when the ready(H)/busy(L) pin is high. Could anybody explain to me why?
Hi ALL,
From the below first if condition code, when the ready/busy pin is high and the timeout is bigger than 0, timeout delay is applied. From my common sense, when external nor flash is busy, the delay should be applied, but this is totally the opposite. The next if condition code is exactly same as my expectation.
I checked other example projects code and all the same. Could you explain to me why?
void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout)
{
uint32_t timeout = Timeout;
/* Polling on Ready/Busy signal */
while((HAL_GPIO_ReadPin(NOR_READY_BUSY_GPIO, NOR_READY_BUSY_PIN) != NOR_BUSY_STATE) && (timeout > 0))
{
timeout--;
}
timeout = Timeout;
/* Polling on Ready/Busy signal */
while((HAL_GPIO_ReadPin(NOR_READY_BUSY_GPIO, NOR_READY_BUSY_PIN) != NOR_READY_STATE) && (timeout > 0))
{
timeout--;
}
}
