ESP8266 Developer Zone The Official ESP8266 Forum 2019-05-05T00:37:31+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=28430 2019-05-05T00:37:31+08:00 2019-05-05T00:37:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=28430&p=40573#p40573 <![CDATA[Re: [ESP8266 nonOS sdk] Can't execute my own function pointer]]> Statistics: Posted by sedlacek.david — Sun May 05, 2019 12:37 am


]]>
2019-05-03T03:50:00+08:00 2019-05-03T03:50:00+08:00 https://bbs.espressif.com:443/viewtopic.php?t=28430&p=40472#p40472 <![CDATA[Re: Can't execute my own function pointer]]>

Code:

sp 0x3ffff7c0
                                                               
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0068e0f1, depc=0x0
0000000
                                                                       
Fatal exception (28):
                                                       
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00637ff0, depc=0x0
0000000
                                                                       
Fatal exception (28):
                                                       
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00637ff0, depc=0x0
0000000

Statistics: Posted by sedlacek.david — Fri May 03, 2019 3:50 am


]]>
2019-05-03T03:31:35+08:00 2019-05-03T03:31:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=28430&p=40471#p40471 <![CDATA[Re: Can't execute my own function pointer]]> Statistics: Posted by sedlacek.david — Fri May 03, 2019 3:31 am


]]>
2019-05-03T03:26:16+08:00 2019-05-03T03:26:16+08:00 https://bbs.espressif.com:443/viewtopic.php?t=28430&p=40469#p40469 <![CDATA[Re: Can't execute my own function pointer]]>
And epc1=0x4010fd7d is an address somewhere at the end of call_user_start() function I posted above.

Statistics: Posted by sedlacek.david — Fri May 03, 2019 3:26 am


]]>
2019-05-03T03:51:35+08:00 2019-05-03T03:23:54+08:00 https://bbs.espressif.com:443/viewtopic.php?t=28430&p=40468#p40468 <![CDATA[[ESP8266 nonOS sdk] Can't execute my own function pointer]]>
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:

Fatal exception (0):
                                                         
epc1=0x4010fd7d, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0
0000000


The code is:

Code:

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.

Statistics: Posted by sedlacek.david — Fri May 03, 2019 3:23 am


]]>