ESP8266 Developer Zone The Official ESP8266 Forum 2016-04-12T11:52:59+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=1844 2016-04-12T11:52:59+08:00 2016-04-12T11:52:59+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1844&p=6423#p6423 <![CDATA[Re: IOT Platform Sample - espfs alignment error]]> libesphttpd/Makefile file, change the following lines:

Code:

libwebpages-espfs.a: webpages.espfs
   $(Q) $(OBJCOPY) -I binary -O elf32-xtensa-le -B xtensa --rename-section .data=.irom0.literal \
      --redefine-sym _binary_webpages_espfs_start=webpages_espfs_start \
      --redefine-sym _binary_webpages_espfs_end=webpages_espfs_end \
      --redefine-sym _binary_webpages_espfs_size=webpages_espfs_size \
      webpages.espfs build/webpages.espfs.o
   $(Q) $(AR) cru $@ build/webpages.espfs.o

to:

Code:

libwebpages-espfs.a: webpages.espfs
   $(Q) $(OBJCOPY) -I binary -O elf32-xtensa-le -B xtensa --rename-section .data=.irom0.literal \
      webpages.espfs build/webpages.espfs.o.tmp
   $(Q) $(LD) -nostdlib -Wl,-r build/webpages.espfs.o.tmp -o build/webpages.espfs.o -Wl,-T webpages.espfs.ld
   $(Q) $(AR) cru $@ build/webpages.espfs.o

Then, create a new file called webpages.espfs.ld in the same folder (directory) of the aforementioned Makefile. The file content should be the following. Notice that the alignment is now correctly defined in this linker file:

Code:

OUTPUT_FORMAT("elf32-xtensa-le")

SECTIONS
{
   .irom0.literal : ALIGN(4) SUBALIGN(4) {
      webpages_espfs_start = .;
      *(*)
      webpages_espfs_end = .;
      webpages_espfs_size = webpages_espfs_end - webpages_espfs_start;
   }
}


I've found this workaround on what it seems to be the official libesphttd repository: https://github.com/Spritetm/libesphttpd ... r/Makefile

Statistics: Posted by vinicius.vbf — Tue Apr 12, 2016 11:52 am


]]>
2016-03-02T10:15:31+08:00 2016-03-02T10:15:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1844&p=5894#p5894 <![CDATA[IOT Platform Sample - espfs alignment error]]>

should call espfsint first


The call is made in user_init(), as shown:

Code:

void user_init(void)
{
   ...
   /*Initialize espfs containing static webpages*/
   espFsInit((void*)(webpages_espfs_start));
   ...
}


But this call is resulting in "ESPFS_INIT_RESULT_BAD_ALIGN", because of this first condition:

Code:

EspFsInitResult espFsInit(void *flashAddress) {
   // base address must be aligned to 4 bytes
   if (((int)flashAddress & 3) != 0) {
      return ESPFS_INIT_RESULT_BAD_ALIGN;
   }
   ...
}


webpages_espfs_start has a value of 1076086519.

I'm kind of lost. Can anyone help? What am I doing wrong? I'll be happy to provide any other information that you may find useful to know in order to help.

Thanks!!

Statistics: Posted by vinicius.vbf — Wed Mar 02, 2016 10:15 am


]]>