LoadStoreErrorCause help
LoadStoreErrorCause help
Postby smbgaiden » Thu Oct 19, 2017 5:06 am
Hi All,
I've written some strings into spi flash and then try to access using the virtual memory addressing and have a weird behavior that I can't figure out how to cope with.
Flashed my equal sized strings with esptool.py to 0x80000. Verified they're there via two ways:
A.
char* p = (char *)0x40280000;
os_printf("%c%c%c%c\n", p[0], p[1], p[2], p[3]);
B.
spi_flash_read(0x80000, temp, sizeof(temp));
os_printf("SPI Read: 0x%X 0x%X 0x%X 0x%X\n", temp[0], temp[1], temp[2], tem$
Compared the hex vs. the chars vs. the bin I wrote there and everything was fine.
Now if I do:
char * p =(char *)0x40280064; // this is a valid string address starting point and is smaller than the bin file written into 0x80000
os_printf(p); // This is good! See my string printed over serial.
// But if I do this:
os_printf("This is my string: %s", p); // this throws me out the following before reset:
This is my string: Fatal exception 3(LoadStoreErrorCause):
epc1=0x4000228b, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40280064, depc=0x0
Closest address to 0x4000228b seems to be:
40001f00 g *ABS* 00000000 ets_vprintf
; which makes sense for os_printf to call.
Does anyone know why I can directly use a pointer to virtual indexed memory with os_printf and have a good result vs. having the printf code look it up via a va_list causes the LoadStoreErrorCause?
I've written some strings into spi flash and then try to access using the virtual memory addressing and have a weird behavior that I can't figure out how to cope with.
Flashed my equal sized strings with esptool.py to 0x80000. Verified they're there via two ways:
A.
char* p = (char *)0x40280000;
os_printf("%c%c%c%c\n", p[0], p[1], p[2], p[3]);
B.
spi_flash_read(0x80000, temp, sizeof(temp));
os_printf("SPI Read: 0x%X 0x%X 0x%X 0x%X\n", temp[0], temp[1], temp[2], tem$
Compared the hex vs. the chars vs. the bin I wrote there and everything was fine.
Now if I do:
char * p =(char *)0x40280064; // this is a valid string address starting point and is smaller than the bin file written into 0x80000
os_printf(p); // This is good! See my string printed over serial.
// But if I do this:
os_printf("This is my string: %s", p); // this throws me out the following before reset:
This is my string: Fatal exception 3(LoadStoreErrorCause):
epc1=0x4000228b, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40280064, depc=0x0
Closest address to 0x4000228b seems to be:
40001f00 g *ABS* 00000000 ets_vprintf
; which makes sense for os_printf to call.
Does anyone know why I can directly use a pointer to virtual indexed memory with os_printf and have a good result vs. having the printf code look it up via a va_list causes the LoadStoreErrorCause?
Re: LoadStoreErrorCause help
Postby smbgaiden » Thu Oct 19, 2017 6:31 am
Oh correction... the p[0] was actually int pointers. Seems you can't use l8 functions with SPI Flash addresses. When I recast the int * to char * and try to printf with %c p[0] and etc it will crash.
-
- Posts: 15
- Joined: Thu Jul 12, 2018 2:06 pm
Re: LoadStoreErrorCause help
Postby sedlacek.david » Sun Aug 05, 2018 10:21 pm
I'm probably facing the same problem. Have 4MBytes of flash. I can declare a variable like
and read it like . This works.
But when I have a pointer like this:
it will crash:
Don't understand...
Code: Select all
const char * p = 0x40280000
Code: Select all
int x = *p
But when I have a pointer like this:
Code: Select all
UINT32 addr = 0x40280000;
const char * p = (const char *)addr;
it will crash:
Code: Select all
Fatal exception 3(LoadStoreErrorCause):
epc1=0x402430ec, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40280000, depc=0x0
0000000
Don't understand...
-
- Posts: 15
- Joined: Thu Jul 12, 2018 2:06 pm
-
- Posts: 15
- Joined: Thu Jul 12, 2018 2:06 pm
Re: LoadStoreErrorCause help
Postby sedlacek.david » Wed Aug 15, 2018 3:32 pm
Thank you for your reply.
So there is nothing wrong with it. What I have to do now is refactor some of my C structures mapping some UINT8 stuff stored in the FLASH.
So there is nothing wrong with it. What I have to do now is refactor some of my C structures mapping some UINT8 stuff stored in the FLASH.
Who is online
Users browsing this forum: No registered users and 288 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.