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, 3 months ago.
Why mbed online result is different with keil MDK?
I have use mbed online make a kl05 test project. In my board I use internal oscillator, so I have not use default mbed library, then import mbed-src, and modified file "system_MKL05Z4.c", set macro CLOCK_SETUP from 1 to 0.
- define CLOCK_SETUP 0
And I use PTB6 and PTB7 to control two LEDs.
DigitalOut gpo(PTB7);
DigitalOut led(PTB6);
int main()
{
while (true) {
gpo = !gpo; toggle pin
led = !led; toggle led
wait(1.0f);
}
}
After I compile the project and donwload binary file to kl05z32vlc4, it works fine.
But when I export full project with Keil uVision4 Toolchain, and compile the project in keil MDK. Then I download binary file, I found it is not work now, and I also found binary file create by keil MDK, it is different with mbed online. I test project in MDK 5.11 and MDK 4.72, the result is same.
What is the problem?
My test project in:
http://mbed.org/users/shaoziyang/code/frdm_kl05z_gpio_test/
http://mbed.org/users/shaoziyang/code/mbed-src-kl05/
-----------------
I found that it must check "Use MicroLIB" option in Keil MDK project, if check this option, application will running, otherwise it is not run.
1 Answer
10 years, 3 months ago.
Hi,
so you answered your own question, the online compiler sets that flag for KL05Z (use MicroLib). More info about microlib http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0475c/BAJJIBHH.html
Therefore they did not match. Another difference, optimization is set to O3 in the online compilre, while exported projects by default have it set to O0.
Regards,
0xc0170