Skip to main content
Visitor II
January 18, 2024
Solved

STM32H562 FLASH Prefetch and ICACHE

  • January 18, 2024
  • 4 replies
  • 2790 views

Hello,

I am currently evaluating the STM32H562 device. This devices has an ICACHE (instruction cache) module.
Does it make sense to enable both, the ICACHE module and the FLASH prefetch buffer?

 

In the past I already worked with the G0, G4 and F4 series.
If I create an STM32G474 CubeIDE project, I can enable the FLASH "Instruction cache" and the "Prefetch buffer" via the "RCC" module.
If I create an STM32H562 CubeIDE project, I can enable the "ICACHE" module but there is no "Prefetch buffer" setting in the "RCC" module anymore.

Is there a reason that the "prefetch buffer" enable option is not available for the H562 device in the CubeIDE?

What is the difference between the "FLASH Instruction cache" of the G4 and the "ICACHE" module of the H5?

Thank you,
Markus

    This topic has been closed for replies.
    Best answer by STOne-32

    Hi @Markus8494 ,

     

    You can refer to this architecture and system diagram to have more details on differences with Cortex-M33 core vs M4 on STM32 MCUs series . The question is excellent ! 

    IMG_6194.jpeg

    IMG_6193.jpeg


    Hope it helps you .

    Cheers,

    STOne-32

    4 replies

    Technical Moderator
    January 18, 2024

    Hello,

    Simply the "FLASH Instruction cache" or Prefetch buffer is dedicated to the Flash but Cache implies also to other memories either internal or external so it adds access performance to other memories.

    STOne-32Answer
    Technical Moderator
    January 18, 2024

    Hi @Markus8494 ,

     

    You can refer to this architecture and system diagram to have more details on differences with Cortex-M33 core vs M4 on STM32 MCUs series . The question is excellent ! 

    IMG_6194.jpeg

    IMG_6193.jpeg


    Hope it helps you .

    Cheers,

    STOne-32

    Graduate II
    January 19, 2024

    The FLASH I-cache on G4 is 1 KB, while the CPU I-cache on H5 is 8 KB and works also for SRAM and external memories. The FLASH prefetch is clearly explained in the RM0481 section 7.3.4. It's impact on performance is not so significant as from the I-cache, but it still improves the performance slightly and it makes sense to enable both. The fact that it's not present in CubeMX - well, it's your choice whether to believe the marketing nonsense about code generation and be dependent on some broken bloatware or to do an actual software development...

    Visitor II
    January 22, 2024

    Thank you all for your quick responses.

    @PiranhaI also usually prefer the more direct methods like the LL- or HAL library functions and/or direct register access. But I have to admit, that the CubeIDE has some features, that saved me some time in the past (for example, quickly getting the PLL factors for different clock/clock source configurations)