HAL ICACHE Overview

Introducing ICACHE

group ICACHE_Introduction

The Instruction Cache (ICACHE) hardware abstraction layer provides a set of APIs to interface with the instruction cache peripheral on STM32 microcontrollers. It improves performance by reducing wait states when fetching instructions and data from internal and external memories.

It simplifies the configuration, initialization, and management of the ICACHE by supporting features such as cache associativity modes, memory address remapping, performance monitoring, and error detection with interrupt capabilities.

This abstraction layer guarantees portability and ease of use across different STM32 series. The HAL ICACHE driver covers the instruction cache peripheral with support for multiple cache configurations and maintenance operations.

Module and files

The following diagram illustrates the ICACHE module and its associated files.

Module and files diagram

Component diagram

The following diagram illustrates the software components involved in the ICACHE module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.


@startuml
<style>
componentDiagram {
   arrow {
      FontSize 8
   }
}
</style>

title ICACHE Software Component Diagram

package "HAL" {
    [HAL_SERVICE]
    [HAL_ICACHE]
}

package "Low Layer" {
    [LL_ICACHE]
    [CMSIS]
    [ICACHE Interrupt Service Routine]
}

package "HW" {
    [STM32_HW]
}

[Appli] --> [HAL_ICACHE] : HAL ICACHE APIs
[Appli] <-- [HAL_ICACHE] : HAL ICACHE callbacks
[HAL_ICACHE] --> [LL_ICACHE] : LL ICACHE APIs
[HAL_ICACHE] -l-> [HAL_SERVICE] : HAL_GetTick
[HAL_ICACHE] <-- [ICACHE Interrupt Service Routine]
[LL_ICACHE] --> [CMSIS]:ICACHE registers definition
[STM32_HW] -u--> [ICACHE Interrupt Service Routine]: ICACHEx IRQ
[STM32_HW] <-u-- [LL_ICACHE] : ICACHE registers R/W
@enduml

Configuration table

The following table lists the configuration defines for the HAL ICACHE module, specifying their locations, default values, and descriptions:

group ICACHE_Configuration_Table

Configuration inside the ICACHE driver :

Config defines

Description

Default value

Note

USE_HAL_ICACHE_MODULE

From hal_conf.h

1

Allows the use of the HAL ICACHE module.

USE_HAL_ICACHE_REGISTER_CALLBACKS

From hal_conf.h

0

Allows the use of the register callbacks.

USE_HAL_CHECK_PARAM

From hal_conf.h

0

Allows the use of run-time check parameters.

USE_ASSERT_DBG_PARAM

From IDE

NA

Allows the use of assert check parameters.

USE_ASSERT_DBG_STATE

From IDE

NA

Allows the use of assert check states.

USE_HAL_ICACHE_GET_LAST_ERRORS

From hal_conf.h

1

Allows the use of the error code mechanism.

USE_HAL_ICACHE_USER_DATA

From hal_conf.h

0

Allows the use of user data.