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
freeze during sceIoRead
-
- Posts: 75
- Joined: Mon Sep 19, 2005 5:41 am
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.
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.