Skip to main content
ranran
Senior
February 27, 2019
Question

Bug in HAL of busy wait in flash NOR

  • February 27, 2019
  • 2 replies
  • 573 views

Hello,

Checking stm32h743 eval examples (cube) of NOR, there is a wait on busy/ready signal in code:

/* NOR Ready/Busy signal GPIO definitions */
#define NOR_READY_BUSY_PIN GPIO_PIN_6 
#define NOR_READY_BUSY_GPIO GPIOC
 
/**
 * @brief NOR BSP Wait for Ready/Busy signal.
 * @param norHandle: Pointer to NOR handle
 * @param Timeout: Timeout duration 
 * @retval None
 */
void HAL_NOR_MspWait(NOR_HandleTypeDef *norHandle, 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--;
 } 
}

 But PC6 is connected to SDIO, not to NOR, so it seems like a bug.

I also think that this "wrong" waiting can explain another case which I've posted about problematic programming performance (large timing) in NOR programming.

What do you think ?

Thanks,

ranran

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
February 27, 2019

>>What do you think ?

I believe that's a different issue..

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ranran
ranranAuthor
Senior
February 27, 2019

It looks like it waits on a wrong pin, which has a different role (SDIO) .