freeze during sceIoRead

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
ole
Posts: 92
Joined: Sat May 08, 2004 11:14 pm
Location: Czech Republic

freeze during sceIoRead

Post by ole »

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
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

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 ;)
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

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.
Post Reply