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
Thanks,
Swade
已解决! 转到解答。
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
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?
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.
-------------------------------------------------------------------------------
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?
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.
-------------------------------------------------------------------------------