Skip to main content
Graduate
October 14, 2020
Question

AT45DB SPI flash + fatfs

  • October 14, 2020
  • 0 replies
  • 902 views

Im using CMSIS drivers for AT45DB and SPI. And Keil filesystem.

And stuff dont work. After I call fformat function Im getting stuck at EraseChip function in AT45DB641E.c @  while (ptrSPI->GetDataCount() != 4);

The thing is that byte are sent, but I never reach HAL_SPI_TxCpltCallback, because in HAL_SPI_IRQHandler there are lines

 if (handled != 0UL)
 
 {
 
 return;
 
 }

and interrupt code always set that handled bit

/* SPI in mode Transmitter -------------------------------------------------*/
 if (HAL_IS_BIT_CLR(trigger, SPI_FLAG_UDR) && HAL_IS_BIT_SET(trigger, SPI_FLAG_TXP) && HAL_IS_BIT_CLR(trigger, SPI_FLAG_DXP))
 {
 hspi->TxISR(hspi);
 handled = 1UL;
 }

and I have no idea what the hell am I doing wrong.

    This topic has been closed for replies.