From: morphiend on
On Oct 9, 6:45 am, lomtiks...(a)gmail.com wrote:
> On Oct 6, 5:40 am, jason.hy...(a)gmail.com wrote:
>
>
>
> > On Oct 6, 4:21 pm, lomtiks...(a)gmail.com wrote:
>
> > > Hi everyone,
>
> > > I would like to read a file from a CF card on xupv2p board using PLB
> > > and Microblaze 7.10d. There are a few questions that I am trying to
> > > answer.
>
> > > There is an xps_sysace interface controller v1.00a which seats between
> > > the PLB and the system ace CF peripheral and has sysace v1_11_a driver
> > > with functions like XSysAce_SectorRead and XSysAce_SectorWrite.
> > > However, I have not found any file system management soft like
> > > sysace_fopen and sysace_fread provided with XilFatfs FATFile System
> > > access library (xilfatfs_v1_00_a) that, from its doc, requires OPB
> > > SYSACE Interface Controller - Logicore module. How else would you read
> > > files from the a CF via PLB?
> > > Would it require modifying xilfatfs to support PLB?
>
> > > Probably I could reuse the xilfatfs_v1_00_a if I use the older MB 6
> > > with OPB bus and opb_sysace or OPB2PLB bridge and xps_sysace.
>
> > I am using MB 7.10a + plb + xps_sysace 1.00a with xilfatfs 1.00.a. I
> > also use
> > sysace_fopen, sysace_fread, sysace_fwrite for my sysace operations. So
> > I don't
> > think you need to redesign your system again.XSysAce_SectorRead and
> > XSysAce_SectorWrite are the raw operations as I remember.
>
> Thanks Goran, Jason. It was great to hear the confirmation that
> xilfatfs worked for you with with the xps_sysace 1.00a. I came back to
> the original setup with PLB and xps_sysace and fixed all the
> compilation errors that I had. I also added the ddr ram plb controller
> and able to debug the code now.
>
> I have another issue now that am trying to figure out. For some
> reason, when reading the first file, the program is hitting a
> _vector_sw_exception which I get after exiting
> int update_bufcache(int sector, unsigned char *sector_buf, int dirty)
> function. This function is called multiple times before the exception
> is made.
>
> update_bufcache() is called by read_sector(), which in turn is read
> from read_from_file()
>
> Why could this exception happen?
> I've checked my address ranges and they don't seem to overlap.
> I formatted my CF card as suggested by the xupv2p's user guide for
> 128mb with mkdosfs and placed a few images there, and the exception
> happens on the first.
> As example, I am using the slideshow code available from xilinx/
> digilent:http://www.digilentinc.com/Products/Detail.cfm?Prod=XUPV2P
> I disabled //XCache_EnableDCache(0xF000000F) and //
> XCache_EnableICache(0xF000000F) lines. Could it relate to the problem?
> My DDR ram has these disabled in Assembly System View too.

SW exception could be occuring because you compiled your software for
the wrong microblaze. In other words, you used instructions that were
not selected when the system was built.