Skip to main content
Visitor II
April 30, 2024
Solved

STM32 EEPROM Emulation SPL Library V3.1 Implementation

  • April 30, 2024
  • 2 replies
  • 6424 views

Hey all,

I'm attempting to implement the EEPROM emulation library into a pre-existing project with little success. I've added the eeprom.c file to the project as well as the header include to the main.c but even prior to implementing the code, attempting to compile/build throws an error that the "FLASH_Status" identifier is undefined. This variable is found inside the stm32f10x_flash header. I've added it from the StdPeriph file into the project but the compiler can't seem to locate it. 

This process if fairly new to be so I presume I'm missing some simple step to implement the library, any assistance would be appreciated. 

processor is an STM32F103
programming in IAR Embedded Workbench

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    Searching in my archive I found the attached SPL library v3.1.0

    FLASH_status is defined as enumeration in stm32f10x_flash.h:

     

    typedef enum
    { 
     FLASH_BUSY = 1,
     FLASH_ERROR_PG,
     FLASH_ERROR_WRP,
     FLASH_COMPLETE,
     FLASH_TIMEOUT
    }FLASH_Status;

     

     platform_config.h is part of the user application needs to be under Project\XXX\inc.

    See for example this FW for Smartcard interface.

    2 replies

    Graduate II
    April 30, 2024

    Which version, from whence?

    Mixing SPL and HAL is probably not advisable.

    The compiler would need to know the include paths, and you'd need to include the file directly, or via the #include trees and USE_STDPERIPH define.

    If you're using HAL for the project, use the HAL version of the EEPROM Emulation

    Visitor II
    April 30, 2024

    Version 3.1.0 from here

    I'm not well read on the differences between SPL and HAL but the version has an example file that can be opened and built in the flavor of IAR my project is running on. So both the example project and my project work on their own with this compiler and IDE but I'm not able to integrate them. The undefined error is especially odd to me since it's an STM defined enum, I just don't understand how to get the workspace to look in the specific file. 

    Graduate II
    May 1, 2024

    STM32F1 SPL / Standard Peripheral Library v3.6.0

    https://www.st.com/en/embedded-software/stsw-stm32054.html

    You can perhaps look at what other files are in your project and if they shed some light on the library versions.

    I was using Keil (perhaps uVision 3 or 4) to build SPL code, earlier, contemporary, versions of the IAR or KEIL tools would be better suited to building these things, IAR 7 and 8 likely changed enough things it wouldn't load/compile without issues. Could likely make a build with straight GNU/GCC tools, not sure of expectations CubeIDE would add, as not contemporary, and about zero interest there to maintain backward compatibility, or for legacy tools / code.

    Technical Moderator
    April 30, 2024

    Hello,

    Question: are you using the standard library which is a too old and depricated library (no more supported)?

    This is an example based on the HAL implementation from STM32CubeF1 in github:

    https://github.com/STMicroelectronics/STM32CubeF1/tree/master/Projects/STM32F103RB-Nucleo/Applications/EEPROM/EEPROM_Emulation

    Visitor II
    April 30, 2024

    I am using the library from 2009 that is called out in the appnote for this specific processor. The code I am attempting to adapt it into is nearly as old, 2010, and hasn't been upgraded for newer generation IDEs. I don't know if the version I downloaded is a HAL implementation but I will review this citation for any additional details or simply attempt to implement the library in the same process. Thank you

    Technical Moderator
    April 30, 2024