Jump to main content

##

# 3.38.13 Random Access Memory (RAM)

The Random Access Memory (RAM) module provides an interface to perform write and read on the device's Internal SRAM or External DRAM memory locations

## Using The Library

The Internal SRAM or External DRAM memory locations can be read/written using the simple memcpy based Read and Write API's.

This PLIB is mainly used by Memory Driver when configured with File system for treating RAM as a media to store files.

The example code below demonstrates how to write and read from RAM location.

    uint8_t buffer[256];

    RAM_Write( (uint32_t *) buffer, 256, 0x20000000);

    RAM_Read( (uint32_t *) buffer, 256, 0x20000000);

## Library Interface

Random Access Memory peripheral library provides the following interfaces:

Functions

Name | Description
--- | ---
RAM_Read | Reads length number of bytes from a given address in RAM
RAM_Write | Write length number of bytes to a given address in RAM
RAM_IsBusy | Returns the current status of RAM
RAM_ECC_StatusGet | Returns the current ECC status for the RAM.
RAM_ECC_SingleBitFaultInject | Injects a single-bit fault at a specified RAM address.
RAM_ECC_InterruptHandler | Handles RAM ECC interrupts
RAM_ECC_Initialize | Enables ECC error detection interrupts for the RAM module.
RAM_ECC_FaultEnable | Enables fault injection for ECC in RAM.
RAM_ECC_FaultDisable | Disables fault injection for ECC in RAM.
RAM_ECC_FaultCaptureSyndromeGet | Returns the ECC fault syndrome value.
RAM_ECC_FaultCaptureParityGet | Returns the parity of the captured ECC fault.
RAM_ECC_FaultCaptureAddrGet | Returns the address of the captured ECC fault.
RAM_ECC_Enable | Enable the ECC functionality for the RAM.
RAM_ECC_DoubleBitFaultInject | Injects a double-bit fault at specified address.
RAM_ECC_Disable | Disable the ECC functionality for the RAM.
RAM_ECC_CallbackRegister | Enable the ECC functionality for the RAM.