1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-20 17:19:01 +00:00
This commit is contained in:
Ondrej Mikle 2025-04-19 14:30:12 +07:00 committed by GitHub
commit e0232054a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 34 additions and 2 deletions

View File

@ -1,4 +1,3 @@
.PHONY: vendor
# get the number of CPU cores in a "portable" manner
@ -405,12 +404,20 @@ flash_bootloader_ci_jlink: $(BOOTLOADER_CI_BUILD_DIR)/bootloader.bin ## flash CI
JLinkExe -nogui 1 -commanderscript embed/projects/bootloader_ci/bootloader_flash.jlink
flash_firmware_jlink: $(FIRMWARE_BUILD_DIR)/firmware.bin ## flash firmware using JLink. file names must end in .bin for JLink
ifeq ($(MCU),$(filter $(MCU),STM32F4))
cp -f $<.p1 $<.p1.bin
cp -f $<.p2 $<.p2.bin
## pad 2nd part so that FW integrity works after flash
## read&compare in flashing will avoid erasing unmodified sectors
truncate -s $(FIRMWARE_P2_MAXSIZE) $<.p2.bin
JLinkExe -nogui 1 -commanderscript embed/projects/firmware/firmware_flash.jlink
JLinkExe -nogui 1 -commanderscript embed/models/T2T1/firmware_flash.jlink
else
# unfortunately JLink commander cannot be parameterized without buying SDK and rebuilding with changes
cp -f $< $<.padded.bin
echo firmware size is $(FIRMWARE_MAXSIZE)
dd if=/dev/zero bs=1 count=$$(($(FIRMWARE_MAXSIZE) - $$(stat -c %s $<))) | tr '\000' '\377' >> $<.padded.bin
JLinkExe -nogui 1 -commanderscript embed/models/T3W1/firmware_flash.jlink
endif
## openocd debug commands:

View File

@ -0,0 +1,8 @@
device stm32f427vi
if swd
speed 50000
loadbin build/firmware/firmware.bin.p1.bin 0x08040000
loadbin build/firmware/firmware.bin.p2.bin 0x08120000
r
g
exit

View File

@ -0,0 +1,7 @@
device STM32U5G9ZJ
if swd
speed 20000
loadbin build/firmware/firmware.bin.padded.bin 0x0C044000
r
g
exit

View File

@ -15,3 +15,13 @@ CONFIG_LOG_BACKEND_RTT=y
CONFIG_ASSERT=y
# Thread monitor and debug moninot exception to be able to debug BLE when running
# Applies only to application, not mcuboot.
# VTOR is currently at 0xC200 (mcuboot size + mcuboot_pad size)
CONFIG_THREAD_NAME=y
CONFIG_THREAD_MONITOR=y
CONFIG_CORTEX_M_DEBUG_MONITOR_HOOK=y
CONFIG_SEGGER_DEBUGMON=y