Serial Flash Mailbox Client Intel® FPGA IP User Guide

ID 683509
Date 9/26/2022
Public

Reading the Flash Memory Device Status Register

Here are the steps to read the flash memory device status register.
# Set base address according to Platform Designer system
set CSR 0x00000000
set WR_MEM 0x00000240
set RD_MEM 0x00000248
# Set the variables to their respective offset
set AsmiCmdStatus  		[expr $CSR + [expr 0x0  << 2]]
set AsmiIsr  	  			[expr $CSR + [expr 0x1  << 2]]
set AsmiIer 	  			[expr $CSR + [expr 0x2  << 2]]
set AsmiChipSelect 			[expr $CSR + [expr 0x3  << 2]]
set AsmiOpen 	  		[expr $CSR + [expr 0x4  << 2]]
set AsmiClose 	  		[expr $CSR + [expr 0x5  << 2]]
set AsmiWrEnable   			[expr $CSR + [expr 0x6  << 2]]
set AsmiWrStatus   			[expr $CSR + [expr 0x7  << 2]]
set AsmiRdStatus  			[expr $CSR + [expr 0x8  << 2]]
set AsmiSectorErase		[expr $CSR + [expr 0x9  << 2]]
set AsmiDeviceId  			[expr $CSR + [expr 0xa  << 2]]
set AsmiControl  			[expr $CSR + [expr 0xd  << 2]]
set AsmiNumbByte  		[expr $CSR + [expr 0xe  << 2]]
set AsmiWriteData0 		[expr $CSR + [expr 0xf  << 2]]
set AsmiWriteData1 		[expr $CSR + [expr 0x10  << 2]]
set AsmiReadData0  		[expr $CSR + [expr 0x11  << 2]]
set AsmiReadData1  		[expr $CSR + [expr 0x12  << 2]]
set AsmiWriteOp  			[expr $CSR + [expr 0x14  << 2]]
set AsmiWriteAddr  			[expr $CSR + [expr 0x15  << 2]]
set AsmiWriteFifoLevel		[expr $CSR + [expr 0x16  << 2]]
set AsmiReadOp  			[expr $CSR + [expr 0x17  << 2]]
set AsmiReadAddr  			[expr $CSR + [expr 0x18  << 2]]
set AsmiReadNumbWords		[expr $CSR + [expr 0x19  << 2]]
set AsmiReadFifoLevel		[expr $CSR + [expr 0x1A  << 2]]

# Assign variable "m" to the string that is the 0th element in the list returned by get_service_paths master
set m [ lindex [ get_service_paths master ] 0 ]

# Open the connection to the master module
open_service master $m
# Assign variable "m" to the string that is the 0th element in the list returned by get_service_paths master
set m [ lindex [ get_service_paths master ] 0 ]

# Open the connection to the master module
open_service master $m


# Write Offset 4 to request access to the flash memory device.
master_write_32 $m $AsmiOpen 0x1

# Write Offset 3 to select the 1st flash memory device attached to the IP.
master_write_32 $m $AsmiChipSelect 0x0

# Read Offset 8 for status register of the device.
master_read_32 $m $AsmiRdStatus 1

# Write Offset 5 to close access to the flash memory device.
master_write_32 $m $AsmiClose 0x1

Did you find the information on this page useful?

Characters remaining:

Feedback Message