cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bwk
Observer
Observer
5,549 Views
Registered: ‎09-30-2010

Re: sysace_fwrite hangs when writing more than 2048 byte

Jump to solution

Hello,

 

thanks for this advice. Shall I create a new Topic there or can someone move this thread?

 

Thanks, Micha

0 Kudos
1 Solution

Accepted Solutions
bwk
Observer
Observer
6,889 Views
Registered: ‎09-30-2010

solved:

 

just had to increase the docm and the stack & heap size ...

View solution in original post

0 Kudos
6 Replies
Anonymous
Not applicable
5,539 Views

Micha,

 

I will move this post for you to the embedded forums

 

Carl

0 Kudos
bwk
Observer
Observer
5,524 Views
Registered: ‎09-30-2010

Hello,

 

thanks for moving, but you have not moved my first post, so I will post it again:

 

I'm working with an ML 310 Board with Virtex 2 Pro on it. I'm trying to do a BMP brightening. First I write a 24 Bit BMP file from the CF card to a BRAM (with xilfatfs) , then I start a streamer that reads out this BRAM, brightens the BMP file and writes it back to another BRAM. After that i want to read out the second BRAM and write the brightened BMP file back to the CF card. Everything works fine except the last step. When writing the BMP file to CF card I can only write 2048 byte. If I try to write more, the program hangs. If I use a BMP file smaller than 2048 byte, everything works fine.

 

As mentioned, a small file works fine. But if I want to write another small file, the Program hangs when I try to write the first byte of the second file.

 

Any ideas how to solve that problem?

 

Thanks, Micha

0 Kudos
bwk
Observer
Observer
6,890 Views
Registered: ‎09-30-2010

solved:

 

just had to increase the docm and the stack & heap size ...

View solution in original post

0 Kudos
yeyongpang
Visitor
Visitor
5,334 Views
Registered: ‎11-14-2010

hello, i see you succeed in CF ,you can read and write simple files  using sysace_fread  sysace_fwrite  am i right?

now i am working on the compact flash card and it seem that i got problems:

first , i use xilinx ISE 10.1 on my board ML510, and the simple test code is:

#include "sysace_stdio.h"

#include "xparameters.h"

#include "xstatus.h"

#include "xsysace.h"

#include "xintc.h"

using namespace std;

int main()

{

         char* path = "a:\\test";

         unsigned char mybuf[100];

         const char fname [] = "a:\\test\\test.txt";

         if( sysace_chdir (path)==-1 ) {

                   xil_printf("ERROR: Can't change directory to %s.\n\r", path);

         }

         path = "a:\\internet";

         if( sysace_chdir (path)==-1 ) {

                   xil_printf("ERROR: Can't change directory to %s.\n\r", path);

         }

         SYSACE_FILE *infile;

         infile = sysace_fopen(fname,"r");

         sysace_fread(mybuf, 1, 500, infile);

         xil_printf((char*)mybuf);

         sysace_fclose(infile);

         return 0;

}

finally i got error Can't change directory...

i suspect that i got wrong when generate the project? or the code have problems.

Could you tell me about how can i read write the CF card and make dirctory on CF?

Thank you !!!

Best wishes!!!

0 Kudos
eteam00
Instructor
Instructor
5,332 Views
Registered: ‎07-21-2009

 yeyongpang

 

Please start a new thread to discuss new and unrelated topics.

 

- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
yeyongpang
Visitor
Visitor
5,308 Views
Registered: ‎11-14-2010
ok,i am sorry...
0 Kudos