HAL RAMECC How to Use

group RAMECC_How_To_Use

This module provides a set of APIs to manage each feature supported by the internal SRAMs:

  1. ECC feature

    • This feature is supported by all SRAMs. ECC monitoring supports the single error detection and correction and double error detection.

    • Each SRAM is associated with a RAMECC monitor, which are grouped together in two separate RAMECC controllers.

    • Interrupts can be enabled either at controller level, i.e. for all monitors of the controller, or at monitor level.

    • Use the HAL_RAMECC_EnableController() or HAL_RAMECC_EnableMonitor() functions to enable the ECC monitoring process in silent mode, i.e. no interrupt will be triggered, nor will a callback be sent upon ECC error. User must rely on HAL_RAMECC_GetInfo() function to monitor or/and check for ECC errors if any.

    • Use the HAL_RAMECC_EnableController_IT() or HAL_RAMECC_EnableMonitor_IT() functions to start ECC error monitoring process in interrupt mode. This will activate the latching error address and the following interrupts will be enabled:

      • Single error interrupt,

      • Double error interrupt,

      • Double error interrupt redirected to Non-Maskable Interrupt(NMI).

      If an interrupt occurs on the RAMECC line, user can call the HAL_RAMECC_IRQHandler() function to manage the interrupt for a given instance and receive a dedicated callback to manage the ECC error.

    • Use the HAL_RAMECC_GetInfo() function to get the type, status and address of the last ECC error detected. The type can be :

      • No ECC error detected,

      • Single error,

      • Double error.

      • Double Error on Byte Write.

      The status can be :

      • ECC error not corrected,

      • ECC error corrected.

    • Use the HAL_RAMECC_CleanInfo() function to clear all ECC flags for the given monitor so that new ECC errors can be caught.

    • Use the HAL_RAMECC_DisableController() or HAL_RAMECC_DisableMonitor() functions to disable the ECC monitoring.

  2. SRAM information getter