From afcadda20e6b683aaed090d85b66be297c892f10 Mon Sep 17 00:00:00 2001 From: pvvx Date: Thu, 2 Feb 2017 10:05:13 +0300 Subject: [PATCH] update --- DAPLink-RTL00Console.bat | 1 + DAPLink-RdFullFlash.bat | 1 + DAPLink-Reset.bat | 2 ++ DAPLink_WrFullFlash.bat | 1 + JLink-RTL00ConsoleROM.bat | 2 +- JLink-RdFullFlash.bat | 4 ++-- JLink-Reset.bat | 2 +- JLink-RunRAM.bat | 2 +- JLinkGDB-RdFullFlash.bat | 2 +- JLinkGDB-RunRAM.bat | 2 +- JLinkGDB-WrFlash.bat | 2 +- JLinkGDBServer.bat | 2 +- JLinkOCD-RdFullFlash.bat | 3 ++- JLink_RdFullFlash.bat | 4 ++-- JlinkOpenOCD.bat | 2 +- .../component/common/api/at_cmd/atcmd_sys.c | 15 ++++++++++++++- .../common/application/xmodem/uart_fw_update.c | 1 + .../common/mbed/targets/hal/rtl8195a/flash_api.c | 2 +- STLink-RdFullFlash.bat | 1 + STLink-Reset.bat | 2 ++ 20 files changed, 38 insertions(+), 15 deletions(-) diff --git a/DAPLink-RTL00Console.bat b/DAPLink-RTL00Console.bat index 846a8b0..bc0d13c 100644 --- a/DAPLink-RTL00Console.bat +++ b/DAPLink-RTL00Console.bat @@ -1,4 +1,5 @@ @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" diff --git a/DAPLink-RdFullFlash.bat b/DAPLink-RdFullFlash.bat index 8348bbf..5861662 100644 --- a/DAPLink-RdFullFlash.bat +++ b/DAPLink-RdFullFlash.bat @@ -1,4 +1,5 @@ @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 5000" -c "rtl8710_flash_read ../fullflash.bin 0 1048576" -c "shutdown" echo flash read fullflash.bin diff --git a/DAPLink-Reset.bat b/DAPLink-Reset.bat index 53afe4b..aceee70 100644 --- a/DAPLink-Reset.bat +++ b/DAPLink-Reset.bat @@ -1,3 +1,5 @@ +@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 diff --git a/DAPLink_WrFullFlash.bat b/DAPLink_WrFullFlash.bat index 39f54d1..bd1cf72 100644 --- a/DAPLink_WrFullFlash.bat +++ b/DAPLink_WrFullFlash.bat @@ -1,4 +1,5 @@ @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 diff --git a/JLink-RTL00ConsoleROM.bat b/JLink-RTL00ConsoleROM.bat index 09767bd..d8488c6 100644 --- a/JLink-RTL00ConsoleROM.bat +++ b/JLink-RTL00ConsoleROM.bat @@ -1,3 +1,3 @@ @echo off -PATH=D:\MCU\SEGGER\JLink_V610a;%PATH% +call paths.bat start JLink.exe -Device CORTEX-M3 -If SWD -Speed 4000 flasher\RTL00ConsoleROM.JLinkScript diff --git a/JLink-RdFullFlash.bat b/JLink-RdFullFlash.bat index 843e924..de5d955 100644 --- a/JLink-RdFullFlash.bat +++ b/JLink-RdFullFlash.bat @@ -1,3 +1,3 @@ @echo off -PATH=D:\MCU\SEGGER\JLink_V610a;%PATH% -JLink.exe -Device CORTEX-M3 -If SWD -Speed 4000 flasher/RTL_FFlash.JLinkScript +call paths.bat +JLink.exe -Device CORTEX-M3 -If SWD -Speed 10000 flasher/RTL_FFlash.JLinkScript diff --git a/JLink-Reset.bat b/JLink-Reset.bat index 81c18f2..51ea2a8 100644 --- a/JLink-Reset.bat +++ b/JLink-Reset.bat @@ -1,3 +1,3 @@ @echo off -PATH=D:\MCU\SEGGER\JLink_V610a;%PATH% +call paths.bat JLink.exe -Device CORTEX-M3 -If SWD -Speed 1000 flasher\RTL_Reset.JLinkScript diff --git a/JLink-RunRAM.bat b/JLink-RunRAM.bat index 253941d..4282a8e 100644 --- a/JLink-RunRAM.bat +++ b/JLink-RunRAM.bat @@ -1,3 +1,3 @@ @echo off -PATH=D:\MCU\SEGGER\JLink_V610a;%PATH% +call paths.bat start JLink.exe -Device CORTEX-M3 -If SWD -Speed 4000 flasher\RTL_RunRAM.JLinkScript diff --git a/JLinkGDB-RdFullFlash.bat b/JLinkGDB-RdFullFlash.bat index 7d1edbf..76865da 100644 --- a/JLinkGDB-RdFullFlash.bat +++ b/JLinkGDB-RdFullFlash.bat @@ -1,5 +1,5 @@ @echo off -PATH=D:\MCU\GNU_Tools_ARM_Embedded\5.2_2015q4\bin;D:\MCU\SEGGER\JLink_V610a;%PATH% +call paths.bat start JLinkGDBServer.exe -device Cortex-M3 -if SWD -ir -endian little -speed 1000 arm-none-eabi-gdb.exe -x flasher/gdb_rdflash.jlink taskkill /F /IM JLinkGDBServer.exe diff --git a/JLinkGDB-RunRAM.bat b/JLinkGDB-RunRAM.bat index 40333de..323aa3a 100644 --- a/JLinkGDB-RunRAM.bat +++ b/JLinkGDB-RunRAM.bat @@ -1,5 +1,5 @@ @echo off -PATH=D:\MCU\GNU_Tools_ARM_Embedded\5.2_2015q4\bin;D:\MCU\SEGGER\JLink_V610a;%PATH% +call paths.bat @if exist build\obj\build.axf goto run echo File 'build\obj\build.axf' not found! echo Build project... diff --git a/JLinkGDB-WrFlash.bat b/JLinkGDB-WrFlash.bat index 4925001..9f58d24 100644 --- a/JLinkGDB-WrFlash.bat +++ b/JLinkGDB-WrFlash.bat @@ -1,5 +1,5 @@ @echo off -PATH=D:\MCU\GNU_Tools_ARM_Embedded\5.2_2015q4\bin;D:\MCU\SEGGER\JLink_V610a;%PATH% +call paths.bat @if %1x==x goto xxx set img_file=%1 goto run diff --git a/JLinkGDBServer.bat b/JLinkGDBServer.bat index 974e29f..c356ac1 100644 --- a/JLinkGDBServer.bat +++ b/JLinkGDBServer.bat @@ -1,5 +1,5 @@ @echo off -PATH=D:\MCU\GNU_Tools_ARM_Embedded\5.2_2015q4\bin;D:\MCU\SEGGER\JLink_V610a;%PATH% +call paths.bat start JLinkGDBServer.exe -device Cortex-M3 -if SWD -ir -endian little -speed 1000 arm-none-eabi-gdb.exe -x flasher/gdb_init.jlink taskkill /F /IM JLinkGDBServer.exe diff --git a/JLinkOCD-RdFullFlash.bat b/JLinkOCD-RdFullFlash.bat index 25661e2..4708bea 100644 --- a/JLinkOCD-RdFullFlash.bat +++ b/JLinkOCD-RdFullFlash.bat @@ -1,6 +1,7 @@ @echo off +call paths.bat cd flasher -openocd -f interface/Jlink.cfg -c "adapter_khz 3500" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "rtl8710_flash_read ../fullflash.bin 0 1048576" -c "shutdown" +openocd -f interface/Jlink.cfg -c "adapter_khz 3500" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "adapter_khz 3900" -c "rtl8710_flash_read ../fullflash.bin 0 1048576" -c "shutdown" echo flash read fullflash.bin pause diff --git a/JLink_RdFullFlash.bat b/JLink_RdFullFlash.bat index c8a8b2c..450e141 100644 --- a/JLink_RdFullFlash.bat +++ b/JLink_RdFullFlash.bat @@ -1,6 +1,6 @@ @echo off -cd flasher -openocd -f interface/Jlink.cfg -c "adapter_khz 1000" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "adapter_khz 3900" -c "rtl8710_flash_read_id" -c "rtl8710_flash_read ../fullflash.bin 0 1048576" -c "shutdown" +call paths.bat +openocd -f interface/Jlink.cfg -c "adapter_khz 1000" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "adapter_khz 3500" -c "rtl8710_flash_read_id" -c "rtl8710_flash_read ../fullflash.bin 0 1048576" -c "shutdown" echo flash read fullflash.bin pause diff --git a/JlinkOpenOCD.bat b/JlinkOpenOCD.bat index 35d397f..6e354f6 100644 --- a/JlinkOpenOCD.bat +++ b/JlinkOpenOCD.bat @@ -1,4 +1,4 @@ @echo off -PATH=D:\MCU\OpenOCD;%PATH% +call paths.bat taskkill /F /IM openocd.exe start openocd -f interface\Jlink.cfg -f flasher\ameba1.cfg diff --git a/RTL00_SDKV35a/component/common/api/at_cmd/atcmd_sys.c b/RTL00_SDKV35a/component/common/api/at_cmd/atcmd_sys.c index 5779791..08bca4e 100644 --- a/RTL00_SDKV35a/component/common/api/at_cmd/atcmd_sys.c +++ b/RTL00_SDKV35a/component/common/api/at_cmd/atcmd_sys.c @@ -1154,8 +1154,21 @@ void fATSL(void *arg) { #if CONFIG_UART_XMODEM void fATSX(void *arg) { +#ifdef RTL8711AM +#error "Set OTU_FW_Update UARTx pins!" // use xmodem to update, RX: PA_6, TX: PA_7, baudrate: 1M OTU_FW_Update(0, 2, 115200); + +#else +#ifdef RTL8710AF +#error "OTU_FW_Update work only SDRAM buffer!" +#endif +// use xmodem to update, RX: PC_0, TX: PC_3, baudrate: 1M + OTU_FW_Update(0, 0, 115200); +// use xmodem to update, RX: PE_3, TX: PE_0, baudrate: 1M +// JTAG Off! +// OTU_FW_Update(0, 1, 115200); +#endif at_printf("\r\n[ATSX] OK"); } #endif @@ -1372,7 +1385,7 @@ log_item_t at_sys_items[] = { #endif { "ATSG", fATSG }, // GPIO control #if CONFIG_UART_XMODEM - { "ATSX", fATSX}, // uart xmodem upgrade + { "ATSX", fATSX}, // uart xmodem upgrade #endif { "ATSD", fATSD }, // Dump register { "ATXD", fATXD }, // Write register diff --git a/RTL00_SDKV35a/component/common/application/xmodem/uart_fw_update.c b/RTL00_SDKV35a/component/common/application/xmodem/uart_fw_update.c index f573228..22b62d3 100644 --- a/RTL00_SDKV35a/component/common/application/xmodem/uart_fw_update.c +++ b/RTL00_SDKV35a/component/common/application/xmodem/uart_fw_update.c @@ -15,6 +15,7 @@ #include "hal_spi_flash.h" #include "rtl8195a_spi_flash.h" #include +#include #if CONFIG_UART_SOCKET #if /*CONFIG_PERI_UPDATE_IMG*/1 diff --git a/RTL00_SDKV35a/component/common/mbed/targets/hal/rtl8195a/flash_api.c b/RTL00_SDKV35a/component/common/mbed/targets/hal/rtl8195a/flash_api.c index f94f14d..d633a8c 100644 --- a/RTL00_SDKV35a/component/common/mbed/targets/hal/rtl8195a/flash_api.c +++ b/RTL00_SDKV35a/component/common/mbed/targets/hal/rtl8195a/flash_api.c @@ -87,7 +87,7 @@ void flash_init(flash_t *obj) { flashobj.SpicInitPara.Mode.CpuClk = curclk; flashobj.SpicInitPara.Mode.BitMode = flmode; -#if CONFIG_DEBUG_LOG > 4 +#if CONFIG_DEBUG_LOG > 3 DBG_SPIF_INFO("Flash ID: %02x%02x%02x\n", flashobj.SpicInitPara.id[0], flashobj.SpicInitPara.id[1], flashobj.SpicInitPara.id[2]); DBG_SPIF_INFO("Flash Mode: 0x%02x; BaudRate:%d; RdDummyCyle:%d; DelayLine:%d\n", flashobj.SpicInitPara.Mode.BitMode, flashobj.SpicInitPara.BaudRate, flashobj.SpicInitPara.RdDummyCyle, flashobj.SpicInitPara.DelayLine); diff --git a/STLink-RdFullFlash.bat b/STLink-RdFullFlash.bat index f227d0f..af82648 100644 --- a/STLink-RdFullFlash.bat +++ b/STLink-RdFullFlash.bat @@ -1,4 +1,5 @@ @echo off +call paths.bat cd flasher openocd -f interface/stlink-v2.cfg -c "adapter_khz 1000" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "adapter_khz 5000" -c "rtl8710_flash_read ../fullflash.bin 0 1048576" -c "shutdown" echo flash read fullflash.bin diff --git a/STLink-Reset.bat b/STLink-Reset.bat index a72863d..d4aeb47 100644 --- a/STLink-Reset.bat +++ b/STLink-Reset.bat @@ -1,3 +1,5 @@ +@echo off +call paths.bat @cd flasher openocd -f interface/stlink-v2.cfg -c "adapter_khz 1000" -f rtl8710.ocd -f cortex.ocd -c "init" -c "reset halt" -c "cortex_reboot" -c "shutdown" rem