cancel
Showing results for 
Search instead for 
Did you mean: 

AT45DB SPI flash + fatfs

AlexSmart
Senior

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.

0 REPLIES 0