To use the code found via the search, you must understand its file structure.

X-CUBE-EEPROM is an STM32Cube expansion software package that provides a complete middleware to manage external EEPROM memories. It sits on top of the STM32Cube HAL (Hardware Abstraction Layer) and supports a wide range of standard EEPROM devices from various vendors (Microchip, Onsemi, ROHM, etc.), provided they use I2C or SPI interfaces.

Spreads write operations across the allocated Flash pages to significantly increase the endurance of the memory.