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?Statistics: Posted by smbgaiden — Thu Oct 19, 2017 5:06 am
]]>