AnsweredAssumed Answered

emwin_gui_demo in EVK-MIMXRT1050 SDK fails to compile

Question asked by craigsmith on Jan 10, 2018
Latest reply on Mar 21, 2018 by Luis Pereira

After modifying the EVK-MIMXRT1050 SDK manifest file to get the emwin_gui_demo project to become available

 (see post EVK-MIMXRT1050 SDK middleware projects not available for details) I'm getting lots of compile errors when I try to build in MCUXpresso.

 

Memory region Used Size Region Size %age Used
SRAM_DTC: 436480 B 128 KB 333.01%
SRAM_ITC: 0 GB 128 KB 0.00%
SDRAM: 0 GB 32 MB 0.00%
c:/integrity/mcuxpressoide_10.1.0_589/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv5-sp/hard\libcr_c.a(alloc.o): In function `malloc':
alloc.c:(.text.malloc+0x0): multiple definition of `malloc'
c:/integrity/mcuxpressoide_10.1.0_589/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv5-sp/hard\libc.a(lib_a-malloc.o):malloc.c:(.text.malloc+0x0): first defined here
c:/integrity/mcuxpressoide_10.1.0_589/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv5-sp/hard\libcr_c.a(alloc.o): In function `free':
SRAM_OC: 0 GB 256 KB 0.00%
alloc.c:(.text.free+0x0): multiple definition of `free'
c:/integrity/mcuxpressoide_10.1.0_589/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv5-sp/hard\libc.a(lib_a-malloc.o):malloc.c:(.text.free+0x0): first defined here
c:/integrity/mcuxpressoide_10.1.0_589/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: evkmimxrt1050_emwin_examples_emwin_gui_demo_emwin_gui_demo.axf section `.text' will not fit in region `SRAM_DTC'
c:/integrity/mcuxpressoide_10.1.0_589/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: region `SRAM_DTC' overflowed by 305408 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [evkmimxrt1050_emwin_examples_emwin_gui_demo_emwin_gui_demo.axf] Error 1

 

After some digging I found the multiple definitions of malloc/free can be fixed by a project setting of

C/C++ Build - Settings - MCU Linker - General

Tick the box next to: "No startup of default libs (-nostdlib)"

- this is the same setting as in many of the other demo projects in the SDK.

 

Unfortunately the memory overflows remained... I ended up moving the emwin libraries into another project (using the external flash and SDRAM) but would be good to get this project fixed in the SDK so have a stable base to test emwin with.

Memory region    Used Size       Region Size    %age Used
SRAM_DTC:       431168 B          128 KB           328.96%
SRAM_ITC:          0 GB                128 KB          0.00%
SDRAM:               0 GB                32 MB           0.00%

SRAM_OC:          0 GB                 256 KB          0.00%

 

Any way to fix the project in the SDK?

Outcomes