diff --git a/Makefile.app_params b/Makefile.app_params index c11c18ebc..a01ca4eb5 100644 --- a/Makefile.app_params +++ b/Makefile.app_params @@ -109,15 +109,15 @@ endif APP_LOAD_PARAMS = --targetId $(TARGET_ID) APP_LOAD_PARAMS += --targetVersion="$(TARGET_VERSION)" APP_LOAD_PARAMS += --apiLevel $(API_LEVEL) -APP_LOAD_PARAMS += --fileName bin/app.hex +APP_LOAD_PARAMS += --fileName $(BIN_DIR)/app.hex APP_LOAD_PARAMS += --appName $(APPNAME) ifneq ($(APP_FLAGS_APP_LOAD_PARAMS),) APP_LOAD_PARAMS += --appFlags $(lastword $(APP_FLAGS_APP_LOAD_PARAMS)) endif APP_LOAD_PARAMS += --delete APP_LOAD_PARAMS += --tlv -APP_LOAD_PARAMS += --dataSize $$((0x`cat debug/app.map | grep _envram_data | tr -s ' ' | cut -f2 -d' ' |cut -f2 -d'x' ` - 0x`cat debug/app.map | grep _nvram_data | tr -s ' ' | cut -f2 -d' ' | cut -f2 -d'x'`)) -APP_LOAD_PARAMS += --installparamsSize $$((0x`cat debug/app.map | grep _einstall_parameters | tr -s ' ' | cut -f2 -d' ' |cut -f2 -d'x'` - 0x`cat debug/app.map | grep _install_parameters | tr -s ' ' | cut -f2 -d' ' |cut -f2 -d'x'`)) +APP_LOAD_PARAMS += --dataSize $$((0x`cat $(DBG_DIR)/app.map | grep _envram_data | tr -s ' ' | cut -f2 -d' ' |cut -f2 -d'x' ` - 0x`cat $(DBG_DIR)/app.map | grep _nvram_data | tr -s ' ' | cut -f2 -d' ' | cut -f2 -d'x'`)) +APP_LOAD_PARAMS += --installparamsSize $$((0x`cat $(DBG_DIR)/app.map | grep _einstall_parameters | tr -s ' ' | cut -f2 -d' ' |cut -f2 -d'x'` - 0x`cat $(DBG_DIR)/app.map | grep _install_parameters | tr -s ' ' | cut -f2 -d' ' |cut -f2 -d'x'`)) ifeq ($(ENABLE_NOCRC_APP_LOAD_PARAMS), 1) APP_LOAD_PARAMS += --nocrc diff --git a/Makefile.rules_generic b/Makefile.rules_generic index f97f9a8eb..f6245f26b 100644 --- a/Makefile.rules_generic +++ b/Makefile.rules_generic @@ -59,7 +59,7 @@ listinfo: @echo SDK_HASH=$(SDK_HASH) clean: - rm -fr $(BUILD_DIR) bin debug + rm -fr $(BUILD_DIR) clean_target: rm -fr $(TARGET_BUILD_DIR) $(TARGET_SCAN_DIR) @@ -69,7 +69,7 @@ BUILD_DEPENDENCIES += $(APP_CUSTOM_BUILD_DEPENDENCIES) prepare: $(L)echo Prepare directories - @mkdir -p $(BIN_DIR) $(OBJ_DIR) $(OBJECTS_DIR) $(DBG_DIR) $(DEP_DIR) $(DEPEND_DIR) $(GEN_SRC_DIR) bin debug + @mkdir -p $(BIN_DIR) $(OBJ_DIR) $(OBJECTS_DIR) $(DBG_DIR) $(DEP_DIR) $(DEPEND_DIR) $(GEN_SRC_DIR) $(BUILD_DEPENDENCIES): prepare @@ -80,10 +80,9 @@ $(APP_USE_CASES): @$(MAKE) --no-print-directory $(call get_flags_for_use_case,$@) endif -BIN_TARGETS := bin/app.elf bin/app.apdu bin/app.sha256 bin/app.hex -DBG_TARGETS := debug/app.map debug/app.asm +BIN_TARGETS := $(BIN_DIR)/app.apdu -default: $(BIN_TARGETS) $(DBG_TARGETS) +default: $(BIN_TARGETS) # Glyphs target $(GEN_SRC_DIR)/%.o: $(GEN_SRC_DIR)/%.c $(BUILD_DEPENDENCIES) prepare @@ -158,31 +157,9 @@ $(BIN_DIR)/app.elf: $(LINK_DEPENDENCIES) $(L)$(GCCPATH)arm-none-eabi-objcopy -O ihex -S $(BIN_DIR)/app.elf $(BIN_DIR)/app.hex $(L)$(GCCPATH)arm-none-eabi-objdump -S -d $(BIN_DIR)/app.elf > $(DBG_DIR)/app.asm -# This targets are generated along $(OBJ_DIR)/app.elf but we can't make them co-target -# otherwise building with `make -j` fails due to multiple threads running simultaneously -# this target while it needs to be run only once. -$(BIN_DIR)/app.hex $(DBG_DIR)/app.map $(DBG_DIR)/app.asm: $(BIN_DIR)/app.elf - -$(BIN_DIR)/app.apdu: bin/app.hex debug/app.map +$(BIN_DIR)/app.apdu: $(BIN_DIR)/app.elf $(L)python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS) --offline $(BIN_DIR)/app.apdu | grep "Application" | cut -f5 -d' ' > $(BIN_DIR)/app.sha256 -# This target is generated along $(BIN_DIR)/app.apdu but we can't make them co-target -# otherwise building with `make -j` ends up with multiple threads running simultaneously -# this target while it needs to be run only once. -$(BIN_DIR)/app.sha256: $(BIN_DIR)/app.apdu - -# Set PHONY to force the copy to bin in case we rebuild a previous TARGET -.PHONY: bin/app.elf bin/app.hex bin/app.apdu bin/app.sha256 -bin/app.elf bin/app.hex bin/app.apdu bin/app.sha256: bin/app.%: $(BIN_DIR)/app.% - @echo "[CP] $< => $@" - $(L)cp $< $@ - -# Set PHONY to force the copy to debug in case we rebuild a previous TARGET -.PHONY: debug/app.map debug/app.asm -debug/app.map debug/app.asm: debug/app.%: $(DBG_DIR)/app.% - @echo "[CP] $< => $@" - $(L)cp $< $@ - ### BEGIN GCC COMPILER RULES # link_cmdline(objects,dest) Macro that is used to format arguments for the linker diff --git a/include/ledger_assert.h b/include/ledger_assert.h index c3b714a64..1189b3ce6 100644 --- a/include/ledger_assert.h +++ b/include/ledger_assert.h @@ -47,7 +47,7 @@ * * 2/ An info containing the PC and LR of the instruction that failed. * This can be used to locate the failing code and flow using the following - * command: `arm-none-eabi-addr2line --exe bin/app.elf -pf 0xC0DE586B` + * command: `arm-none-eabi-addr2line --exe build//bin/app.elf -pf 0xC0DE586B` * => This is enabled when `LEDGER_ASSERT_CONFIG_LR_AND_PC_INFO` is defined. * * 3/ An info displaying the `LEDGER_ASSERT` message passed as parameter.