Microblaze: reading files using sysace compactflash

Hi,

I'm trying to read files (i.e. JPEG file) from the compactflash card on the vertex II multimedia board. I know I have to use the sysace controller and its library. I use the following code to conplie:

#include "xparameters.h" #include "xutil.h" #include "sysace_stdio.h"

char *Filename = "winter.jpg"; int main (void) {

FILE *fp; DWORD X_image, Y_image; BYTE *our_image_buffer; printf("starting....\r\n"); if ((fp = fopen(Filename, "r")) == NULL) { printf("\r\nCan't open file: %s \r\n", Filename); return 0; } return 0;

}

Here is my MHS for the sysace driver:

BEGIN opb_sysace PARAMETER INSTANCE = system_ace_compactflash PARAMETER HW_VER = 1.00.b PARAMETER C_BASEADDR = 0x81000000 PARAMETER C_HIGHADDR = 0x81FFFFFF BUS_INTERFACE SOPB = mb_opb PORT OPB_Clk = sys_clk_s PORT SysACE_MPA = MPA PORT SysACE_CLK = sysace_clk PORT SysACE_MPD = MPD END

I can complie the above code but the program freezes when I download bitstream to the borad and run it through XMD debugger. Would you please take a look at my code to see if it's correct? I have no experience using the sysace driver to read files. Also, let me know the right configuration for the port connection of sysace core and the right way using C to read file.

Thanks a lot. Yongjie

Reply to
Yongjie Li
Loading thread data ...

[snip]

connecting MPA and MPD is not enough, you have no connection to WEN and CEN as example, so its natural that everything freezes!!

try some known good SYSACE example program first to verify that sysace works, AFTER that is OK move on trying out fat file system on sysace.

Antti

Reply to
Antti Lukats

Hi Antti,

Thanks for your help! Do you have examples for sysace? I find everywhere on xilinx website but got nothing useful. If you know the place I could find it, please let me knwo. Also, I will try to connect WEN and CEN.

Best, Y> > Hi,

--
Mega
Reply to
Yongjie Liu

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.