The LPC11U35 QuickStart Board from Embedded Artists is a easy to use ARM Cortex-M0 rapid prototyping board in a breadboard-friendly 30-pin DIL format. The board targets smaller control applications as …

Binary size suddenly larger

24 Jan 2014

I've been happily using this target for a while now, but all of a sudden my binary size has gotten huge! At first I thought it was something that I'd done, but I just did an experiment and the binary size has definitely gotten bigger. First, I created a new project with the following code:

#include "mbed.h"

char ramData[4096];

int main()
{
    ramData[0] = 0xFF;

    while(1);
}


Then I compiled it for both the LPC11U24 and the EA LPC11U35 QuickStart board. The LPC11U24 build produced a 932B file, whereas the LPC11U35 build produced a whopping 2096B file! That's 225% larger! I tried one of my another projects, and the LPC11U24 version came it at 14384B whereas the LPC11U35 version was 18532B, 129% larger! Has the toolchain for the LPC11U35 been changed? That extra 32KB of flash isn't going to do any good if the binaries are this much larger.

12 Feb 2014

I just performed a few experiments of my own using this code to reveal which toolchain was being used:

#include "mbed.h"

#if TOOLCHAIN_ARM
#warning ARM toolchain! Yay!
#elif TOOLCHAIN_GCC
#warning GCC toolchain! Boo!
#endif

#if TOOLCHAIN_ARM_MICRO
#warning ARM Micro Toolchain! Yay!
#elif TOOLCHAIN_ARM_STD
#warning ARM Standard Toolchain! Yay?
#elif TOOLCHAIN_GCC_ARM
#warning GCC ARM Toolchain! Boo!
#elif TOOLCHAIN_GCC_CR
#warning GCC CR Toolchain! No way!!!
#elif TOOLCHAIN_GCC_CS
#warning GCC CS Toolchain! Stop the madness!!!!!!
#endif

DigitalOut myled(LED1);

int main()
{
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}


You guessed it, ARM Standard! That would definitely explain why the binary size suddenly increased, the toolchain must have accidentally been changed somewhere. Now my next question is how does one go about changing it back to ARM Micro? I stumbled upon the SDK porting page which led me to take a look at targets.py. The classes for the LPC11U24 and LPC11U35_401 are almost exactly the same, except for one flag, ONLINE_TOOLCHAIN:

class LPC11U24(Target):
    ONLINE_TOOLCHAIN = "uARM"

    def __init__(self):
        Target.__init__(self)
        
        self.core = "Cortex-M0"
        
        self.extra_labels = ['NXP', 'LPC11UXX', 'LPC11U24_401']
        
        self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]

class LPC11U35_401(Target):
    def __init__(self):
        Target.__init__(self)
        
        self.core = "Cortex-M0"
        
        self.extra_labels = ['NXP', 'LPC11UXX']
        
        self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]


However, ONLINE_TOOLCHAIN was only added a few hours ago, so where else is the toolchain selected? I'm going to try submitting a pull request anyway, on the off chance that this is all there is to it.

18 Feb 2014

Looks like my pull request fixed it! Either that, or someone else fixed it independently from me... Either way, the toolchain is back to ARM Micro, and the binary size is back to normal!

16 Sep 2016

If it is using ARM Micro, will there be any problem using SDcard library with this microcontroller.?