Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month ago.
Mbed export for uVision microlib
Trying to us microlib in uVision for a KL05z export and get these errors at the end of compiling when the linking process starts. No other errors
.\build\MBED_10.axf: Error: L6218E: Undefined symbol initial_sp (referred from entry2.o).
.\build\MBED_10.axf: Error: L6218E: Undefined symbol heap_base (referred from malloc.o).
.\build\MBED_10.axf: Error: L6218E: Undefined symbol heap_limit (referred from malloc.o).
Is it possible to use microlib in uVision with mbed exports?
1 Answer
10 years, 1 month ago.
I have worked out the answer here.
I replaced the fist part of the start up file ( startup_MKL05Z4.s ) by adding this code:
Original part of startup_MKL05Z4.s
__initial_sp EQU 0x20000C00 ; Top of RAM PRESERVE8 THUMB
Added this code:
Changed and added this
Stack_Size EQU 0x00000200 AREA STACK, NOINIT, READWRITE, ALIGN=3 EXPORT __initial_sp Stack_Mem SPACE Stack_Size __initial_sp EQU 0x20000C00 ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 EXPORT __heap_base EXPORT __heap_limit __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB
Initial tests indicate its working correctly, if the program remains stable, using MicroLIB has trimmed down my executable from 25.5k to 15.5k.
Perhaps MicroLIB should be used in Mbed for the smaller flash MCU's as default like it is for the LPC812 depending on pros and cons.
I have a similar problem when I using LPC1768 mbed. If I select the microlib, it give me following error. .\build\SingleJointAngle.axf: Error: L6218E: Undefined symbol aeabi_assert (referred from joint.o). .\build\SingleJointAngle.axf: Error: L6218E: Undefined symbol initial_sp (referred from entry2.o). .\build\SingleJointAngle.axf: Error: L6218E: Undefined symbol heap_base (referred from malloc.o). .\build\SingleJointAngle.axf: Error: L6218E: Undefined symbol heap_limit (referred from malloc.o).
However I didn't find the similar file like startup_LPC1768.s under the mbed folder. I only find startup_LPC17xx.o file. Could you suggest what I should do?
Does mbed online compiler using microlib as default? I am trying to keep consistent with it on my uvision 5.
cheers Kingwinter
posted by 28 Jan 2015
I have same problem but I didn't find the similar file like startup_LPC1768.s under the mbed folder. I only find startup_LPC17xx.o file. so want can i do to fix this problem
posted by Akash Jivani 23 Mar 2016This is the similar file for the LPC1768 that I changed for KL05z:
https://developer.mbed.org/users/mbed_official/code/mbed-dev/file/75b7d1f8d36d/targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_ARM_MICRO/startup_LPC17xx.S
You will need to make changes and re-import it to Mbed because this file is unreadable in the online compiler. The changes I did was to use it in uVision. Do you need microlib? the LPC1768 does have 512k flash.
posted by Paul Staron 23 Mar 2016