update cmsis-dap

This commit is contained in:
pvvx 2017-07-29 22:11:18 +03:00
parent 9292f63c37
commit 09a4286889
12 changed files with 85 additions and 50 deletions

View file

@ -667,11 +667,11 @@
<runAllBuilders>false</runAllBuilders>
</target>
<target name="reset" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-s</buildArguments>
<buildCommand>mingw32-make.exe</buildCommand>
<buildArguments/>
<buildTarget>reset</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="test" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">

7
DAPLink-RTL00Console.bat Normal file
View file

@ -0,0 +1,7 @@
@echo off
call paths.bat
cd flasher
openocd -f interface/cmsis-dap.cfg -c "adapter_khz 1000" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "load_ram_binary RTL00Console_ROM.bin 0x10000BA8" -c "exit"
rem -c "shutdown"

7
DAPLink-RdFullFlash.bat Normal file
View file

@ -0,0 +1,7 @@
@echo off
call paths.bat
cd flasher
openocd -f interface/cmsis-dap.cfg -c "adapter_khz 1000" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "adapter_khz 1000" -c "rtl8710_flash_read ../fullflash.bin 0 2097152" -c "shutdown"
echo flash read fullflash.bin
pause

6
DAPLink-Reset.bat Normal file
View file

@ -0,0 +1,6 @@
@echo off
call paths.bat
@cd flasher
openocd -f interface/cmsis-dap.cfg -c "adapter_khz 1000" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "restart_from_falsh" -c "shutdown"
rem

6
DAPLink_WrFullFlash.bat Normal file
View file

@ -0,0 +1,6 @@
@echo off
call paths.bat
cd flasher
openocd -f interface/cmsis-dap.cfg -c "adapter_khz 3500" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "rtl8710_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" -c "rtl8710_flash_write fullflash.bin 0" -c "shutdown"
pause

View file

@ -6,12 +6,15 @@
<script type="text/javascript" src="dygraph.min.js"></script>
</head>
<body>
<h3 style="width:800px; text-align: center;">Read ADC RTL8711AM</h3>
<h3 style="width:800px; text-align: center;">Read ADC RTL8711AM/RTL8195AM</h3>
<div id="div_g" style="width:800px; height:400px;"></div>
<script type="text/javascript">
var data = [];
var g = new Dygraph(document.getElementById("div_g"), data,
{ drawPoints: true, showRoller: true, labels: ['X', 'U']});
{ drawPoints: true,
showRangeSelector: true,
showRoller: true, labels: ['X', 'U']});
var oldblkid = 0;
var rdnextflg = false;
var cur_idx = 0;
@ -30,13 +33,13 @@ ws.onmessage = function (event) {
} else rdnextflg = true;
oldblkid = blkid + blksz;
for (var i = 2; i < wordarray.length; i++) {
if(cur_idx > 1000 ) data.shift();
if(cur_idx > 10000 ) data.shift();
data.push([cur_idx++, wordarray[i]]);
}
g.updateOptions({'file':data});
}
}
ws.send("adc");
if(cur_idx < 10000 ) ws.send("adc");
}
}
</script>

View file

@ -38,21 +38,21 @@ PADDING = $(TOOLS_PATH)padding$(EXE)
CHCKSUM = $(TOOLS_PATH)checksum$(EXE)
# openocd tools
OPENOCD = $(OPENOCD_PATH)openocd
OPENOCD = $(OPENOCD_PATH)openocd.exe
JLINK_GDB ?= JLinkGDBServer.exe
JLINK_EXE ?= JLink.exe
ifeq ($(FLASHER), Jlink)
# Jlink FLASHER_SPEED ..4000 kHz
FLASHER_SPEED = 3500
FLASHER_SPEED ?= 3500
else
ifeq ($(FLASHER),stlink-v2)
# stlink-v2 FLASHER_SPEED ..1800 kHz
FLASHER_SPEED = 1800
FLASHER_SPEED ?= 1800
else
# over FLASHER_SPEED ..500 kHz ?
FLASHER_SPEED = 500
# over FLASHER_SPEED ..1000 kHz ?
FLASHER_SPEED ?= 1000
endif
endif
@ -164,48 +164,53 @@ flash_OTA:
#@taskkill /F /IM $(JLINK_GDBSRV)
else
ifeq ($(FLASHER_TYPE),cmsis-dap)
FLASHER:=cmsis-dap
flashburn:
@$(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_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" \
-c "rtl8710_flash_write $(RAM1P_IMAGE) 0" \
-c "rtl8710_flash_write $(RAM2P_IMAGE) 0xb000" \
-c "rtl8710_reboot" -c "reset run" -c shutdown
@$(OPENOCD) -f interface/$(FLASHER).cfg -c 'transport select swd' -c 'adapter_khz 1000' \
-f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \
-c 'rtl8710_flash_auto_erase 1' -c 'rtl8710_flash_auto_verify 1' \
-c 'rtl8710_flash_write $(RAM1P_IMAGE) 0' \
-c 'rtl8710_flash_write $(RAM2P_IMAGE) 0xb000' \
-c 'rtl8710_reboot' -c 'reset run' -c shutdown
flashimage2p:
@$(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_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" \
-c "rtl8710_flash_write $(RAM2P_IMAGE) 0xb000" \
-c "rtl8710_reboot" -c "reset run" -c shutdown
@$(OPENOCD) -f interface/$(FLASHER).cfg -c 'transport select swd' -c 'adapter_khz 1000' \
-f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \
-c 'rtl8710_flash_auto_erase 1' -c 'rtl8710_flash_auto_verify 1' \
-c 'rtl8710_flash_write $(RAM2P_IMAGE) 0xb000' \
-c 'rtl8710_reboot' -c 'reset run' -c shutdown
flashwebfs:
@$(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_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" \
-c "rtl8710_flash_write $(BIN_DIR)/WEBFiles.bin 0xd0000" \
-c "rtl8710_reboot" -c "reset run" -c shutdown
@$(OPENOCD) -f interface/$(FLASHER).cfg -c 'transport select swd' -c 'adapter_khz 1000' \
-f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \
-c 'rtl8710_flash_auto_erase 1' -c 'rtl8710_flash_auto_verify 1' \
-c 'rtl8710_flash_write $(BIN_DIR)/WEBFiles.bin 0xd0000' \
-c 'rtl8710_reboot' -c 'reset run' -c shutdown
flashespfs:
@$(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_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" \
-c "rtl8710_flash_write $(BIN_DIR)/webpages.espfs 0xd0000" \
-c "rtl8710_reboot" -c "reset run" -c shutdown
@$(OPENOCD) -f interface/$(FLASHER).cfg -c 'transport select swd' -c 'adapter_khz 1000' \
-f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \
-c 'rtl8710_flash_auto_erase 1' -c 'rtl8710_flash_auto_verify 1' \
-c 'rtl8710_flash_write $(BIN_DIR)/webpages.espfs 0xd0000' \
-c 'rtl8710_reboot' -c 'reset run' -c shutdown
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" \
-c "rtl8710_reboot" -c shutdown
@$(OPENOCD) -f interface/$(FLASHER).cfg -c 'transport select swd' -c 'adapter_khz 1000' \
-f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \
-c 'mww 0x40000210 0x111157' -c 'rtl8710_reboot' -c shutdown
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" \
-c "load_image $(RAM1R_IMAGE) 0x10000bc8 bin" \
-c "load_image $(RAM2_IMAGE) 0x10006000 bin" \
-c "mww 0x40000210 0x20200113" \
-c "reset run" -c shutdown
@$(OPENOCD) -f interface/$(FLASHER).cfg -c 'transport select swd' -c 'adapter_khz 1000' \
-f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \
-c 'load_image $(RAM1R_IMAGE) 0x10000bc8 bin' \
-c 'load_image $(RAM2_IMAGE) 0x10006000 bin' \
-c 'mww 0x40000210 0x20200113' \
-c 'reset run' -c shutdown
endif
endif
$(NMAPFILE): $(ELFFILE)
@echo "==========================================================="

View file

@ -3,7 +3,7 @@
#---------------------------
SDK_PATH ?= ../SDKRTLA/USDK/
#GCC_PATH = d:/MCU/GNU_Tools_ARM_Embedded/6.2017-q1-update/bin/# + or set in PATH
#OPENOCD_PATH = d:/MCU/OpenOCD/bin/# + or set in PATH
OPENOCD_PATH = d:/MCU/OpenOCD/bin/
TOOLS_PATH ?= $(SDK_PATH)component/soc/realtek/8195a/misc/iar_utility/common/tools/
FLASHER_TYPE ?= Jlink
#FLASHER_TYPE ?= OCD

View file

@ -1 +1 @@
PATH=D:\MCU\GNU_Tools_ARM_Embedded\6.2017-q1-update\bin;D:\MCU\SEGGER\JLink_V612i;%PATH%
PATH=D:\MCU\GNU_Tools_ARM_Embedded\6.2017-q1-update\bin;D:\MCU\SEGGER\JLink_V612i;D:\MCU\OpenOCD\bin;%PATH%

View file

@ -2,8 +2,8 @@
# SDK CONFIG
#=============================================
#WEB_INA219_DRV = 1
#WEB_ADC_DRV = 1
USE_SDCARD = 1
WEB_ADC_DRV = 1
#USE_SDCARD = 1
#USE_AT = 1
#USE_FATFS = 1
#USE_SDIOH = 1

View file

@ -4,7 +4,7 @@
#define AUTOCONF_INCLUDED
#define RTL8710AF
//#define RTL8711AM
#define RTL8711AM
/* Image1 on project */
#define PRESENT_IMAGE1
/* Image2 on project */
@ -31,7 +31,7 @@
#define RTL8195A 1
/* 0 - 166666666 Hz, 1 - 83333333 Hz, 2 - 41666666 Hz, 3 - 20833333 Hz, 4 - 10416666 Hz, 5 - 4000000? Hz,
6 - 200000000 Hz, 7 - 10000000 Hz, 8 - 50000000 Hz, 9 - 25000000 Hz, 10 - 12500000 Hz, 11 - 4000000? Hz */
#define CONFIG_CPU_CLK 1
#define CONFIG_CPU_CLK 0
//166.6MHZ - RUN/IDLE/SLP ~63/21/6.4 mA
//83.3MHZ - RUN/IDLE/SLP ~55/15/6.4 mA
//41.6MHZ - RUN/IDLE ~51/11 mA

View file

@ -4,10 +4,11 @@
#SDK_PATH = ../RTL00MP3/RTL00_SDKV35a/
SDK_PATH = USDK/
#GCC_PATH = d:/MCU/GNU_Tools_ARM_Embedded/6.2017-q1-update/bin/# + or set in PATH
#OPENOCD_PATH = d:/MCU/OpenOCD/bin/# + or set in PATH
OPENOCD_PATH = D:/MCU/OpenOCD/bin/
TOOLS_PATH ?= $(SDK_PATH)component/soc/realtek/8195a/misc/iar_utility/common/tools/
FLASHER_TYPE ?= Jlink
#FLASHER_TYPE ?= OCD
#FLASHER_TYPE = Jlink
FLASHER_TYPE = cmsis-dap
FLASHER_SPEED = 3500
FLASHER_PATH = flasher/
JLINK_PATH ?= D:/MCU/SEGGER/JLink_V612i/
JLINK_GDBSRV ?= JLinkGDBServer.exe