EVM5509 SROM (Serial ROM) Module
This module reads and writes to the Atmel AT25F512 SPI interface Flash chip on the EVM5509A. 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 EVM5509_SROM_erase() call before you attempt to program the device with EVM5509_SROM_write(). The BSL accounts for details such as the Flash 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 |
| EVM5509_SROM_BASE |
0x000000 |
Address of start of SROM |
| EVM5509_SROM_SIZE |
0x010000 |
Total size of SROM |
| EVM5509_SROM_PAGESIZE |
0x1000 |
Size of a normal SROM page |
| EVM5509_SROM_PAGES |
4 |
Number of SROM pages |
| EVM5509_SROM_BLOCKSIZE |
64 |
Size of a SROM block |
EVM5509_SROM_erase()
Description
Erase a block of the SROM
Required Headers
evm5509.h
evm5509_srom.h
Required Libraries
evm5509bsl.lib
Function Prototype
void EVM5509_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 Flash */
EVM5509_FLASH_erase(EVM5509_SROM_BASE, EVM5509_SROM_SIZE);
EVM5509_SROM_read()
Description
Read data from a range in SROM
Required Headers
evm5509.h
evm5509_srom.h
Required Libraries
evm5509bsl.lib
Function Prototype
void EVM5509_SROM_read(Uint32 src, Uint32 dst, Uint32 length)
Parameters
src - Address of SROM 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 */
EVM5509_SROM_read( EVM5509_SROM_BASE, ( Uint32 )buf, 256 );
EVM5509_SROM_write()
Description
Write data to a data range in SROM
Required Headers
evm5509.h
evm5509_srom.h
Required Libraries
evm5509bsl.lib
Function Prototype
void EVM5509_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 in SROM 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 */
EVM5509_SROM_write( ( Uint32 )buf, EVM5509_SROM_BASE, 256 );
|