Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM GCC
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM GCC
Hi,
since I would like to be able to compile/link and debug the Baseflight and Harakiri project on my own, I've started writing an 'How-To'-Guide on 'Compiling/Linking of Baseflight and Harakiri by using the ARM GCC Toolchain with Keil MDK-Lite IDE'.
You can find the guide and the related files here: http://www.rc-heli-fan.org/resources/baseflight-compile-link-howto-tutorial-rev0r2/129715
A ready-to-use Keil+ARM GCC Baseflight Project (Source r468) is available here: http://www.rc-heli-fan.org/resources/ke ... 468/129629
Let me know your thoughts. Happy coding, kind regards
aBUGSworstnightmare
since I would like to be able to compile/link and debug the Baseflight and Harakiri project on my own, I've started writing an 'How-To'-Guide on 'Compiling/Linking of Baseflight and Harakiri by using the ARM GCC Toolchain with Keil MDK-Lite IDE'.
You can find the guide and the related files here: http://www.rc-heli-fan.org/resources/baseflight-compile-link-howto-tutorial-rev0r2/129715
A ready-to-use Keil+ARM GCC Baseflight Project (Source r468) is available here: http://www.rc-heli-fan.org/resources/ke ... 468/129629
Let me know your thoughts. Happy coding, kind regards
aBUGSworstnightmare
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
Great write-up.
I tried to get gcc working under keil with 4.x uVision IDE and it was a mess that never worked correctly.
Looking forward to 'debugging' section - hopefully it "just works", because current state of opensores debuggers is pretty sad.
Also of note, the project moved to github for source control - official source releases are now at https://github.com/multiwii/baseflight
I tried to get gcc working under keil with 4.x uVision IDE and it was a mess that never worked correctly.
Looking forward to 'debugging' section - hopefully it "just works", because current state of opensores debuggers is pretty sad.
Also of note, the project moved to github for source control - official source releases are now at https://github.com/multiwii/baseflight
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
Hi timecop,
glad you like it
Well, I think debugging will be easy when using the right tools! I will start the write-up with Segger's J-Link EDU (http://www.segger.com/j-link-edu.html) and J-Link ultra+ (http://www.segger.com/jlink-ultra-plus.html) and will try using Rowley's CrossConnect for ARM (http://www.rowley.co.uk/arm/CrossConnect.htm) and IAR J-Link lite (http://www.iar.com/jlink_lite_cm/) in the second row.
I'm interested to see if IAR J-Link lite will work in this environment (since it can't be used under pure Keil MDK http://www.segger.com/j-link-oem-versions.html).
Rgds
Joerg
aBUGSworstnightmare
glad you like it

Well, I think debugging will be easy when using the right tools! I will start the write-up with Segger's J-Link EDU (http://www.segger.com/j-link-edu.html) and J-Link ultra+ (http://www.segger.com/jlink-ultra-plus.html) and will try using Rowley's CrossConnect for ARM (http://www.rowley.co.uk/arm/CrossConnect.htm) and IAR J-Link lite (http://www.iar.com/jlink_lite_cm/) in the second row.
I'm interested to see if IAR J-Link lite will work in this environment (since it can't be used under pure Keil MDK http://www.segger.com/j-link-oem-versions.html).
Rgds
Joerg
aBUGSworstnightmare
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
Oh, I'm sure if debugging GCC-built stuff actually works then the end adapter doesn't matter - the underlying protocol should be same. Once i get some free time I'll try this w/gcc and keil ulink2 and jlink.
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
timecop wrote:Great write-up.
I tried to get gcc working under keil with 4.x uVision IDE and it was a mess that never worked correctly.
Looking forward to 'debugging' section - hopefully it "just works", because current state of opensores debuggers is pretty sad.
Also of note, the project moved to github for source control - official source releases are now at https://github.com/multiwii/baseflight
This is always the latest DEV version? https://github.com/multiwii/baseflight/tree/master/obj
What about version number?
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
Well ... seems like debugging will give some serious fun to figure the 'how-to' out!
Made a short test run with my Segger J-Link ultra+. After changing the settings it is possible to flash the device via J-Link (SWD-Interface)
But when I attempt to start the debugger it is still using the code size limited version
Now I need to figure out how to use a different debugger (GDB) under Keil MDK-Lite
Any advice is welcome!
aBUGSworstnightmare
Made a short test run with my Segger J-Link ultra+. After changing the settings it is possible to flash the device via J-Link (SWD-Interface)
But when I attempt to start the debugger it is still using the code size limited version
Now I need to figure out how to use a different debugger (GDB) under Keil MDK-Lite

aBUGSworstnightmare
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
scrat wrote:What about version number?
+1
since baseflight beginning it is a pain to find the revision number ! why don't integrate the info in this code line !
Code: Select all
cliPrint("Afro32 CLI version 2.2 " __DATE__ " / " __TIME__);
like this for exemple:
Code: Select all
cliPrint("Afro32 master r4?? CLI ver 2.2" __DATE__ " / " __TIME__);
It is so difficult ?......
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
The date is already there.
Why would anyone need more info than that? Also, since we're not using SVN anymore, the 'rxxx' doesn't apply anyways.
And yes, latest BUILT version is at https://github.com/multiwii/baseflight/tree/master/obj.
Source of course could be newer.
Why would anyone need more info than that? Also, since we're not using SVN anymore, the 'rxxx' doesn't apply anyways.
And yes, latest BUILT version is at https://github.com/multiwii/baseflight/tree/master/obj.
Source of course could be newer.
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
timecop wrote:The date is already there.
Why would anyone need more info than that? Also, since we're not using SVN anymore, the 'rxxx' doesn't apply anyways.
And yes, latest BUILT version is at https://github.com/multiwii/baseflight/tree/master/obj.
Source of course could be newer.
Does this mean trat the repository at http://code.google.com/p/afrodevices/source/browse/#svn will not contain any more the latest source code? If I want to have updated baseflight do I must checkout from ginthub at URL
https://github.com/multiwii/baseflight ?
- aBUGSworstnightmare
- Posts: 115
- Joined: Mon Jun 27, 2011 8:31 pm
- Location: Munich, Germany
Re: Compiling/Linking Baseflight and Harakiri - KEIL MDK+ARM
Hi,
since I still need to figure out how to debug with Keil + GCC I've made a short test with another IDE for giving me a lift.
I've use emIDE (http://emide.org) and my Segger j-Link ultra+.
After the projects was set-up and configured (not a big deal at all; be shure to use the start-up and linker script file supplied with the How-To!) I just made a short debug-session which went flawlessly.
Maybe an option if Keil refuses to debug with GDB.
@Timecop: can you pls clarify what you do with/in void ACC_getADC(void)? GCC generates a Compiler Error here for -O3 setting.
aBUGSworstnightmare
since I still need to figure out how to debug with Keil + GCC I've made a short test with another IDE for giving me a lift.
I've use emIDE (http://emide.org) and my Segger j-Link ultra+.
After the projects was set-up and configured (not a big deal at all; be shure to use the start-up and linker script file supplied with the How-To!) I just made a short debug-session which went flawlessly.
Maybe an option if Keil refuses to debug with GDB.
@Timecop: can you pls clarify what you do with/in void ACC_getADC(void)? GCC generates a Compiler Error here for -O3 setting.
aBUGSworstnightmare