HAL RAMCFG How to Use

group RAMCFG_How_To_Use

The RAMCFG main features:

ECC feature

  • SRAM2, SRAM3 and BKPRAM support ECC feature. This monitoring supports the single error detection and correction and double error detection.

  • Use the HAL_RAMCFG_ECC_Enable() to enable the RAMCFG ECC monitoring in silent mode.

i.e no interrupt will be triggered neither callback sent upon an ECC error. User must relay on HAL_RAMCFG_ECC_GetFailInfo() to monitor or/and check for ECC errors if any.

i.e When the application needs to get the ECC error flags and addresses status without servicing the associated interrupts, the RAMCFG single error and double error interrupts must be enabled through respectively LL_RAMCFG_EnableIT_SE() and LL_RAMCFG_EnableIT_DE() with the associated NVIC RAMCFG vector (RAMCFG_IRQn) disabled according to the 2.2.23 section within es0499 - rev9 errata-sheet.

  • Use the HAL_RAMCFG_ECC_Start_IT() to start ECC error monitoring process in interrupt mode and to activate the latching error address. The following interrupts will be enabled and user will receive a dedicated callback upon an ECC error :

    • Single error interrupt,

    • Double error interrupt,

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

  • Use the HAL_RAMCFG_ECC_Enable_IT() to enable ECC error monitoring process in interrupt mode and to activate the latching error address with the possibility to activate optional interrupts. The ECC double error interrupt is activated by default and here are the following optional interrupts can be enabled following user choice and user will receive a dedicated callback upon an ECC error:

    • Single error interrupt,

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

  • Use the HAL_RAMCFG_ECC_GetFailInfo() to get the type of failure and the address of the last fail RAM word detected. the type can be :

    • no ECC error detected,

    • Single error,

    • Double error.

i.e in silent mode, user must ensure that he RAMCFG single error and double error interrupts must be enabled through respectively LL_RAMCFG_EnableIT_SE() and LL_RAMCFG_EnableIT_DE() with the associated NVIC RAMCFG vector (RAMCFG_IRQn) disabled according to the 2.2.23 section within es0499 - rev9 errata-sheet.

Wait State feature

Write protection feature

  • This feature is supported only by SRAM2, it’s divided to 64 pages with 1 KB granularity. Each page can be write protected independently.

  • Use the HAL_RAMCFG_EnablePageWRP() to set the write protection for the given SRAM page(s).

  • Use the HAL_RAMCFG_EnableWRPByAddr() to set the write protection for the given SRAM by address.

  • Use the HAL_RAMCFG_IsEnabledPageWRP() to check the write protection status of a page of the SRAM.

  • Use the HAL_RAMCFG_IsEnabledWRPByAddr() to check the write protection status of a page of the SRAM by address.

  • There is no API to disable write protection as this feature can be disabled only by a global peripheral reset or system reset.

  • Any write access to a write protected area of SRAM2 causes a HardFault interrupt.

Erase feature

  • Each SRAM can be erased independently through its RAMCFG instance.

  • After a complete hardware erase, the given SRAM is set to 0 value.

  • Use the HAL_RAMCFG_MassErase() to launch a hardware erase for the given SRAM.