2.88 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

NameDescription
RAM_ReadReads length number of bytes from a given address in RAM
RAM_WriteWrite length number of bytes to a given address in RAM
RAM_IsBusyReturns the current status of RAM
RAM_ECC_StatusGetReturns the current ECC status for the RAM.
RAM_ECC_SingleBitFaultInject

Injects a single-bit fault at a specified RAM address.

RAM_ECC_InterruptHandlerHandles RAM ECC interrupts
RAM_ECC_InitializeEnables ECC error detection interrupts for the RAM module.
RAM_ECC_FaultEnableEnables fault injection for ECC in RAM.
RAM_ECC_FaultDisableDisables fault injection for ECC in RAM.
RAM_ECC_FaultCaptureSyndromeGetReturns the ECC fault syndrome value.
RAM_ECC_FaultCaptureParityGetReturns the parity of the captured ECC fault.
RAM_ECC_FaultCaptureAddrGetReturns the address of the captured ECC fault.
RAM_ECC_EnableEnable the ECC functionality for the RAM.
RAM_ECC_DoubleBitFaultInjectInjects a double-bit fault at specified address.
RAM_ECC_DisableDisable the ECC functionality for the RAM.
RAM_ECC_CallbackRegisterEnable the ECC functionality for the RAM.
Note: Not all APIs maybe implemented. See the specific device family section for available APIs.