Xilinx microblaze : SRAM external mem controller

Hello, I am working with xilinx microblaze and I am trying to set up my microblaze to communicate with a 128 KB asynchronous SRAM chip (IS63LV1024). So far I have been able to set up the opb_emc (External Memory Controller) to communicate with the SRAM chip. However, I can only write to the SRAM in 4 bytes words. I cannot write byte by byte. Example: If I try to write to byte 0x0F10_0001, the whole word at 0x0F10_0000 gets updated instead. ================================== Before

0x0F10_0000: 00000000 0x0F10_0004: 00000000 Write 0x31 to 0x0F10_0001 After 0x0F10_0000: 00000031 0x0F10_0004: 00000000 ================================== Now, I am trying to load my program to run in the external memory by setting the program start address in the compiler options. I cannot get the program to run in external memory and it keeps crashing. Is that related to the fact that I cannot write byte by byte in the external memory, or are there some additional settings I need to do in the linker and compiler in order to get my program to run in external memory. I am using Xilinx Platform Studio (XPS) to configure my system. Are there any special parameters that I need to set in the opb_emc to enable byte by byte access ? I could not find any such parameters. Thanks Richard
Reply to
Richard
Loading thread data ...

Hi Richard,

microblaze to communicate with a 128 KB asynchronous SRAM chip (IS63LV1024).

communicate with the SRAM chip. However, I can only write to the

updated instead.

There are two possiblilites

Software:

--------- So how do you write to memory? In C you should be aware to declare your pointer according to the data width you want to write.

int *my_memory_pointer = 0x0f100001;

*my_memory_pointer = 0x31; will set the whole word.

char *my_memory_pointer = 0x0f100001;

*my_memory_pointer = 0x31; will write only one byte

Hardware:

---------- How is your memory connected? Are you shure your byte - enable signals an not tied together?

--- In order to check whether your hardware or your software is the reason for your problem try writing to memory using xmd. Do not start any software on your microblaze. Start xmd. Connect to the microblaze. Use the mwr command. Example:

c:> xmd -> this starts xmd xmd> mbconnect (stub/mdm) -> connects you to your microblaze, in case you do not now -> how this works check the mb docmentation xmd> mrd 0x0f100000 -> read address 0x0f100000 (the whole word) [...] -> there should be the content of your memory xmd> mwr 0x0f100001 0x31 b -> writes _b_ytewise to memrory xmd> mrd 0x0f100000 -> read address 0x0f100000 [...] -> did it succeed? when not, your hw might be wrong -> otherwise you have to change your programm

Erik

Reply to
Erik Hansen

WRONG, if you look at XMD stub you see the stub only support

32 bit read write to memory, so if you do byte read/write then stub still reads/writes 32 and XMD emulates byte wide access!

antti

Reply to
Antti Lukats
090702020000010806050304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit

True,

You have to use the HW debug logic in MicroBlaze and the opb_mdm.

This will give you true byte-write and a lot of other things.

Göran

Antti Lukats wrote:

Reply to
Goran Bilski

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.