Skip to main content
FKaes.1
Associate III
April 8, 2025
Solved

HAL: Porting from L4 to U5: flash and flush (caches)

  • April 8, 2025
  • 2 replies
  • 1196 views

Hello, I'm porting code from L4 to U5. The original code was able to change flash during runtime (erase and program). The L4 Hal lib deactivated caches before flash operation and flushes them afterwards. This isn't done by the U5 Hal lib. I don't need explanation. It is ok for me, if you can confirm, that there is not risk, when cache is enabled during the programming U5.

FKaes1_0-1744119836473.png

 

This topic has been closed for replies.
Best answer by Saket_Om

Hello @FKaes.1 

The deactivation and flash of the cache in the STM32G4 when performing flash operation is due to the implementation of the workaround for the errata 2.2.13.

Saket_Om_0-1744128801176.png

This is not the case for STM32U5. 

2 replies

Saket_OmBest answer
ST Technical Moderator
April 8, 2025

Hello @FKaes.1 

The deactivation and flash of the cache in the STM32G4 when performing flash operation is due to the implementation of the workaround for the errata 2.2.13.

Saket_Om_0-1744128801176.png

This is not the case for STM32U5. 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
FKaes.1
FKaes.1Author
Associate III
April 9, 2025

Hello, Thanks. I assume the G4 workaround relates also to the L4. Additional, I'm using a U5 with 1MB (=> 1 Bank). Then this issue should not happen anyway.