HAL XSPI Overview

Introducing XSPI

group XSPI_Introduction

  • The XSPI hardware abstraction layer provides a set of APIs to interface with the STM32 XSPI (Extended Serial Peripheral Interface) peripheral.

  • It simplifies the configuration, initialization, and management of XSPI communication. Memory configuration and data transfer can be performed in different modes:

    • Indirect access mode: polling, interrupt, DMA for configuration and data transfer.

    • Direct access mode: memory mapped for data transfer only.

  • This abstraction layer ensures portability and ease of use across different STM32 series.

Module and files

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

Module and files diagram

Component diagram

The following diagram illustrates the software components involved in the XSPI 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 XSPI Software Component Diagram

package "HAL" {
    [HAL_SERVICE]
    [HAL_XSPI]
    [HAL_DMA]
}

package "Low Layer" {
    [LL_DLYB]
    [CMSIS]
    [XSPI Interrupt routine service]
    [DMA Interrupt routine service]
}

package "HW" {
    [STM32_HW]
}

[Appli] --> [HAL_XSPI] : HAL XSPI API
[Appli] <-- [HAL_XSPI] : XSPI callback
[HAL_XSPI] --> [LL_DLYB] : LL DLYB API
[HAL_XSPI] -r-> [HAL_DMA] : HAL DMA_Start_IT\nHAL_DMA_Abort_IT
[HAL_XSPI] -l-> [HAL_SERVICE] : HAL_GetTick
[HAL_XSPI] <-- [XSPI Interrupt routine service]
[HAL_XSPI] <-r- [HAL_DMA]:Half transfer complete\nTransfer complete\nError
[HAL_XSPI] --> [CMSIS]:XSPI register def
[HAL_DMA] <-d- [DMA Interrupt routine service]
[STM32_HW] -u--> [XSPI Interrupt routine service]: XSPIx Irq
[STM32_HW] -u--> [DMA Interrupt routine service] : DMA Channel Irq
[STM32_HW] <-u--> [HAL_XSPI] : XSPI registers R/W
@enduml

Configuration table

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

group XSPI_Configuration_Table

Configuration inside the XSPI driver

Config defines

Description

Default value

Note

PRODUCT

from IDE

NA

The selected device (Ex: STM32C5XX)

USE_HAL_XSPI_MODULE

from hal_conf.h

1U

Allows use of the HAL XSPI module

USE_ASSERT_DBG_PARAM

from IDE

NA

Allows use of the assert check parameters

USE_ASSERT_DBG_STATE

from IDE

NA

Allows use of the assert check states

USE_HAL_CHECK_PARAM

from hal_conf.h

0U

Allows use of the run-time check parameters

USE_HAL_CHECK_PROCESS_STATE

from hal_conf.h

0U

Allows load and store exclusive operations

USE_HAL_XSPI_DMA

from hal_conf.h

1U

Allows use of DMA mode

USE_HAL_XSPI_HYPERBUS

from hal_conf.h

1U

Allows use of the HYPERBUS protocol

USE_HAL_XSPI_REGISTER_CALLBACKS

from hal_conf.h

0U

Allows use of register callbacks

USE_HAL_XSPI_CLK_ENABLE_MODEL

from hal_conf.h

HAL_CLK_ENABLE_NO

Allows use of the clock enable model