emWin library too large for K64f Cortex M4?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

emWin library too large for K64f Cortex M4?

Jump to solution
1,251 Views
Swade
Contributor II

I'm trying to link the emWin library provided by NXP with my application. The problem is that pre-built library is 4MB and there's on 256KB RAM on the microprocessor. How can I use this library on my platform?

Microprocessor: https://www.nxp.com/docs/en/data-sheet/K64P144M120SF5.pdf

emWin library from NXP (using ARMGCC/libemWin_M4F.a  https://www.nxp.com/design/software/embedded-software/nxp-emwin-libraries:EMWIN-GRAPHICS-LIBRARY

Thanks,
Swade

0 Kudos
Reply
1 Solution
1,183 Views
Swade
Contributor II

Found the problem. One of the config files was setting aside a large chunk of memory for the GUI. GUI_X_Conf.c. 

View solution in original post

6 Replies
1,184 Views
Swade
Contributor II

Found the problem. One of the config files was setting aside a large chunk of memory for the GUI. GUI_X_Conf.c. 

1,238 Views
ErichStyger
Specialist I

Hi @Swade ,

keep in mind that the file size on disk on your host machine is no indication to the RAM/ROM size needed on the target. The archive (.a, library) is a collection of object files, and the object files include extra information like symbolic and source information which will not use any space on the target. Plus the linker will remove any unused objects too.

A few articles on the subject of ELF/Dwarf files and size information on my blog might help too:

Listing Code and Data Size for each Source File with GNU and Eclipse | MCU on Eclipse 

Printing Code Size Information in Eclipse | MCU on Eclipse 

text, data and bss: Code and Data Size Explained | MCU on Eclipse 

Converting a Raw Binary File into an ELF/Dwarf File for Loading and Debugging | MCU on Eclipse 

 

I hope hope this helps,

Erich

1,227 Views
Swade
Contributor II

Thank you that was informative. But even taking that into account the library seems to be too large for inclusion. Here are the memory stats without emWin:

$ /opt/K64F_sdk-sumo/gcc-arm-none-eabi-7-2019-q2-update/bin/arm-none-eabi-size MyExeBefore
text data bss dec hex filename
399296 3960 7980 411236 64664 MyExeBefore

And here with the emWin library (I had to expand regions in my .ld file just to all this to build):

$ /opt/K64F_sdk-sumo/gcc-arm-none-eabi-7-2019-q2-update/bin/arm-none-eabi-size MyExeAfter
text data bss dec hex filename
3273664 4008 2629884 5907556 5a2464 MyExeAfter

Perhaps the linker is not removing unreferenced code and data? 

0 Kudos
Reply
1,245 Views
nxf56274
NXP Employee
NXP Employee

Hi,

We have the emwin example in directory 'FRDM-K64F\boards\frdmk64f'. You can refer it.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,226 Views
Swade
Contributor II

Thank you. That example seems to only contain code and not the build files (e.g. makefile, project file) that would contain the compiling and linking details. Can you point me in the right direction for those?  

 

0 Kudos
Reply
1,218 Views
nxf56274
NXP Employee
NXP Employee

Hi,

You can use the mcuxpresso to import this example. The mcuxpresso also use the arm-gcc. The makefile is generated by it.

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------