forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

freeze during sceIoRead

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
ole



Joined: 08 May 2004
Posts: 92
Location: Czech Republic

PostPosted: Sat Mar 25, 2006 4:39 am    Post subject: freeze during sceIoRead Reply with quote

I have a problem reading a file from memorystick. Sometimes the file is read fully and correctly, sometimes the read function just freeze the psp so the only way how to resurrect it is to press the power switch for about 10 secs.

To be more specific: I use the sceIoRead function to read the file.
If I create simple "Hello from read file" elf that just reads from the file and exit, then it works correctly. Howewer if I use the sceIoRead function in a larger project where there are numerous object files linked together in aprox. 230kb stripped binary then the read function fails and freeze.

I tested many options how to "bypass" the behaviour - read the required file at the very beginning of the main() function, read the file sequentially to a smaller buffer parts etc. The only result was freeze after about 500kbytes read (file is aprox 1,3 mb). The data buffer is allocated by using the malloc function passing the filesize as the argument.

I'm using the psptoolchain-2006012, on a 1.5 firmware, execution via psplinkv0.9d.

Any Idea what might be the cause?

Ole
Back to top
View user's profile Send private message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Sun Mar 26, 2006 12:52 pm    Post subject: Reply with quote

It's much more likely for someone to help you if you paste some code. I'd even be willing to try if I had some code to try and read ;)
Back to top
View user's profile Send private message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Thu Mar 30, 2006 12:09 pm    Post subject: Reply with quote

Make sure the destination buffer you are reading into starts on a 64 byte boundry (16 byte alignment might be ok, but I use 64 since I don't have access to DMA manual to make sure).

If you are using malloc to allocate the buffer switch to memalign

I also suggest you read multiples of 64 bytes to avoid cache write-back issues.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group