2012-11-02 10:18 AM
I am having difficulty compiling the Demonstration Builder example code. I am using MDK-ARM (Keil) with the 256k license but the code is 265k when linked. I read the app note to disable modules but when I tried to eliminate the ''audio'' module, I got errors from other modules complaining about missing audio functions such as ''AUDIO_ForceStop'' referenced in mod_serial.o.
So, I really don't want to heavily edit the example code since I just want to poke around it, but it seems a bit less modular than advertised. Also, at least in Keil tools, the project has 3 directories with ''Appli'' containing 50+ *.c files in no particular order (i.e. alphabetical) so removing a module is non-intuitive.So, how do I remove a module, or at least get the link size under 256k? The compiler is set to max optimization and remove ''debug'' doesn't seem to help. #stm32f2xx-stm32f4xx-module2012-11-02 11:44 AM
I usually don't use Keil.
But if you are sure that you don't need this functionality, you can replace this function with dummy code. Just comment comment out the function body, and place areturn <x>;
at the begin instead. The value <x> depends on the return value, of course.2012-11-02 11:56 AM
I've done something similar by eliminating the calls contained in the other modules, but I was hoping that someone (ST?) who worked/wrote the demo app would explain the ''right'' way to remove a module. It defeats the purpose of creating modules if they are all depend on each other.
Ideally, I'd like to compile the code with only the module I'm interested in working with such as Ethernet or USB while leaving the other ones disabled.2012-11-02 01:07 PM
Not sure you're going to get any ST software engineering guys here, mostly end users.
Would suggest you look at the size of the .O (object) files, and get a feel for where the bulk of the data is coming from, like bitmaps or something. Running at -O3 tends to help reduce code size, one ELF section per function will allow for better dead code elimination by the linker.