Unable to access the dataflash of Controller R5f100LE using e2studio.

I just created the workspace and project in e2studio, I added the library file

pfdl.h   pfdl.inc   pfdl.lib   r_pfdl.c

i did not even called those function of library in main function.

added  this code in r_cg_userdefine.h


#define FLASH_START_ADDRESS     (0xF1000U)                              /* Start address of data flash               */
#define TARGET_BLOCK            (0U)                                    /* Block number of target(0 ~ 3)             */
#define BLOCK_SIZE              (0x400U)                                /* Block size                                */
#define WRITE_SIZE              (1U)                                    /* Size of data to be written at once        */
#define MAX_VALUE               (0xFFU)                                 /* Maximum value of writing                  */
#define MAX_ADDRESS             ((TARGET_BLOCK + 1U) * BLOCK_SIZE - 1U) /* Maximum address of writing                */
#define PFDL_NG                 (1U)                                    /* Failure to Data Flash                     */
#define FDL_FRQ                 (32U)                                   /* Setting frequency (MHz)                   */
#define FDL_VOL                 (0x00U)                                 /* Voltage mode                              */

void    R_FDL_Init(void);
uint8_t R_FDL_BlankCheck(void);
uint8_t R_FDL_Erase(void);
uint8_t R_FDL_Verify(void);
void    R_FDL_Read(void);
uint8_t R_FDL_Write(void);
void    R_FDL_ChangeAddress(void);
uint8_t R_FDL_ExecuteWrite(void);
uint8_t R_FDL_ClearDataFlash(void);

#if    TARGET_BLOCK > 3U
#error target_block error!!




I just compiled the project, i found these error.

these are already available in library file in pfdl.h


E0562310:Undefined external symbol "_PFDL_Open" referenced in ".\src\cg_src\r_pfdl.obj"
E0562310:Undefined external symbol "_g_write_address" referenced in ".\src\cg_src\r_pfdl.obj"
E0562310:Undefined external symbol "_g_write_value" referenced in ".\src\cg_src\r_pfdl.obj"
E0562310:Undefined external symbol "_PFDL_Handler" referenced in ".\src\cg_src\r_pfdl.obj"
E0562310:Undefined external symbol "_PFDL_Execute" referenced in ".\src\cg_src\r_pfdl.obj"
E0562310:Undefined external symbol "_g_read_value" referenced in ".\src\cg_src\r_pfdl.obj"
E0562310:Undefined external symbol "_PFDL_Close" referenced in ".\src\cg_src\r_pfdl.obj"

Renesas Optimizing Linker Abort
makefile:73: recipe for target 'dataflash.abs' failed
make: *** [dataflash.abs] Error 1





These are mentioned in pfdl.h as

extern  pfdl_status_t  __far PFDL_Open(__near pfdl_descriptor_t* descriptor_pstr);

then why is creating the error.


i downloaded library files from


i downloaded sample code from


I added the library file in the sample code which i downloaded, which is also showing the same error.

so i created the new project then also its showing same problem .



Please HELP.

  • Hi Hiroshi,

    Any updates with the issue? Have you found what's causing the error?

    RenesasRulz Forum Moderator
  • Hi JB,

    Nope, I tried my best to solve <_PFDL_Open" referenced in ".\src\cg_src\r_pfdl.obj"> this error, i was able to compile it with cubesuit+ in CCRL with no error. I am unable to fine the reason why these error popped up in e2studio.
  • In reply to Hiroshi:


    How did you add the library to your e2studio project?

    Mike Clements
    RenesasRulz Moderator
  • In reply to Hiroshi:

    This thread will be archived due to inactivity.

    Mke Clements
    RenesasRulz Moderator
  • Hi Hiroshi,

    Were you able to solve this problem? I'm facing the same problem right now.

    Vivek M
  • In reply to Viv:

    Hello, Hiroshi and Vivek.

    E0562310:Undefined external symbol "_PFDL_Open" referenced in ".\src\cg_src\r_pfdl.obj"

    The reason of  this error is that "Flash Data Library" (*.a file for GCC project) is not linked.
    Looks simple, but you need some more workarounds to link the library.

    1. Download FDL and install it
    2. Rename the archive name from pfdl.a to libpfdl.a
    3. Add a Linker option "User defined archive" as "pfdl", not pfdl.a, nor libpdfl.a .  --> this to be "-lpfdl" option
    4. Configure archive path (also in Linker option), i.e folder path of libpfdl.a  --> this to be -L<folder path>

    GNU Linker (ld.exe) assume library file name to be lib***. Not easy to link it without renaming it.

  • In reply to Viv:

    Hi vivek, I was unable to do it on e2studio, so i switched to cubesuite.
  • In reply to Okra:

    Hello Okra,
    Thanks, will try it.
  • In reply to Okra:

    Hi Okra/Hiroshi,

    Thanks, got it working. Just added the 'libpfdl.a' in additional input file of Linker Source.

    The 'linker_script.ld' needs to be modified to the MCU family used. '.data' section should be the starting address of RAM.

    .stack should be 0xFFE00 and PFDL_COD should be defined at 0x1000.



    Vivek M