Keil Logo

Keil 5.24 + AT45DB642D. Why so hard?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
Vladimir Timohin
Posted
12-Apr-2019 11:33 GMT
Toolset
ARM
New! 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 http://www.keil.com/pack/doc/mw/FileSystem/html/fs_create_app.html#fs_Device_Configuration
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

Author
Andrew Neil
Posted
12-Apr-2019 13:03 GMT
Toolset
None
New! With errors like
error: #20: identifier "NOR_HandleTypeDef" is undefined

and

error: #20: identifier "NOR_IDTypeDef" is undefined

it sounds like you have omitted to #include a required header file or files ...

Author
Vladimir Timohin
Posted
12-Apr-2019 22:20 GMT
Toolset
None
New! RE: With errors like

I decided to build new project. And after that i got next error:

Error: L6218E: Undefined symbol Driver_SPI0 (referred from at45db641e.o).

I have next RTE Configuration:

CMSIS -> Core
CMSIS -> RTOS2(API)->Keil RTX5
CMSIS Driver -> Flash -> AT45DB642D
CMSIS Driver -> SPI(API) -> SPI
Compiler -> Event Recorder
Compiler -> I/O -> File
Device -> Startup
Device -> STM32Cube Framework (API) -> STM32CubeMX ( SPI #1 activated Full Duplex Mode)
Device -> STM32Cube HAL -> Common
Device -> STM32Cube HAL -> Cortex
Device -> STM32Cube HAL -> DMA
Device -> STM32Cube HAL -> GPIO
Device -> STM32Cube HAL -> MDMA
Device -> STM32Cube HAL -> PWR
Device -> STM32Cube HAL -> RCC
Device -> STM32Cube HAL -> SPI
File System -> CORE
File System -> Drive ->NOR ( 1 pcs)

All drivers installed. How could i fix my error?

Best regards, Vladimir.

Author
Andrew Neil
Posted
12-Apr-2019 22:42 GMT
Toolset
None
New! RE: Error: L6218E: Undefined symbol Driver_SPI0

That's a Linker error.

So you've used a function without providing any definition (aka implementation) of it.

Most often, this is because you've #included a header, but have not provided the corresponding source or binary library file.

http://www.keil.com/support/man/docs/armclang_err/armclang_err_dom1365073159742.htm

Author
Vladimir Timohin
Posted
14-Apr-2019 21:24 GMT
Toolset
None
New! RE: Error: L6218E: Undefined symbol Driver_SPI0

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.

Author
Vladimir Timohin
Posted
15-Apr-2019 07:25 GMT
Toolset
None
New! RE: Error: L6218E: Undefined symbol Driver_SPI0

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

Author
Vladimir Timohin
Posted
21-Apr-2019 21:33 GMT
Toolset
None
New! RE: Error: L6218E: Undefined symbol Driver_SPI0 SOLVED!

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

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.