While you certainly found an error in my code. When i fixed it my problem remains.
I have cleaned up the code now. So there is no confusion between the flash code and just
executing out of RAM which is the real problem.
Here is a the code now. I will attach a zip of the project. I am pretty sure the problem
is in my setting up KDS rather than actually the code itself.
#if TEST_RAM_EXECUTION
uint32_t how_many_calls(uint32_t calls,uint32_t incr);
uint32_t how_many_calls(uint32_t calls,uint32_t incr)
{
calls++;
calls += incr;
return calls;
}
void test_ram_execution(ps3_context * ps3)
{
uint32_t (* ram_calls)(uint32_t,uint32_t);
uint32_t call_counter;
ram_calls = RelocateFunction((uint32_t)0x20004000 , LAUNCH_CMD_SIZE ,(uint32_t)how_many_calls);
call_counter = ps3->serial_number;
call_counter = how_many_calls(call_counter, call_counter);
ps3->serial_number = call_counter;
INT_SYS_DisableIRQGlobal();
call_counter = ram_calls(call_counter, call_counter);
INT_SYS_EnableIRQGlobal();
ps3->serial_number = call_counter;
}
#endif
void InitFlashandPS3Now(char init_mode, ps3_context * ps3)
{
unsigned short sensor;
uint32_t * pflash = (uint32_t *)PARAMETER_FLASH_ADDRESS;
unsigned char outbyte[1] = {ACTIVE_SENSE};
#if TEST_RAM_EXECUTION
test_ram_execution(ps3);
#endif