waf: add flags for F1 controller support and more debug features

This commit is contained in:
Siddharth Purohit 2018-05-03 13:31:09 +05:30 committed by Andrew Tridgell
parent 4608e90913
commit 6fee72b0c0
2 changed files with 10 additions and 10 deletions

View File

@ -307,6 +307,7 @@ class chibios(Board):
def configure_env(self, cfg, env): def configure_env(self, cfg, env):
super(chibios, self).configure_env(cfg, env) super(chibios, self).configure_env(cfg, env)
cfg.load('chibios')
env.BOARD = self.name env.BOARD = self.name
env.DEFINES.update( env.DEFINES.update(
@ -321,7 +322,6 @@ class chibios(Board):
# make board name available for USB IDs # make board name available for USB IDs
env.CHIBIOS_BOARD_NAME = 'HAL_BOARD_NAME="%s"' % self.name env.CHIBIOS_BOARD_NAME = 'HAL_BOARD_NAME="%s"' % self.name
env.CXXFLAGS += [ env.CXXFLAGS += [
'-Wlogical-op', '-Wlogical-op',
'-Wframe-larger-than=1300', '-Wframe-larger-than=1300',
@ -364,12 +364,13 @@ class chibios(Board):
'-fno-builtin-vprintf', '-fno-builtin-vprintf',
'-fno-builtin-vfprintf', '-fno-builtin-vfprintf',
'-fno-builtin-puts', '-fno-builtin-puts',
'-mcpu=cortex-m4',
'-mno-thumb-interwork', '-mno-thumb-interwork',
'-mthumb', '-mthumb',
'-mfpu=fpv4-sp-d16', '-mfpu=fpv4-sp-d16',
'-mfloat-abi=hard', '-mfloat-abi=hard',
'-DCHIBIOS_BOARD_NAME="%s"' % self.name, '-DCHIBIOS_BOARD_NAME="%s"' % self.name,
'--specs=nano.specs',
'-specs=nosys.specs'
] ]
if sys.platform == 'cygwin': if sys.platform == 'cygwin':
@ -377,9 +378,7 @@ class chibios(Board):
bldnode = cfg.bldnode.make_node(self.name) bldnode = cfg.bldnode.make_node(self.name)
env.BUILDROOT = bldnode.make_node('').abspath() env.BUILDROOT = bldnode.make_node('').abspath()
env.LINKFLAGS = [ env.LINKFLAGS = [
'-mcpu=cortex-m4',
'-Os', '-Os',
'-fomit-frame-pointer', '-fomit-frame-pointer',
'-falign-functions=16', '-falign-functions=16',
@ -395,22 +394,23 @@ class chibios(Board):
'-u_printf_float', '-u_printf_float',
'-fno-common', '-fno-common',
'-nostartfiles', '-nostartfiles',
'-mfloat-abi=hard',
'-mfpu=fpv4-sp-d16',
'-mno-thumb-interwork', '-mno-thumb-interwork',
'-mthumb', '-mthumb',
'-specs=nano.specs',
'-specs=nosys.specs',
'-L%s' % env.BUILDROOT, '-L%s' % env.BUILDROOT,
'-L%s' % cfg.srcnode.make_node('modules/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld/').abspath(), '-L%s' % cfg.srcnode.make_node('modules/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld/').abspath(),
'-L%s' % cfg.srcnode.make_node('libraries/AP_HAL_ChibiOS/hwdef/common/').abspath(), '-L%s' % cfg.srcnode.make_node('libraries/AP_HAL_ChibiOS/hwdef/common/').abspath(),
'-Wl,--gc-sections,--no-warn-mismatch,--library-path=/ld,--script=ldscript.ld,--defsym=__process_stack_size__=0x400,--defsym=__main_stack_size__=0x400',
] ]
if cfg.env.DEBUG: if cfg.env.DEBUG:
env.CFLAGS += [ env.CFLAGS += [
'-g', '-gdwarf-4',
'-g3',
] ]
env.LINKFLAGS += [ env.LINKFLAGS += [
'-g', '-gdwarf-4',
'-g3',
] ]
if cfg.env.ENABLE_ASSERTS: if cfg.env.ENABLE_ASSERTS:

View File

@ -337,4 +337,4 @@ def build(bld):
bld.env.LIBPATH += ['modules/ChibiOS/'] bld.env.LIBPATH += ['modules/ChibiOS/']
wraplist = ['strerror_r', 'fclose', 'freopen', 'fread'] wraplist = ['strerror_r', 'fclose', 'freopen', 'fread']
for w in wraplist: for w in wraplist:
bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w] bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w]