1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 20:38:10 +00:00

build(core): skip bootloader and boardloader compilation for Model 1

This commit is contained in:
tychovrahe 2022-05-07 09:19:29 +02:00 committed by matejcik
parent 8a092bde21
commit 55bfab3976
3 changed files with 37 additions and 13 deletions

View File

@ -4,6 +4,18 @@ import os
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T') TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
if TREZOR_MODEL in ('1', ):
# skip boardloader build
env = Environment()
def build_boardloader(target,source,env):
print(f'Boardloader: nothing to build for Model {TREZOR_MODEL}')
program_bin = env.Command(
target='boardloader.bin',
source=None,
action=build_boardloader
)
Return()
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []
CPPDEFINES_MOD = [] CPPDEFINES_MOD = []
@ -101,10 +113,6 @@ if TREZOR_MODEL in ('T', 'R'):
CPU_ASFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16' CPU_ASFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16'
CPU_CCFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 ' CPU_CCFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 '
CPU_MODEL = 'STM32F427xx' CPU_MODEL = 'STM32F427xx'
elif TREZOR_MODEL in ('1',):
CPU_ASFLAGS = '-mthumb -mcpu=cortex-m3 -mfloat-abi=soft'
CPU_CCFLAGS = '-mthumb -mtune=cortex-m3 -mcpu=cortex-m3 -mfloat-abi=soft '
CPU_MODEL = 'STM32F405xx'
else: else:
raise ValueError('Unknown Trezor model') raise ValueError('Unknown Trezor model')

View File

@ -4,6 +4,18 @@ import os
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T') TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
if TREZOR_MODEL in ('1', ):
# skip bootloader build
env = Environment()
def build_bootloader(target,source,env):
print(f'Bootloader: nothing to build for Model {TREZOR_MODEL}')
program_bin = env.Command(
target='bootloader.bin',
source=None,
action=build_bootloader
)
Return()
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []
CPPDEFINES_MOD = [] CPPDEFINES_MOD = []
@ -111,7 +123,7 @@ SOURCE_TREZORHAL = [
'embed/trezorhal/vectortable.s', 'embed/trezorhal/vectortable.s',
] ]
if TREZOR_MODEL in ('1', 'R'): if TREZOR_MODEL in ('R'):
SOURCE_TREZORHAL.append('embed/trezorhal/button.c') SOURCE_TREZORHAL.append('embed/trezorhal/button.c')
if TREZOR_MODEL in ('T',): if TREZOR_MODEL in ('T',):
SOURCE_TREZORHAL.append('embed/trezorhal/touch.c') SOURCE_TREZORHAL.append('embed/trezorhal/touch.c')
@ -135,10 +147,6 @@ if TREZOR_MODEL in ('T', 'R'):
CPU_ASFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16' CPU_ASFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16'
CPU_CCFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 ' CPU_CCFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 '
CPU_MODEL = 'STM32F427xx' CPU_MODEL = 'STM32F427xx'
elif TREZOR_MODEL in ('1',):
CPU_ASFLAGS = '-mthumb -mcpu=cortex-m3 -mfloat-abi=soft'
CPU_CCFLAGS = '-mthumb -mtune=cortex-m3 -mcpu=cortex-m3 -mfloat-abi=soft '
CPU_MODEL = 'STM32F405xx'
else: else:
raise ValueError('Unknown Trezor model') raise ValueError('Unknown Trezor model')

View File

@ -4,6 +4,18 @@ import os
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T') TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
if TREZOR_MODEL in ('1', ):
# skip bootloader_ci build
env = Environment()
def build_bootloader_ci(target,source,env):
print(f'Bootloader_ci: nothing to build for Model {TREZOR_MODEL}')
program_bin = env.Command(
target='bootloader_ci.bin',
source=None,
action=build_bootloader_ci
)
Return()
CCFLAGS_MOD = '' CCFLAGS_MOD = ''
CPPPATH_MOD = [] CPPPATH_MOD = []
CPPDEFINES_MOD = [] CPPDEFINES_MOD = []
@ -127,10 +139,6 @@ if TREZOR_MODEL in ('T', 'R'):
CPU_ASFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16' CPU_ASFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16'
CPU_CCFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 ' CPU_CCFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 '
CPU_MODEL = 'STM32F427xx' CPU_MODEL = 'STM32F427xx'
elif TREZOR_MODEL in ('1',):
CPU_ASFLAGS = '-mthumb -mcpu=cortex-m3 -mfloat-abi=soft'
CPU_CCFLAGS = '-mthumb -mtune=cortex-m3 -mcpu=cortex-m3 -mfloat-abi=soft '
CPU_MODEL = 'STM32F405xx'
else: else:
raise ValueError('Unknown Trezor model') raise ValueError('Unknown Trezor model')