Site Index
   Home
   File Upload
Google

Transfer Site
Main Site

EVM5502 SROM (Serial ROM) Module

This module reads and writes to the Atmel AT25F512 SPI interface Flash chip on the EVM5502. This type of device is generally known as a serial ROM. McBSP0 is used for communication with the SROM. Since the SROM is accessed through an independent serial interface, it is not mapped into the EMIF’s address space. Therefore, addresses are logical offsets from the beginning of the device.

The SROM is a Flash based device which means that it must be erased in bulk before it can be programmed. You must call the EVM5502_SROM_erase() call before you attempt to program the device with EVM5502_SROM_write(). The BSL accounts for details such as the SROM page size and maximum number of bytes that can be programmed in a single operation so you can effectively ignore them and treat the device as a generic linear memory.

Name Typical Value Description
EVM5502_SROM_BASE 0x000000 Address of start of SROM
EVM5502_SROM_SIZE 0x10000 Total size of SROM
EVM5502_SROM_PAGESIZE 0x8000 Size of a normal SROM page
EVM5502_SROM_PAGES 2 Number of EVM5502_SROM_PAGESIZE pages
EVM5502_SROM_BLOCKSIZE 256 Size of a normal SROM block

Function Description
EVM5502_SROM_erase Erase a range of SROM memory
EVM5502_SROM_read Read data from a range in SROM
EVM5502_SROM_write Write data to a range in SROM

EVM5502_SROM_erase()

Description
Erase a block of the SROM

Required Headers
evm5502.h
evm5502_srom.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_SROM_erase(Uint32 start, Uint32 length)

Parameters
start - Beginning of region to erase. Given as an integral number of 8-bit bytes.
length - Length of region to erase. Given as an integral number of 8-bit bytes.

Return Value
None

Example

    /* Erase the entire SROM */
    EVM5502_SROM_erase(EVM5502_SROM_BASE, EVM5502_SROM_SIZE);

EVM5502_SROM_read()

Description
Read data from a range in SROM

Required Headers
evm5502.h
evm5502_srom.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_SROM_read(Uint32 src, Uint32 dst, Uint32 length)

Parameters
src - Address of EEPROM to read from. Given as an integral number of 8-bit bytes.
dst - Address to memory to read to. Given as an integral number of 16-bit words. Source is assumed to have 8-bits of valid data stored in the low byte of each 16-bit word.
length - Length of transfer, in 8-bit bytes.

Return Value
None

Example

    Uint16 buf[256];

    /* Copy 256 16-bit words from 
     * the beginning of the SROM to buf */
    EVM5502_SROM_read(EVM5502_SROM_BASE, (Uint32)buf, 256);

EVM5502_SROM_write()

Description
Write data to a data range in SROM

Required Headers
evm5502.h
evm5502_srom.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_SROM_write(Uint32 src, Uint32 dst, Uint32 length)

Parameters
src – Address of memory to read from. Given as an integral number of 16-bit words. Source is assumed to have 8-bits of valid data stored in the low byte of each 16-bit word.
dst - Address to EEPROM to write to. Given as an integral number of 8-bit bytes.
length – Length of region to write to. Given as an integral number of 8-bit bytes.

Return Value
None

Example

    Uint16 buf[256];

    /* Copy 256 16-bit words from 
     * buf to the beginning of SROM */
    EVM5502_SROM_write((Uint32)buf, EVM5502_SROM_BASE, 256);
©Copyright 2002-2011 Spectrum Digital, Inc. All Rights Reserved.