Add space optimization flags
@@ -266,6 +266,8 @@ elif env['toolchain'] == 'armgcc':
env.Append(CCFLAGS='-Wall')
env.Append(CCFLAGS='-Wa,-adhlns=${TARGET.base}.lst')
env.Append(CCFLAGS='-c')
+ env.Append(CCFLAGS='-ffunction-sections')
+ env.Append(CCFLAGS='-fdata-sections')
env.Append(CCFLAGS='-fmessage-length=0')
env.Append(CCFLAGS='-mcpu=cortex-m3')
env.Append(CCFLAGS='-mthumb')
@@ -286,6 +288,7 @@ elif env['toolchain'] == 'armgcc':
env.Append(LINKFLAGS='-specs=nosys.specs')
env.Append(LINKFLAGS='-specs=nano.specs')
env.Append(LINKFLAGS='-Wl,-Map,${TARGET.base}.map')
+ env.Append(LINKFLAGS='-Wl,--gc-sections')
env.Append(LINKFLAGS='-mcpu=cortex-m3')
env.Append(LINKFLAGS='-mthumb')
env.Append(LINKFLAGS='-g3')
