1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00

build: update SConscript.firmware for T1

This commit is contained in:
Pavol Rusnak 2018-09-20 16:37:36 +02:00
parent 72d1c457c2
commit d644147985
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 14 additions and 10 deletions

View File

@ -413,14 +413,22 @@ program_elf = env.Command(
'$LINK -o $TARGET $CCFLAGS $CFLAGS $LINKFLAGS $SOURCES -lc_nano -lm -lgcc',
)
program_bin = env.Command(
target='firmware.bin',
source=program_elf,
action=[
if env.get('TREZOR_MODEL') == 'T':
action_bin=[
'$OBJCOPY -O binary -j .vendorheader -j .header -j .flash -j .data --pad-to 0x08100000 $SOURCE ${TARGET}.p1',
'$OBJCOPY -O binary -j .flash2 $SOURCE ${TARGET}.p2',
'$CAT ${TARGET}.p1 ${TARGET}.p2 > $TARGET',
'$BINCTL $TARGET -h',
'$BINCTL $TARGET -s 1:2 `$KEYCTL sign firmware $TARGET 4747474747474747474747474747474747474747474747474747474747474747 4848484848484848484848484848484848484848484848484848484848484848`' if ARGUMENTS.get('PRODUCTION', '0') == '0' else '',
'$DD if=$TARGET of=${TARGET}.p1 skip=0 bs=128k count=6',
], )
]
else:
action_bin=[
'$OBJCOPY -O binary -j .flash -j .data $SOURCE $TARGET',
]
program_bin = env.Command(
target='firmware.bin',
source=program_elf,
action=action_bin,
)

View File

@ -25,17 +25,13 @@ sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
_ram_start = sram_start;
_ram_end = sram_end;
_codelen = LENGTH(FLASH) - SIZEOF(.header);
_codelen = LENGTH(FLASH);
_flash_start = ORIGIN(FLASH);
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
_heap_start = ADDR(.heap);
_heap_end = ADDR(.heap) + SIZEOF(.heap);
SECTIONS {
.header : ALIGN(4) {
KEEP(*(.header));
} >FLASH AT>FLASH
.flash : ALIGN(512) {
KEEP(*(.vector_table));
. = ALIGN(4);