This commit is contained in:
pvvx 2017-04-09 19:14:49 +03:00
parent 020aedc9bb
commit 52c964be3f
2 changed files with 24 additions and 18 deletions

View file

@ -109,13 +109,13 @@ _endgenbin:
ifeq ($(FLASHER_TYPE), Jlink) ifeq ($(FLASHER_TYPE), Jlink)
reset: reset:
@start $(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_Reset.JLinkScript @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_Reset.JLinkScript
runram: runram:
@start $(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_RunRAM.JLinkScript @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_RunRAM.JLinkScript
readfullflash: readfullflash:
@start $(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_FFlash.JLinkScript @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_FFlash.JLinkScript
flashburn: flashburn:
@ -128,24 +128,26 @@ flashburn:
@echo define call3>>$(FLASHER_PATH)flash_file.jlink @echo define call3>>$(FLASHER_PATH)flash_file.jlink
@echo FlasherWrite build/bin/ram_all.bin '$$'Image2Addr '$$'Image2Size>>$(FLASHER_PATH)flash_file.jlink @echo FlasherWrite build/bin/ram_all.bin '$$'Image2Addr '$$'Image2Size>>$(FLASHER_PATH)flash_file.jlink
@echo end>>$(FLASHER_PATH)flash_file.jlink @echo end>>$(FLASHER_PATH)flash_file.jlink
@start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000 @cmd /K start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000
@$(GDB) -x $(FLASHER_PATH)gdb_wrflash.jlink @$(GDB) -x $(FLASHER_PATH)gdb_wrflash.jlink
@taskkill /F /IM $(JLINK_GDBSRV) #@taskkill /F /IM $(JLINK_GDBSRV)
flashwebfs: flashwebfs:
@echo set '$$'ImageSize = $(shell printf '0x%X\n' $$(stat --printf="%s" $(BIN_DIR)/webpages.espfs))>$(FLASHER_PATH)file_info.jlink @echo define call1>$(FLASHER_PATH)file_info.jlink
@echo set '$$'ImageSize = $(shell printf '0x%X\n' $$(stat --printf="%s" $(BIN_DIR)/webpages.espfs))>>$(FLASHER_PATH)file_info.jlink
@echo set '$$'ImageAddr = 0x0D0000>>$(FLASHER_PATH)file_info.jlink @echo set '$$'ImageAddr = 0x0D0000>>$(FLASHER_PATH)file_info.jlink
@echo define call1>>$(FLASHER_PATH)file_info.jlink @echo end>>$(FLASHER_PATH)file_info.jlink
@echo define call2>>$(FLASHER_PATH)file_info.jlink
@echo FlasherWrite $(BIN_DIR)/webpages.espfs '$$'ImageAddr '$$'ImageSize>>$(FLASHER_PATH)file_info.jlink @echo FlasherWrite $(BIN_DIR)/webpages.espfs '$$'ImageAddr '$$'ImageSize>>$(FLASHER_PATH)file_info.jlink
@echo end>>$(FLASHER_PATH)file_info.jlink @echo end>>$(FLASHER_PATH)file_info.jlink
@start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000 @cmd /K start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000
@$(GDB) -x $(FLASHER_PATH)gdb_wrfile.jlink @$(GDB) -x $(FLASHER_PATH)gdb_wrfile.jlink
@taskkill /F /IM $(JLINK_GDBSRV) #@taskkill /F /IM $(JLINK_GDBSRV)
flash_OTA: flash_OTA:
@start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000 @cmd /K start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000
@$(GDB) -x $(FLASHER_PATH)gdb_ota.jlink @$(GDB) -x $(FLASHER_PATH)gdb_ota.jlink
@taskkill /F /IM $(JLINK_GDBSRV) #@taskkill /F /IM $(JLINK_GDBSRV)
else else
@ -170,10 +172,14 @@ flashwebfs:
reset: reset:
# @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed $(FLASHER_SPEED) flasher/RTLreset.JLinkScript
@$(OPENOCD) -f interface/$(FLASHER).cfg -c "transport select swd" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "adapter_khz $(FLASHER_SPEED)" -c "reset halt" \ @$(OPENOCD) -f interface/$(FLASHER).cfg -c "transport select swd" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "adapter_khz $(FLASHER_SPEED)" -c "reset halt" \
-c "rtl8710_reboot" -c shutdown -c "rtl8710_reboot" -c shutdown
runram: runram:
# @$(JLINK_PATH)$(JLINK_GDB) -device Cortex-M3 -if SWD -ir -endian little -speed $(FLASHER_SPEED)
# @$(GDB) -x flasher/gdb_run_ram.jlink
# @taskkill.exe -F -IM $(JLINK_GDB)
@$(OPENOCD) -f interface/$(FLASHER).cfg -c "transport select swd" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "adapter_khz $(FLASHER_SPEED)" -c "reset halt" \ @$(OPENOCD) -f interface/$(FLASHER).cfg -c "transport select swd" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "adapter_khz $(FLASHER_SPEED)" -c "reset halt" \
-c "load_image $(RAM1R_IMAGE) 0x10000bc8 bin" \ -c "load_image $(RAM1R_IMAGE) 0x10000bc8 bin" \
-c "load_image $(RAM2_IMAGE) 0x10006000 bin" \ -c "load_image $(RAM2_IMAGE) 0x10006000 bin" \

View file

@ -36,12 +36,11 @@ if $rtl8710_flasher_capacity == 0
monitor go monitor go
FlasherWait FlasherWait
set $id = {int}($rtl8710_flasher_buffer + 0x0C) set $id = {int}($rtl8710_flasher_buffer + 0x0C)
if ($id == 0x1420c2)
set $rtl8710_flasher_capacity = 1 << (($id >> 16) & 0x0ff) set $rtl8710_flasher_capacity = 1 << (($id >> 16) & 0x0ff)
if ($id == 0x1420c2)
printf "Flash ID = 0x%08x : MX25L8006E (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10 printf "Flash ID = 0x%08x : MX25L8006E (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10
else else
set $rtl8710_flasher_capacity = 1024*1024) printf "Flash ID = 0x%08x : (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10
error "Flash ID = 0x%08x : ?\n", $id
end end
printf "RTL8710 flasher initialized\n" printf "RTL8710 flasher initialized\n"
else else
@ -142,11 +141,12 @@ SetClk83MHz
SPI_Init SPI_Init
FlasherInit FlasherInit
FlasherLoad flasher/rtl8710_flasher.bin FlasherLoad flasher/rtl8710_flasher.bin
call1
if $ImageSize != 0 if $ImageSize != 0
set $ImageEnd = $ImageSize + $ImageAddr + 0x4000 set $ImageEnd = $ImageSize + $ImageAddr + 0x4000
if $rtl8710_flasher_capacity >= $ImageEnd if $rtl8710_flasher_capacity >= $ImageEnd
printf "Write Image size %d to Flash addr 0x%08x:\n", $ImageSize, $ImageAddr printf "Write Image size %d to Flash addr 0x%08x:\n", $ImageSize, $ImageAddr
call1 call2
else else
printf "Error: Image size is too big!\n" printf "Error: Image size is too big!\n"
end end