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, 11 months ago.
WEAK mbed_sdk_init() is not overrided by the STRONG one. (STM32F103RB mbed)
I had added -Wl,wrap=main in linker flag. But the STRONG mbed_sdk_init() function in mbed_overrides.c is not called.
The WEAK mbed_sdk_init() function in retarget.cpp is called.
Looks like the linker drops the STRONG mbed_sdk_init() function since the functions in mbed_overrides.c are not called by any other functions.
I tried to add a test function in mbed_overrides.c and called it in other functions. Then I found the STRONG mbed_sdk_init() function had also overrided the WEAK function.
Any one also met this problem. Could give some explain about this?
Did you add this to github also ? I noticed there is an issue created today
posted by Martin Kojtal 21 Nov 2014Bin, it would help if you could link to an example of what you have tried. Maybe upload it here as a .zip archive and provide a link?
Thanks,
Adam
posted by Adam Green 22 Nov 2014/media/uploads/leibin198285/testweak.7z @Martin Yes, I had added it to github.
@Adam I just add -Wl,
wrap=main to LDFLAG, and add mbed_overrides.c compiled to lib file. This is normal use of mbed_overrides.c.BTW, I use arm-none-eabi- as toolchain.
I have done similar a example on my linux PC, and get the same result. Please find attached the source code and test log, and we can see in the final main.elf the function mbed_sdk_init() is W type. It's not override by the strong function.
posted by Bin Lei 24 Nov 2014