Problems using xilfatfs on XUP V2Pro board

Hi there,

I've been using the Xilinx University Program Virtex-II Pro development board and I'm having great trouble writing code to interface to the SystemACE compactflash system.

I expect my program (attached below) to open one file, read two bytes, and close it; then open another file for writing, write two bytes to it, and close that.

However, the output shows that main() is starting again, despite there being no looping or recursive calls to induce this. (Some experimentation showed that moving the location of the sysace_fclose() calls changed the point at which main() restarted.)

The problem disappears if I change both file accesses to read mode "r" (and the corresponding sysace_fwrite() calls to sysace_fread()).

Is it simply not possible to read and write from different files within the same program?

The xilfatfs settings in the system.mss file are the following;

BEGIN LIBRARY PARAMETER LIBRARY_NAME = xilfatfs PARAMETER LIBRARY_VER = 1.00.a PARAMETER PROC_INSTANCE = microblaze_0 PARAMETER CONFIG_WRITE = true END

---8

Reply to
Philip Potter
Loading thread data ...

Should be possible. You might want to increase your stack size and make sure you are don't have a stack overflow condition.

Reply to
Siva Velusamy

Yes, you're right - I increased stack size to 0x1000 and the problem stopped.

What techniques are there for detecting and dealing with stack overflows?

Phil

Reply to
Philip Potter

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.