From a47f9b574d68a8a03a30889d57e2f5ff97c83af3 Mon Sep 17 00:00:00 2001 From: pvvx Date: Sun, 25 Sep 2016 10:46:13 +0300 Subject: [PATCH] update --- Makefile | 2 +- .../common/GCC/rlx8195A-symbol-v02-img2.ld | 4 +++ flasher.mk | 31 ++++++++++++------- flasher/gdb_rdflash.jlink | 4 +-- flasher/gdb_run_ram.jlink | 1 + 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index a0f3097..dc3f1f2 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: ram_all .PHONY: ram_all ram_all: @$(MAKE) -f sdkbuild.mk - @$(MAKE) -f flasher.mk genbin23 + @$(MAKE) -f flasher.mk genbin1 genbin23 .PHONY: clean clean_all clean: diff --git a/component/soc/realtek/8195a/misc/bsp/lib/common/GCC/rlx8195A-symbol-v02-img2.ld b/component/soc/realtek/8195a/misc/bsp/lib/common/GCC/rlx8195A-symbol-v02-img2.ld index d64242e..adf29eb 100644 --- a/component/soc/realtek/8195a/misc/bsp/lib/common/GCC/rlx8195A-symbol-v02-img2.ld +++ b/component/soc/realtek/8195a/misc/bsp/lib/common/GCC/rlx8195A-symbol-v02-img2.ld @@ -234,6 +234,10 @@ SECTIONS /* Check if data + heap + stack exceeds RAM limit */ ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") + .boot.head : + { + KEEP(*(.loader.head*)) + } } diff --git a/flasher.mk b/flasher.mk index 649f93f..09f4d21 100644 --- a/flasher.mk +++ b/flasher.mk @@ -55,8 +55,10 @@ FLASHER_SPEED = 500 endif endif -#COMPILED_BOOT = 1 # if defined -> extract image1, =1 boot head in elf, =2 boot head ? -PADDINGSIZE = 44k # defined -> image2 OTA +# COMPILED_BOOT if defined -> extract image1, =1 boot head in elf, =2 boot head ? +#COMPILED_BOOT=1 +# PADDINGSIZE defined -> image2 OTA +PADDINGSIZE =44k NMAPFILE = $(OBJ_DIR)/$(TARGET).nmap @@ -163,28 +165,33 @@ $(OTA_IMAGE): $(RAM2NS_IMAGE) $(RAM3_IMAGE) $(RAM1P_IMAGE): $(ELFFILE) $(NMAPFILE) @echo "===========================================================" @echo "Create image1p (ram_1.p.bin)" -# @echo "===========================================================" +# @echo "===========================================================" .bootloader ifdef COMPILED_BOOT @mkdir -p $(BIN_DIR) @rm -f $(RAM1_IMAGE) $(RAM1P_IMAGE) - @$(eval RAM1_START_ADDR := $(shell grep __ram_image1_text $(NMAPFILE) | grep _start__ | awk '{print $$1}')) - @$(eval RAM1_END_ADDR := $(shell grep __ram_image1_text $(NMAPFILE) | grep _end__ | awk '{print $$1}')) +ifeq ($(COMPILED_BOOT),1) + @$(eval RAM1_START_ADDR := $(shell grep _binary_build_bin_ram_1_r_bin_start $(NMAPFILE) | awk '{print $$1}')) + @$(eval RAM1_END_ADDR := $(shell grep _binary_build_bin_ram_1_r_bin_end $(NMAPFILE) | awk '{print $$1}')) +else + @$(eval RAM1_START_ADDR := $(shell grep __ram_image1_text_start__ $(NMAPFILE) | awk '{print $$1}')) + @$(eval RAM1_END_ADDR := $(shell grep __ram_image1_text_end__ $(NMAPFILE) | awk '{print $$1}')) +endif $(if $(RAM1_START_ADDR),,$(error "Not found __ram_image1_text_start__!")) $(if $(RAM1_END_ADDR),,$(error "Not found __ram_image1_text_end__!")) -ifneq ($(RAM1_START_ADDR),$(RAM1_END_ADDR)) -ifeq ($(COMPILED_BOOT),2) +ifeq ($(RAM1_START_ADDR),$(RAM1_END_ADDR)) +ifneq ($(COMPILED_BOOT),1) $(OBJCOPY) -j .ram.start.table -j .ram_image1.text -Obinary $(ELFFILE) $(RAM1_IMAGE) $(PICK) 0x$(RAM1_START_ADDR) 0x$(RAM1_END_ADDR) $(RAM1_IMAGE) $(RAM1P_IMAGE) body+reset_offset else - @$(OBJCOPY) --change-section-address .boot.head=0x10000ba8 -j .boot.head -j .ram.start.table -j .ram_image1.text -Obinary $(ELFFILE) $(RAM1P_IMAGE) + $(OBJCOPY) --change-section-address .boot.head=0x10000ba8 -j .boot.head -j .bootloader -Obinary $(ELFFILE) $(RAM1P_IMAGE) endif -else - @$(error "BOOT-image size = 0") -endif $(warning "Flasher: Use external $(RAM1_IMAGE)?") +else + $(error "BOOT-image size = 0") # $(error Flasher: COMPILE_BOOT = No) +endif else - @if [ -s $(RAM1P_IMAGE) ]; then echo "Use external $(RAM1P_IMAGE)"; fi + @if [ -s $(RAM1P_IMAGE) ]; then echo "Use external $(RAM1P_IMAGE)!"; fi endif $(RAM2P_IMAGE): $(ELFFILE) $(NMAPFILE) diff --git a/flasher/gdb_rdflash.jlink b/flasher/gdb_rdflash.jlink index 9016cf7..d778b01 100644 --- a/flasher/gdb_rdflash.jlink +++ b/flasher/gdb_rdflash.jlink @@ -94,9 +94,9 @@ p /x $dumpendaddr dump binary memory ./build/bin/fullflash.bin $dumpstartaddr $dumpendaddr printf "FullFlash saved in ./build/bin/fullflash.bin - OK.\n" #------------------------------------------------------------------ -# Reset -monitor reset # Boot Flash monitor long 0x40000210 = 0x211157 +# Reset +monitor reset monitor go quit diff --git a/flasher/gdb_run_ram.jlink b/flasher/gdb_run_ram.jlink index 296e42b..115460c 100644 --- a/flasher/gdb_run_ram.jlink +++ b/flasher/gdb_run_ram.jlink @@ -23,6 +23,7 @@ monitor long 0x40000210 = 0x8011157 # Load the program executable called "image.elf" load build/obj/build.axf #continue +monitor reset monitor go quit