-->
Page 37 of 55

Re: New Working GCC for ESP8266

PostPosted: Mon Dec 01, 2014 3:37 pm
by alonewolfx2
i cleaned up and try again. but i have same issue

Re: New Working GCC for ESP8266

PostPosted: Mon Dec 01, 2014 3:41 pm
by jcmvbkbc
alonewolfx2 wrote:firstline works without any output.
did you mean "make clean" and "make STANDALONE=y" ?

I mean git clean -fd in esp-open-sdk, crosstool-NG and lx106-hal directories, rm -rf esp-open-sdk/crosstool-NG/.build/src and then make STANDALONE=y

Re: New Working GCC for ESP8266

PostPosted: Tue Dec 02, 2014 6:23 pm
by Bananis
Hey,

Here is a version of the makefile that also builds images for cloud update (user1.bin and user2.bin). This makes it possible to directly update your own code to the device over WIFI, see my writeup here on how to make it work: http://www.esp8266.com/viewtopic.php?f=9&t=620. Saves a lot of time :)

I use the toolchain with Mingw64. You need to copy gen_flashbin.py from the tools folder in the SDK to where you have esptool.exe

/Bananis

Re: New Working GCC for ESP8266

PostPosted: Thu Dec 04, 2014 8:08 am
by joostn
jcmvbkbc wrote:This script produces ELF as expected, but still doesn't work when I flash it. Maybe I'm doing something wrong as well...

I found a way to get all code in Flash by default! Modify the linker script as follows:
Code: Select all .text : ALIGN(4)
  {
...
/*    *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) */
    *(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
...
  } >iram1_0_seg :iram1_0_phdr

  .irom0.text : ALIGN(4)
  {
    _irom0_text_start = ABSOLUTE(.);
    *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
    *(.literal.* .text.*)
    _irom0_text_end = ABSOLUTE(.);
  } >irom0_0_seg :irom0_0_phdr

So I've moved the .text.* and .literal.* to the irom0 section. I've added '-ffunction-sections -fdata-sections' to the gcc compiler flags, which causes my own code to go into .text.* instead of .text. The startup code is in .text so it will end up in the right section.