I’ve been fighting with the standard SDK for a couple of weeks now, trying to build anything using something approaching a modern toolchain.
I’ve not managed to get very far, as the Makefile in the …/asdk folder in the SDK is quite complex, and it also includes the additionally-complex Makefile.include.gen file.
Ideally, what I’d like to do is to be able to:
- Build with my own toolchain, being the latest gcc-arm-embedded-eabi from embeddedarm;
- Build whatever sdk components are required for my own project (configured with “make manuconfig” or similar);
- Build against a reasonably up to date FreeRTOS as contained in the sdk;
- Build outside the sdk file tree, so I can have my own files under my own version control.
- Not have to modify any of the SDK makefiles (ie, keep the sdk completely separate, and clean compared to upstream).
So, I’ve been playing with the Makefiles, and trying to adapt the head Makefile for this scenario, by copying over the head Makefile and making a subdirectory for asdk and copying the asdk Makefile & Makefile.include.gen files, editing those as necessary.
I got as far as being able to “make menuconfig” but building anything else just caused a whole stack of “file not found” errors"
My next strategy was to copy the entire asdk file tree except the included toolchain into a sub directory of my project. This meant I could edit any of the included Makefiles with appropriate paths etc, removing the included toolchain and using the up to date one. I also didn’t get very far with this - I failed eventually on an unfound ram.a file and it was also difficult to work out where to add my own files to the spaghetti of Makefiles.
So, I guess my question is two-fold:
- How do I build the SDK and my own project using a different C compiler instead of the one supplied in the SDK, outside the sdk itself. I want to be able to have my project as a separate repo, and ideally the sdk should be a submodule of my project.
Something like this:
.
├── ambd_sdk
│ ├── component
│ ├── doc
│ ├── project
│ │ └── realtek_amebaD_va0_example
├── myproject
│ ├── km0
│ │ └── src
│ └── km4
│ ├── config
│ ├── inc
│ └── src
The main Makefiles for the two cores should be in the head directory of each of the directories km0 and km4 in the above tree.
Is this just a dream? I really need to be making progress with my project instead of fighting the build system, but I just can’t stomach using a binary blob toolchain of unknown provenance that is several versions behind the latest. Also I want to keep the source for my project as cleanly separate from the SDK so I can keep it under my own company’s source control system.