This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil 5.24 + AT45DB642D. Why so hard?

Hi everyone!
. I try to use EFS(Embedde File System) with Keil 5.24 for AT45DB642D.
I read manual www.keil.com/.../fs_create_app.html
And config my project as described. For SPI flash.
Initial current drive = F0.

But i got a lot error after compilation. Like this:

C:\Keil_v5\ARM\PACK\Keil\STM32H7xx_DFP\2.2.0\Drivers\BSP\STM32H743I_EVAL\stm32h743i_eval_nor.c(416): error: #20: identifier "NOR_HandleTypeDef" is undefined

C:\Keil_v5\ARM\PACK\Keil\STM32H7xx_DFP\2.2.0\Drivers\BSP\STM32H743I_EVAL\stm32h743i_eval_nor.h(124): error: #20: identifier "NOR_IDTypeDef" is undefined

Could anyone give me advice how to use EFS for spi flash?

P.S. I used Keil 4.54 before. And it was not so hard to use AT45DB642D.
There were few files : ARM-RL library,FILE_CONFIG.C, FS_SPI_FLASHPRG.C.

Best regards, Vladimir

Parents Reply Children
  • Hi everyone!
    I found solution for this problem.
    It's necessarry set DRIVER_SPI_NUM=1 for Spi_drive 1 in Target - > C++ define.

    But after that i have problem with SPI interchange.
    There is no try to send or receive bytes.

    fcheck ("F0:") return: fsAccessDenied.

    functions:
    static int32_t ReadData (uint32_t addr, void *data, uint32_t cnt)
    static ARM_FLASH_STATUS GetStatus (void)
    Not calling.

    How it is possible to see what is inside fcheck() functions.

    P.S. finit("F0:") return fsOK.

    Best regards, Vladimir.

  • Does anyone have Project example for Keil 5(EFS) + AT45xxx ?

  • Hi everyone! The problem is solved.
    For build AT45DB161D.c it's better to use AT45DB642D.c
    Because it's correct to use : /* buf[4..7]: don't care */
    But in AT45DB641E.c use inappropriate: /* buf[4...5]: don't care */

    static int32_t ReadData (uint32_t addr, void *data, uint32_t cnt) {
      uint32_t page_addr;
      uint32_t page_offs;
      uint8_t  buf[8];
      int32_t  result;
    
      if (data == NULL) {
        return ARM_DRIVER_ERROR_PARAMETER;
      }
    
      page_addr = addr / PAGE_SIZE;
      page_offs = addr % PAGE_SIZE;
    
      addr = (page_addr << 11) | page_offs;
    
      /* Prepare Command with address */
      buf[0] = CMD_READ_DATA;
      buf[1] = (uint8_t)(addr >> 16);
      buf[2] = (uint8_t)(addr >>  8);
      buf[3] = (uint8_t)(addr >>  0);
      /* buf[4..7]: don't care */
    
      /* Select Slave */
      result = ptrSPI->Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE);
      if (result != ARM_DRIVER_OK) { return ARM_DRIVER_ERROR; }
    
      /* Send Command with Address */
      result = ptrSPI->Send(buf, 8);
      if (result != ARM_DRIVER_OK) { goto transfer_error; }
      while (ptrSPI->GetDataCount() != 8);
    

    Best regards, Vladimir