Hello,
Assuming you have no control over the master firmware, and a high SPI clock rate is generated by the master, it may not be feasible to "emulate" EEPROM with the MCU. The "EEPROM read" will be most problematic. I am assuming that the ST EEPROM operates similarly to other SPI serial EEPROMs.
Firstly, the slave firmware will probably need to use interrupts.
For a "read" command, the command byte would first be received by the slave, followed two address bytes. The MCU is then expected to return at least one byte to the master. However, the potential problem is that the slave MCU needs to read the final address byte, determine the return data associated with that address, and write the byte value to the SPI data register, all in less than one half SPI clock period. This is probably not feasible unless the SPI clock frequency is very low.
If this timing is not met, the first byte returned would contain "garbage", but the next byte returned would contain the written value.
My understanding is that SPI EEPROMs are usually compatible with SPI modes 0,0 or 1,1. I note that you have a setting of CPOL = 0 and CPHA = 1. You will need to retain CPHA = 1, since the /SS signal from the master will remain low for at least four byte periods (not compatible with CPHA = 0), so you may need to set CPOL = 1.
Regards,
Mac