HAL RAMCFG Functions

ECC operation functions

group RAMCFG_Exported_Functions_Group1

This section provides functions allowing to manage ECC feature provided by the RAMCFG peripheral.

Functions

hal_status_t HAL_RAMCFG_ECC_Enable ( hal_ramcfg_t instance )

Enable ECC monitoring and latching the error address for the given RAMCFG instance.

Warning

The 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.

Parameters :

instance – RAMCFG instance.

Return values :

HAL_OK.

hal_status_t HAL_RAMCFG_ECC_Enable_IT ( hal_ramcfg_t instance , hal_ramcfg_it_t interrupt )

Enable the RAMCFG given ECC interrupts and enable associated monitoring and latching the error address for the given RAMCFG instance.

Parameters :
  • instance – RAMCFG instance.

  • interrupt – ECC interrupt to enable.

Return values :

HAL_OK.

hal_status_t HAL_RAMCFG_ECC_Disable ( hal_ramcfg_t instance )

Disable ECC monitoring for the given RAMCFG instance.

Parameters :

instance – RAMCFG instance.

Return values :

HAL_OK.

void HAL_RAMCFG_ECC_GetFailInfo ( const hal_ramcfg_t instance , hal_ramcfg_ecc_fail_info_t * p_info )

Get the ECC fail information.

Warning

The 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.

Parameters :

Configure wait state functions

group RAMCFG_Exported_Functions_Group2

This section provides functions allowing to configure and retrieve the wait state value.

Functions

hal_status_t HAL_RAMCFG_SetWaitState ( hal_ramcfg_t instance , hal_ramcfg_wait_state_t wait_state )

Configure the wait state value for the given SRAM.

Parameters :
  • instance – RAMCFG instance.

  • wait_state – Specifies the RAMCFG wait state to be configured. This parameter can be one of hal_ramcfg_wait_state_t Wait state value.

Return values :

HAL_OK.

hal_ramcfg_wait_state_t HAL_RAMCFG_GetWaitState ( hal_ramcfg_t instance )

Get the current wait state value for the given SRAM.

Parameters :

instance – RAMCFG instance.

Returns :

hal_ramcfg_wait_state_t Wait state value.

Write protection functions

group RAMCFG_Exported_Functions_Group3

This section provides functions to enable write protection feature for the page(s) of the given SRAM. Disabling the SRAM page(s) protection is only possible by a global peripheral reset or by a system reset.

Functions

hal_status_t HAL_RAMCFG_EnablePageWRP ( hal_ramcfg_t instance , uint32_t start_page , uint32_t page_nbr )

Enable write protection for the given page(s).

Parameters :
  • instance – RAMCFG instance.

  • start_page – Select the start page number.

  • page_nbr – Number of pages to be protected.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter when the number of pages to protect is higher than the number of pages available for the given SRAM.

  • HAL_OK – RAMCFG pages are successfully protected.

hal_status_t HAL_RAMCFG_EnableWRPByAddr ( hal_ramcfg_t instance , uint32_t sram_addr , uint32_t size_byte )

Enable write protection for the given SRAM address range.

Warning

Physically the SRAM protection granularity is a page. When the sram_addr doesn’t correspond to a start of page or and the size_byte doesn’t cover a integer number of page then the driver will round to the first page and the last page to cover the given area defined by sram_addr and size_byte

Parameters :
  • instance – RAMCFG instance.

  • sram_addr – Offset from the SRAM base address.

  • size_byte – size of pages to be protected.

Return values :
  • HAL_INVALID_PARAM – Invalid parameter when sram_addr not in the range of the given SRAM and the total size to be protected more than the given SRAM size.

  • HAL_OK – RAMCFG pages are successfully protected by address.

hal_ramcfg_wrp_page_status_t HAL_RAMCFG_IsEnabledPageWRP ( hal_ramcfg_t instance , uint32_t page )

Check the write protection status for the given page.

ref hal_ramcfg_wrp_page_status_t RAMCFG page write protection status.

Parameters :
  • instance – RAMCFG instance.

  • page – Select the page index.

Retval :

hal_ramcfg_wrp_page_status_t HAL_RAMCFG_IsEnabledWRPByAddr ( hal_ramcfg_t instance , uint32_t sram_addr )

Check the write protection status for the given SRAM by address.

ref hal_ramcfg_wrp_page_status_t RAMCFG page write protection status.

Warning

Physically the SRAM protection granularity is a page. When the sram_addr doesn’t correspond to a start of page, then the driver will check the status for the page containing the given sram_addr.

Parameters :
  • instance – RAMCFG instance.

  • sram_addr – Offset from the SRAM base address.

Retval :

Erase operation functions

group RAMCFG_Exported_Functions_Group4

This section provides a function allowing a hardware erase the given SRAM.

  • Call the function HAL_RAMCFG_MassErase() to allow a hardware mass erase of the given SRAM. Once erased, the given SRAM content is zero.

Functions

hal_status_t HAL_RAMCFG_MassErase ( hal_ramcfg_t instance , uint32_t timeout )

Launch a Mass Erase for the given SRAM.

Parameters :
  • instance – RAMCFG instance.

  • timeout

Return values :
  • HAL_ERROR – when a hardware erase operation is not finished.

  • HAL_OK – SRAM is successfully erased.

Handle interrupt and callbacks functions

group RAMCFG_Exported_Functions_Group5

This section provides functions to handle RAMCFG interrupts and register different callbacks.

Functions

void HAL_RAMCFG_IRQHandler ( hal_ramcfg_t instance )

Handle RAMCFG interrupt request.

Parameters :

instance – RAMCFG instance.

hal_status_t HAL_RAMCFG_NMI_IRQHandler ( hal_ramcfg_t instance )

Handle RAMCFG NMI interrupt request.

Parameters :

instance – RAMCFG instance.

Return values :
  • HAL_OK – when the NMI has been specifically treated by this IRQHandler.

  • HAL_ERROR – otherwise

hal_status_t HAL_RAMCFG_ECC_ErrorCallback ( hal_ramcfg_t instance )

RAMCFG single or double error detection callback.

Parameters :

instance – RAMCFG instance.

Return values :

HAL_ERROR – when the NMI has not been treated by the callback.