I have managed to load everything correctly = verified by reading out the memory. What is really strange to me is when I execute a memory where is supposed to be call_user_main(), it crashes on:
Code: Select all
Fatal exception (0):
epc1=0x4010fd7d, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0
0000000
The code is:
Code: Select all
void Cache_Read_Enable(UINT8 odd_even, UINT8 mb_count, UINT8 no_idea);
//void Cache_Read_Enable(uint32 odd_even, uint32 mb_count, uint32 no_idea);
typedef void usercode(void);
void call_user_start()
{
UINT32 ret = 0x40260000 + 0x1000 + sizeof(header_t);
usercode* user = (usercode*)loadrom(ret); //0x40100004
Cache_Read_Enable(0, 0, 1);
[b]user(); [/b] //this throws the exception!!
while(1)
{
;
}
}
I have verified that IRAM address 0x40100004 contains what it supposed to contain. It is value "21 FF FF 20" and the double word before on address 0x40100000 contains value 0x40100000.
As I understood, the value is probably not correct instruction - assuming from Exception #0 = invalid instruction.
What can be possibly wrong? Thank you David.