-->
Page 1 of 2

Sending ~100kB HTML file

PostPosted: Sat Jun 13, 2015 12:14 pm
by knovoselic
Hi all!

I'm trying to use ESP8266WebServer to send a relatively large HTML file (cca 100kB). I can't use SD card, so it has to be stored on the ESP8266 flash. Unfortunately, I have no idea how to do it. I've tried defining const char array (both using large string and byte values), but then I'm getting the following error:

address 0x3fffcea0 of main.cpp.elf section `.bss' is not within region `dram0_0_seg'

I'd appreciate any suggestion on how to proceed. Thanks!

Re: Sending ~100kB HTML file

PostPosted: Sat Jun 13, 2015 6:38 pm
by lethe
The compiler tries to keep the array in RAM, where it won't fit. Try adding ICACHE_FLASH_ATTR to the array definition.

Re: Sending ~100kB HTML file

PostPosted: Sun Jun 14, 2015 5:21 am
by knovoselic
Thanks :)
I've already tried that, but it didn't work because I was using a pointer to the string, like this:
Code: Select allstatic const char ICACHE_FLASH_ATTR *test = ...;

Today after I saw your message I started digging around the code and saw it someplace used like this:

Code: Select allstatic const char ICACHE_FLASH_ATTR test[] = ...;


Now I can compile it, but the web server is returning 0 bytes. If I try to print it, the ESP8266 resets:
Code: Select allets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 28780, room 16
tail 12
chksum 0xb7
ho 0 tail 12 room 4
load 0x3ffe8000, len 1532, room 12
tail 0
chksum 0xb3
load 0x3ffe8600, len 2860, room 8
tail 4
chksum 0x3e
csum 0x3e

Re: Sending ~100kB HTML file

PostPosted: Sun Jun 14, 2015 3:56 pm
by cal
From what we saw of the code we conclude that there may be a bug.