3 Replies Latest reply on Apr 29, 2020 8:51 AM by RaAl_4361976

    lwIP/http default example not working compiled with gcc


      Hello. I have the FM4-216-ETHERNET board and compiled the default example of s6e2cc_ethernet_lwip-v11 with gcc but it is not fully working, the lwIP http functionality hangs. However the default hex compiled with Keil that comes by default works correctly and web page is shown. With the srec file compiled with gcc the Hmi Menu works but no TPC/IPpackages are sent and when loading the web page, the micro hangs, even Hmi Menu stops working.


      I checked that the code is similar to other lwIP example with http in other micros, so I thought it could be that the example was only tested with Keil tool and that the gcc compilation has wrong flag/s. Here I send the linking flags. If you had any idea what could be the root cause or how to investigate the problem, I would be very thankful.


      D:/arm/bin/arm-none-eabi-gcc -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nano.specs -specs=nosys.specs -Os -L -Larmv7e-m/fpu -T S6E2CCA_rom.ld -I.  -lg -lstdc++ -lsupc++ -lm -lgcc -lc -lnosys -o output/release/s6e2cc_ethe


      D:/arm/bin/arm-none-eabi-objcopy -I elf32-little -O binary output/release/s6e2cc_ethernet_lwip.elf output/release/s6e2cc_ethernet_lwip.bin

      D:/arm/bin/arm-none-eabi-objcopy -O srec output/release/s6e2cc_ethernet_lwip.elf output/release/s6e2cc_ethernet_lwip.srec

      Printing size

      D:/arm/bin/arm-none-eabi-size --totals output/release/s6e2cc_ethernet_lwip.elf

         text    data     bss     dec     hex filename

        47696     184   55712  103592   194a8 output/release/s6e2cc_ethernet_lwip.elf

        47696     184   55712  103592   194a8 (TOTALS)

      D:/arm/bin/arm-none-eabi-objdump -D output/release/s6e2cc_ethernet_lwip.elf > output/release/s6e2cc_ethernet_lwip.lst

      D:/arm/bin/arm-none-eabi-nm output/release/s6e2cc_ethernet_lwip.elf > output/release/s6e2cc_ethernet_lwip-symbol-table.txt

      Make was successful done.

        • 1. Re: lwIP/http default example not working compiled with gcc

          Addtional information. I had to change the rom map S6E2CCA_rom adding to .bss the last entry "end = _end;". If not the link was giving a problem with "in function `_sbrk': undefined reference to `end'".

            .bss :


              _sbss = .;


              *(.bss .bss.* .gnu.linkonce.b.*)



              . = ALIGN (8);

              _ebss = .;

              _end = .;

              __end = .;

              end = _end;

            } >ram AT>rom

          • 2. Re: lwIP/http default example not working compiled with gcc


            may I ask how you use the GCC? Using the make environment? Which GCC version you are using.

            The example includes 5 projects and has been tested with the given tool chain versions, see readme.txt.

            ARM    5.11
            Atollic / GCC4.3.1
            IAR    7.30
            iSYSTEM / GCC9.12.213
            make / GCCsame as iSYSTEM


            Working from home-office unfortunately I have no board available to verify the example.

            As the example code is roughly 5 yrs old I can imagine, that newer GCC version may cause the issue.

            My suggestion would be to download iSYSTEM WinIDEA open, it's for free and includes full device support of S6E2CC.




            1 of 1 people found this helpful
            • 3. Re: lwIP/http default example not working compiled with gcc

              Hello Holger,


              Thanks very much for your replay.


              I downloaded gcc-arm-none-eabi-5_4-2016q3-20160926-win32 from 2016 and now the example is FULLY WORKING.


              Thanks very much for your hint.


              Kind regards,