diff --git a/DAPLink-RTL00Console.bat b/DAPLink-RTL00Console.bat
deleted file mode 100644
index bc0d13c..0000000
--- a/DAPLink-RTL00Console.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-@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
deleted file mode 100644
index 5861662..0000000
--- a/DAPLink-RdFullFlash.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-@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
-pause
-
diff --git a/DAPLink-Reset.bat b/DAPLink-Reset.bat
deleted file mode 100644
index aceee70..0000000
--- a/DAPLink-Reset.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-@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
deleted file mode 100644
index bd1cf72..0000000
--- a/DAPLink_WrFullFlash.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-@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-RunRAM.bat b/JLink-RunRAM.bat
deleted file mode 100644
index 4282a8e..0000000
--- a/JLink-RunRAM.bat
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-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
deleted file mode 100644
index 76865da..0000000
--- a/JLinkGDB-RdFullFlash.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-@echo off
-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
deleted file mode 100644
index 323aa3a..0000000
--- a/JLinkGDB-RunRAM.bat
+++ /dev/null
@@ -1,15 +0,0 @@
-@echo off
-call paths.bat
-@if exist build\obj\build.axf goto run
-echo File 'build\obj\build.axf' not found!
-echo Build project...
-mingw32-make.exe -f Makefile all
-@if not exist build\obj\build.axf goto err
-:run
-start JLinkGDBServer.exe -device Cortex-M3 -if SWD -ir -endian little -speed 1000
-arm-none-eabi-gdb.exe -x flasher/gdb_run_ram.jlink
-taskkill /F /IM JLinkGDBServer.exe
-goto end
-:err
-echo Error!
-:end
\ No newline at end of file
diff --git a/JLinkGDB-WrFlash.bat b/JLinkGDB-WrFlash.bat
deleted file mode 100644
index c70f651..0000000
--- a/JLinkGDB-WrFlash.bat
+++ /dev/null
@@ -1,21 +0,0 @@
-@echo off
-call paths.bat
-@if %1x==x goto xxx
-set img_file=%1
-goto run
-:xxx
-set img_file=build/bin/ram_all.bin
-:run
-echo define call1>flasher/flash_file.jlink
-echo SetFirwareSize %img_file%>>flasher/flash_file.jlink
-echo end>>flasher/flash_file.jlink
-echo define call2>>flasher/flash_file.jlink
-echo FlasherWrite %img_file% 0 $Image1Size>>flasher/flash_file.jlink
-echo end>>flasher/flash_file.jlink
-echo define call3>>flasher/flash_file.jlink
-echo FlasherWrite %img_file% $Image2Addr $Image2Size>>flasher/flash_file.jlink
-echo end>>flasher/flash_file.jlink
-start JLinkGDBServer.exe -device Cortex-M3 -if SWD -ir -endian little -speed 3500
-arm-none-eabi-gdb.exe -x flasher/gdb_wrflash.jlink
-taskkill /F /IM JLinkGDBServer.exe
-
diff --git a/JLinkGDBServer.bat b/JLinkGDBServer.bat
deleted file mode 100644
index c356ac1..0000000
--- a/JLinkGDBServer.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-@echo off
-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/JLinkGDB_OTA.bat b/JLinkGDB_OTA.bat
deleted file mode 100644
index f64317e..0000000
--- a/JLinkGDB_OTA.bat
+++ /dev/null
@@ -1,15 +0,0 @@
-@echo off
-call paths.bat
-@if exist build\bin\ota.bin goto run
-echo File 'build\obj\ota.bin' not found!
-echo Build project...
-mingw32-make.exe -f Makefile all
-@if not exist build\bin\ota.bin goto err
-:run
-start start JLinkGDBServer.exe -device Cortex-M3 -if SWD -ir -endian little -speed 1000
-arm-none-eabi-gdb.exe -x flasher/gdb_ota.jlink
-taskkill /F /IM JLinkGDBServer.exe
-goto end
-:err
-echo Error!
-:end
\ No newline at end of file
diff --git a/JLinkOCD-RdFullFlash.bat b/JLinkOCD-RdFullFlash.bat
deleted file mode 100644
index 4708bea..0000000
--- a/JLinkOCD-RdFullFlash.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-@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 "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
deleted file mode 100644
index 450e141..0000000
--- a/JLink_RdFullFlash.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-@echo off
-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
deleted file mode 100644
index 6e354f6..0000000
--- a/JlinkOpenOCD.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-call paths.bat
-taskkill /F /IM openocd.exe
-start openocd -f interface\Jlink.cfg -f flasher\ameba1.cfg
diff --git a/Makefile b/Makefile
index 794f882..44e5e5c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,47 +1,48 @@
+include userset.mk
all: ram_all
mp: ram_all_mp
.PHONY: ram_all
ram_all:
- @$(MAKE) -f sdkbuild.mk
- @$(MAKE) -f flasher.mk genbin1 genbin23
+ @$(MAKE) -f $(SDK_PATH)sdkbuild.mk
+ @$(MAKE) -f $(SDK_PATH)flasher.mk genbin1 genbin23
.PHONY: ram_all_mp
ram_all_mp:
- @$(MAKE) -f sdkbuild.mk mp
- @$(MAKE) -f flasher.mk mp
+ @$(MAKE) -f $(SDK_PATH)sdkbuild.mk mp
+ @$(MAKE) -f $(SDK_PATH)flasher.mk mp
.PHONY: clean clean_all
clean:
- @$(MAKE) -f sdkbuild.mk clean
+ @$(MAKE) -f $(SDK_PATH)sdkbuild.mk clean
clean_all:
- @$(MAKE) -f sdkbuild.mk clean_all
+ @$(MAKE) -f $(SDK_PATH)sdkbuild.mk clean_all
.PHONY: flashburn runram reset test readfullflash flashwebfs
flashburn:
#JLinkGDB-WrFlash.bat
- @$(MAKE) -f flasher.mk flashburn
+ @$(MAKE) -f $(SDK_PATH)flasher.mk flashburn
flash_OTA:
- @$(MAKE) -f flasher.mk flash_OTA
+ @$(MAKE) -f $(SDK_PATH)flasher.mk flash_OTA
webfs:
@$(MAKE) -f webfs.mk
flashwebfs:
@$(MAKE) -f webfs.mk
- @$(MAKE) -f flasher.mk flashwebfs
+ @$(MAKE) -f $(SDK_PATH)flasher.mk flashwebfs
#JLinkGDB-WrWebFs.bat
runram:
#JLink-RunRAM.bat
- @$(MAKE) --f flasher.mk runram
+ @$(MAKE) --f $(SDK_PATH)flasher.mk runram
reset:
#JLink-Reset.bat
- @$(MAKE) -f flasher.mk reset
+ @$(MAKE) -f $(SDK_PATH)flasher.mk reset
test:
JLink-RTL00ConsoleROM.bat
@@ -49,9 +50,5 @@ test:
readfullflash:
#JLink-RdFullFlash.bat
- @$(MAKE) -f flasher.mk readfullflash
+ @$(MAKE) -f $(SDK_PATH)flasher.mk readfullflash
-.PHONY: prerequirement
-prerequirement:
- @$(file >DEPENDENCY_LIST.txt,$(DEPENDENCY_LIST))
-
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index f0ab692..0000000
--- a/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# RTL00 Web
----
-Проект на начальной стадии, не завершен!
-
-[форум](https://esp8266.ru/forum/threads/web-svalka-na-rtl871x.2403/)
----
-Used Modules:
-RTL00(RTL8710AF), [F11AMIM13](http://fn-link.en.made-in-china.com/product/sSinPtAKZBke/China-RTL8711AM-Iot-Module.html) (RTL8711AM), [F11AFIM13-B1](http://fn-link.en.made-in-china.com/product/PSHnuEtJVXWh/China-RTL8711AF-IoT-Module-IEEE-802-11-B-G-N-2-4GHz-1T1R-WiFi-NFC-Module.html) (RTL8711AF)
-[PADI](https://www.pine64.org/?page_id=946) (RTL8710AF), [F10AFIM13-B1](http://en.ofeixin.com/products_detail/productId=65.html) (RTL8710AF), [TinyCon2005-A-BE](http://www.ralinwi.com/product.aspx?info_lb=54&flag=1) (RTL8711AF),
-[WFM-400](http://www.rayson.com/rayson/en/?pros=product&pros=product&b_cat_id=A03&m_cat_id=A0304&s_cat_id=A030401&prod_id=P0113&level=3) (RTL8711AM), [WFM-410](http://www.rayson.com/rayson/en/?pros=product&pros=product&b_cat_id=A03&m_cat_id=A0304&s_cat_id=A030401&prod_id=P0114&level=3) (RTL8711AF), [WFM-250](http://www.rayson.com/rayson/en/?pros=product&pros=product&b_cat_id=A03&m_cat_id=A0304&s_cat_id=A030401&prod_id=P0112&level=3) (RTL8195AM),
-[AW-CU238, AW-CU239](https://www.buyiot.net/pd-1) (RTL8711AM), [AW-CU245, AW-CU245, AW-CU245](https://www.buyiot.net/home-1) (RTL8711AM/RTL8195AM/RTL8711AF),
-[WG6611](http://www.jorjin.com/product.php?id=98) (RTL8711AM), [RAK473](http://www.rakwireless.com/en/download/RAK473/Firmware%20Upgrade) (RTL8711AM), [RAK474, RAK476](http://www.rakwireless.com/en/download/RAK473/Firmware%20Upgrade) (RTL8711AF), ...
diff --git a/STLink-RdFullFlash.bat b/STLink-RdFullFlash.bat
deleted file mode 100644
index af82648..0000000
--- a/STLink-RdFullFlash.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-@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
-pause
-
diff --git a/STLink-Reset.bat b/STLink-Reset.bat
deleted file mode 100644
index d4aeb47..0000000
--- a/STLink-Reset.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-@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
-
diff --git a/flasher.mk b/flasher.mk
deleted file mode 100644
index 5d00b8a..0000000
--- a/flasher.mk
+++ /dev/null
@@ -1,307 +0,0 @@
-# RTL8710 Flasher v0.0.alfa
-# pvvx 21.09.2016
--include paths.mk
-#---------------------------
-#FLASHER = stlink-v2-1
-#FLASHER = stlink-v2
-FLASHER ?= Jlink
-JLINK_PATH ?= D:/MCU/SEGGER/JLink_V612i/
-#---------------------------
-# Default
-#---------------------------
-# TARGET dirs
-TARGET ?= build
-OBJ_DIR ?= build/obj
-BIN_DIR ?= build/bin
-ELFFILE ?= $(OBJ_DIR)/$(TARGET).axf
-#---------------------------
-# Compilation tools
-CROSS_COMPILE ?= $(GCC_PATH)arm-none-eabi-
-AR ?= $(CROSS_COMPILE)ar
-CC ?= $(CROSS_COMPILE)gcc
-AS ?= $(CROSS_COMPILE)as
-NM ?= $(CROSS_COMPILE)nm
-LD ?= $(CROSS_COMPILE)gcc
-GDB ?= $(CROSS_COMPILE)gdb
-SIZE ?= $(CROSS_COMPILE)size
-OBJCOPY ?= $(CROSS_COMPILE)objcopy
-OBJDUMP ?= $(CROSS_COMPILE)objdump
-
-# Make bunary tools
-TOOLS_PATH ?= component/soc/realtek/8195a/misc/iar_utility/common/tools/
-ifneq ($(shell uname), Linux)
-EXE = .exe
-endif
-PICK = $(TOOLS_PATH)pick$(EXE)
-PADDING = $(TOOLS_PATH)padding$(EXE)
-CHCKSUM = $(TOOLS_PATH)checksum$(EXE)
-
-# openocd tools
-OPENOCD = $(OPENOCD_PATH)openocd
-
-JLINK_GDB ?= JLinkGDBServer.exe
-JLINK_EXE ?= JLink.exe
-
-ifeq ($(FLASHER), Jlink)
-# Jlink FLASHER_SPEED ..4000 kHz
-FLASHER_SPEED = 3500
-else
-ifeq ($(FLASHER),stlink-v2)
-# stlink-v2 FLASHER_SPEED ..1800 kHz
-FLASHER_SPEED = 1800
-else
-# over FLASHER_SPEED ..500 kHz ?
-FLASHER_SPEED = 500
-endif
-endif
-
-# COMPILED_BOOT if defined -> extract image1, boot head in elf
-COMPILED_BOOT=1
-# COMPILED_BOOT_BIN if !defined -> use source startup boot
-#COMPILED_BOOT_BIN=1
-# PADDINGSIZE defined -> image2 OTA
-PADDINGSIZE =44k
-
-NMAPFILE = $(OBJ_DIR)/$(TARGET).nmap
-
-#FLASHER_PATH ?= flasher/
-
-#RAM_IMAGE?= $(BIN_DIR)/ram.bin
-
-RAM1_IMAGE ?= $(BIN_DIR)/ram_1.bin
-RAM1P_IMAGE ?= $(BIN_DIR)/ram_1.p.bin
-RAM1R_IMAGE ?= $(BIN_DIR)/ram_1.r.bin
-
-RAM2_IMAGE = $(BIN_DIR)/ram_2.bin
-RAM2P_IMAGE = $(BIN_DIR)/ram_2.p.bin
-RAM2NS_IMAGE = $(BIN_DIR)/ram_2.ns.bin
-
-RAM3_IMAGE = $(BIN_DIR)/sdram.bin
-RAM3P_IMAGE = $(BIN_DIR)/sdram.p.bin
-
-FLASH_IMAGE = $(BIN_DIR)/ram_all.bin
-OTA_IMAGE = $(BIN_DIR)/ota.bin
-
-#all: FLASH_IMAGE = $(BIN_DIR)/ram_all.bin
-#all: OTA_IMAGE = $(BIN_DIR)/ota.bin
-mp: FLASH_IMAGE = $(BIN_DIR)/ram_all_mp.bin
-mp: OTA_IMAGE = $(BIN_DIR)/ota_mp.bin
-
-TST_IMAGE = $(BIN_DIR)/ram_2.bin
-
-.PHONY: genbin1 genbin23 flashburn reset test readfullflash flashwebfs flash_OTA
-.NOTPARALLEL: all mp genbin1 genbin23 flashburn reset test readfullflash _endgenbin flashwebfs flash_OTA
-
-all: $(ELFFILE) $(OTA_IMAGE) $(FLASH_IMAGE) _endgenbin
-mp: $(ELFFILE) $(OTA_IMAGE) $(FLASH_IMAGE) _endgenbin
-
-genbin1: $(ELFFILE) $(RAM1P_IMAGE)
-
-genbin23: $(ELFFILE) $(OTA_IMAGE) $(FLASH_IMAGE) _endgenbin
-
-
-_endgenbin:
- @echo "-----------------------------------------------------------"
- @echo "Image ($(OTA_IMAGE)) size $(shell printf '%d\n' $$(( $$(stat --printf="%s" $(OTA_IMAGE)) )) ) bytes"
- @echo "Image ($(FLASH_IMAGE)) size $(shell printf '%d\n' $$(( $$(stat --printf="%s" $(FLASH_IMAGE)) )) ) bytes"
- @echo "==========================================================="
-
-ifeq ($(FLASHER_TYPE), Jlink)
-
-reset:
- @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_Reset.JLinkScript
-
-runram:
- @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_RunRAM.JLinkScript
-
-readfullflash:
- @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed 1000 $(FLASHER_PATH)RTL_FFlash.JLinkScript
-
-
-flashburn:
- @echo define call1>$(FLASHER_PATH)flash_file.jlink
- @echo SetFirwareSize build/bin/ram_all.bin>>$(FLASHER_PATH)flash_file.jlink
- @echo end>>$(FLASHER_PATH)flash_file.jlink
- @echo define call2>>$(FLASHER_PATH)flash_file.jlink
- @echo FlasherWrite build/bin/ram_all.bin 0 '$$'Image1Size>>$(FLASHER_PATH)flash_file.jlink
- @echo end>>$(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 end>>$(FLASHER_PATH)flash_file.jlink
- @cmd /K start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000
- @$(GDB) -x $(FLASHER_PATH)gdb_wrflash.jlink
- #@taskkill /F /IM $(JLINK_GDBSRV)
-
-flashwebfs:
- @echo define call1>$(FLASHER_PATH)file_info.jlink
- @echo set '$$'ImageSize = $(shell printf '0x%X\n' $$(stat --printf="%s" $(BIN_DIR)/WEBFiles.bin))>>$(FLASHER_PATH)file_info.jlink
- @echo set '$$'ImageAddr = 0x0D0000>>$(FLASHER_PATH)file_info.jlink
- @echo end>>$(FLASHER_PATH)file_info.jlink
- @echo define call2>>$(FLASHER_PATH)file_info.jlink
- @echo FlasherWrite $(BIN_DIR)/WEBFiles.bin '$$'ImageAddr '$$'ImageSize>>$(FLASHER_PATH)file_info.jlink
- @echo end>>$(FLASHER_PATH)file_info.jlink
- @cmd /K start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000
- @$(GDB) -x $(FLASHER_PATH)gdb_wrfile.jlink
- #@taskkill /F /IM $(JLINK_GDBSRV)
-
-flash_OTA:
- @cmd /K start $(JLINK_PATH)$(JLINK_GDBSRV) -device Cortex-M3 -if SWD -ir -endian little -speed 1000
- @$(GDB) -x $(FLASHER_PATH)gdb_ota.jlink
- #@taskkill /F /IM $(JLINK_GDBSRV)
-
-else
-
-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
-
-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
-
-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
-
-
-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
-
-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
-
-endif
-
-$(NMAPFILE): $(ELFFILE)
- @echo "==========================================================="
- @echo "Build names map file"
- @echo $@
- @$(NM) $< | sort > $@
-# @echo "==========================================================="
-
-$(FLASH_IMAGE): $(RAM1P_IMAGE) $(RAM2P_IMAGE) $(RAM3P_IMAGE)
- @echo "==========================================================="
- @echo "Make Flash image ($(FLASH_IMAGE))"
-# @echo "==========================================================="
- @mkdir -p $(BIN_DIR)
- @rm -f $(FLASH_IMAGE)
- @cat $(RAM1P_IMAGE) > $(FLASH_IMAGE)
-# @chmod 777 $(FLASH_IMAGE)
-ifdef PADDINGSIZE
- @$(PADDING) $(PADDINGSIZE) 0xFF $(FLASH_IMAGE)
-endif
- @cat $(RAM2P_IMAGE) >> $(FLASH_IMAGE)
- @cat $(RAM3P_IMAGE) >> $(FLASH_IMAGE)
-# @echo "Image ($(FLASH_IMAGE)) size $(shell printf '%d\n' $$(( $$(stat --printf="%s" $(FLASH_IMAGE)) )) ) bytes"
-# @echo "==========================================================="
-# @rm $(BIN_DIR)/ram_*.p.bin
-
-$(OTA_IMAGE): $(RAM2NS_IMAGE) $(RAM3_IMAGE)
- @echo "==========================================================="
- @echo "Make OTA image ($(OTA_IMAGE))"
- @rm -f $(OTA_IMAGE)
- @cat $(RAM2NS_IMAGE) > $(OTA_IMAGE)
- @cat $(RAM3P_IMAGE) >> $(OTA_IMAGE)
-# @chmod 777 $(OTA_IMAGE)
- @$(CHCKSUM) $(OTA_IMAGE) || true
-# @echo "==========================================================="
-
-$(RAM1P_IMAGE): $(ELFFILE) $(NMAPFILE)
- @echo "==========================================================="
- @echo "Create image1r ($(RAM1R_IMAGE))"
-# @echo "===========================================================" .bootloader
-ifdef COMPILED_BOOT
- @mkdir -p $(BIN_DIR)
- @rm -f $(RAM1_IMAGE) $(RAM1R_IMAGE)
-ifdef COMPILED_BOOT_BIN
- @$(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__!"))
-ifeq ($(RAM1_START_ADDR),$(RAM1_END_ADDR))
-ifdef COMPILED_BOOT_BIN
- $(OBJCOPY) --change-section-address .boot.head=0x10000ba8 -j .boot.head -j .bootloader -Obinary $(ELFFILE) $(RAM1P_IMAGE)
-else
-# $(OBJCOPY) -j .rom_ram -Obinary $(ELFFILE) $(RAM_IMAGE)
- $(OBJCOPY) -j .ram.start.table -j .ram_image1.text -Obinary $(ELFFILE) $(RAM1R_IMAGE)
- $(PICK) 0x$(RAM1_START_ADDR) 0x$(RAM1_END_ADDR) $(RAM1R_IMAGE) $(RAM1P_IMAGE) head+reset_offset 0x0B000
-endif
-else
- $(error "BOOT-image size = 0")
-# $(error Flasher: COMPILE_BOOT = No)
-endif
-else
- @if [ -s $(RAM1R_IMAGE) ]; then echo "Use external $(RAM1R_IMAGE)!"; fi
-endif
-
-$(RAM2P_IMAGE): $(ELFFILE) $(NMAPFILE)
- @echo "==========================================================="
- @echo "Create image2p ($(RAM2P_IMAGE))"
-# @echo "==========================================================="
- @mkdir -p $(BIN_DIR)
- @rm -f $(RAM2_IMAGE) $(RAM2P_IMAGE)
- @$(eval RAM2_START_ADDR = $(shell grep __ram_image2_text $(NMAPFILE) | grep _start__ | awk '{print $$1}'))
- @$(eval RAM2_END_ADDR = $(shell grep __ram_image2_text $(NMAPFILE) | grep _end__ | awk '{print $$1}'))
- $(if $(RAM2_START_ADDR),,$(error "Not found __ram_image2_text_start__!"))
- $(if $(RAM2_END_ADDR),,$(error "Not found __ram_image2_text_end__!"))
- @$(OBJCOPY) -j .image2.start.table -j .ram_image2.text -j .ram_image2.rodata -j .ram.data -Obinary $(ELFFILE) $(RAM2_IMAGE)
- @$(PICK) 0x$(RAM2_START_ADDR) 0x$(RAM2_END_ADDR) $(RAM2_IMAGE) $(RAM2P_IMAGE) body+reset_offset+sig
-
-$(RAM2NS_IMAGE):$(ELFFILE) $(NMAPFILE)
- @echo "==========================================================="
- @echo "Create image2ns ($(RAM2NS_IMAGE))"
-# @echo "==========================================================="
- mkdir -p $(BIN_DIR)
- rm -f $(RAM2_IMAGE) $(RAM2NS_IMAGE)
- $(eval RAM2_START_ADDR = $(shell grep __ram_image2_text $(NMAPFILE) | grep _start__ | awk '{print $$1}'))
- $(eval RAM2_END_ADDR = $(shell grep __ram_image2_text $(NMAPFILE) | grep _end__ | awk '{print $$1}'))
- $(if $(RAM2_START_ADDR),,$(error "Not found __ram_image2_text_start__!"))
- $(if $(RAM2_END_ADDR),,$(error "Not found __ram_image2_text_end__!"))
- $(OBJCOPY) -j .image2.start.table -j .ram_image2.text -j .ram_image2.rodata -j .ram.data -Obinary $(ELFFILE) $(RAM2_IMAGE)
- $(PICK) 0x$(RAM2_START_ADDR) 0x$(RAM2_END_ADDR) $(RAM2_IMAGE) $(RAM2NS_IMAGE) body+reset_offset
-
-$(RAM3_IMAGE): $(ELFFILE) $(NMAPFILE)
- @echo "==========================================================="
- @echo "Create image3 (SDRAM, $(RAM3P_IMAGE))"
-# @echo "==========================================================="
- @mkdir -p $(BIN_DIR)
- @rm -f $(RAM3_IMAGE) $(RAM3P_IMAGE)
- @$(eval RAM3_START_ADDR = $(shell grep __sdram_data_ $(NMAPFILE) | grep _start__ | awk '{print $$1}'))
- @$(eval RAM3_END_ADDR = $(shell grep __sdram_data_ $(NMAPFILE) | grep _end__ | awk '{print $$1}'))
- $(if $(RAM3_START_ADDR),,$(error "Not found __sdram_data_start__!"))
- $(if $(RAM3_END_ADDR),,$(error "Not found __sdram_data_end__!"))
-#ifneq ($(RAM3_START_ADDR),$(RAM3_END_ADDR))
- @echo $(RAM3_START_ADDR) $(RAM3_END_ADDR)
- @$(OBJCOPY) -j .image3 -j .sdr_text -j .sdr_rodata -j .sdr_data -Obinary $(ELFFILE) $(RAM3_IMAGE)
- $(PICK) 0x$(RAM3_START_ADDR) 0x$(RAM3_END_ADDR) $(RAM3_IMAGE) $(RAM3P_IMAGE) body+reset_offset
-#else
-# @rm -f $(RAM3_IMAGE) $(RAM3P_IMAGE)
-# @echo "SDRAM not used (size = 0)"
-#endif
-
-$(ELFFILE):
- $(error Falsher: file $@ not found)
-
-clean:
- @rm -f $(BIN_DIR)/*.bin
-
\ No newline at end of file
diff --git a/flasher/RTL8710AF.jflash b/flasher/RTL8710AF.jflash
deleted file mode 100644
index ff1f6c4..0000000
--- a/flasher/RTL8710AF.jflash
+++ /dev/null
@@ -1,153 +0,0 @@
- AppVersion = 61001
- FileVersion = 2
-[GENERAL]
- ConnectMode = 0
- CurrentFile = ""
- DataFileSAddr = 0x00000000
- GUIMode = 0
- HostName = ""
- TargetIF = 1
- USBPort = 0
- USBSerialNo = 0x00000000
-[JTAG]
- IRLen = 0
- MultipleTargets = 0
- NumDevices = 0
- Speed0 = 6000
- Speed1 = 6000
- TAP_Number = 0
- UseAdaptive0 = 0
- UseAdaptive1 = 0
- UseMaxSpeed0 = 0
- UseMaxSpeed1 = 0
-[CPU]
- NumInitSteps = 18
- InitStep0_Action = "Reset"
- InitStep0_Value0 = 0x00000000
- InitStep0_Value1 = 0x00000000
- InitStep0_Comment = "Reset and halt target"
- InitStep1_Action = "Read 32bit"
- InitStep1_Value0 = 0x40000230
- InitStep1_Value1 = 0x00000000
- InitStep1_Comment = "enable spi flash peripheral clock"
- InitStep2_Action = "Var OR"
- InitStep2_Value0 = 0x00000000
- InitStep2_Value1 = 0x00000300
- InitStep2_Comment = ""
- InitStep3_Action = "Var Write 32bit"
- InitStep3_Value0 = 0x40000230
- InitStep3_Value1 = 0x00000000
- InitStep3_Comment = ""
- InitStep4_Action = "Read 32bit"
- InitStep4_Value0 = 0x40000210
- InitStep4_Value1 = 0x00000000
- InitStep4_Comment = "enable spi flash peripheral"
- InitStep5_Action = "Var OR"
- InitStep5_Value0 = 0x00000000
- InitStep5_Value1 = 0x00000010
- InitStep5_Comment = ""
- InitStep6_Action = "Var Write 32bit"
- InitStep6_Value0 = 0x40000210
- InitStep6_Value1 = 0x00000000
- InitStep6_Comment = ""
- InitStep7_Action = "Read 32bit"
- InitStep7_Value0 = 0x400002C0
- InitStep7_Value1 = 0x00000000
- InitStep7_Comment = "select spi flash pinout (0 - internal), enable spi flash pins"
- InitStep8_Action = "Var AND"
- InitStep8_Value0 = 0x00000000
- InitStep8_Value1 = 0xFFFFFFF8
- InitStep8_Comment = ""
- InitStep9_Action = "Var OR"
- InitStep9_Value0 = 0x00000000
- InitStep9_Value1 = 0x00000001
- InitStep9_Comment = ""
- InitStep10_Action = "Var Write 32bit"
- InitStep10_Value0 = 0x400002C0
- InitStep10_Value1 = 0x00000000
- InitStep10_Comment = ""
- InitStep11_Action = "Write 32bit"
- InitStep11_Value0 = 0x40006008
- InitStep11_Value1 = 0x00000000
- InitStep11_Comment = "disable SPI FLASH operation"
- InitStep12_Action = "Write 32bit"
- InitStep12_Value0 = 0x4000602C
- InitStep12_Value1 = 0x00000000
- InitStep12_Comment = "disable all interrupts"
- InitStep13_Action = "Write 32bit"
- InitStep13_Value0 = 0x40006010
- InitStep13_Value1 = 0x00000001
- InitStep13_Comment = "use first 'slave select' pin"
- InitStep14_Action = "Write 32bit"
- InitStep14_Value0 = 0x40006014
- InitStep14_Value1 = 0x00000002
- InitStep14_Comment = "baud rate, default value"
- InitStep15_Action = "Write 32bit"
- InitStep15_Value0 = 0x40006018
- InitStep15_Value1 = 0x00000000
- InitStep15_Comment = "tx fifo threshold"
- InitStep16_Action = "Write 32bit"
- InitStep16_Value0 = 0x4000601C
- InitStep16_Value1 = 0x00000000
- InitStep16_Comment = "rx fifo threshold"
- InitStep17_Action = "Write 32bit"
- InitStep17_Value0 = 0x4000604C
- InitStep17_Value1 = 0x00000000
- InitStep17_Comment = "disable DMA"
- NumExitSteps = 1
- ExitStep0_Action = "Write 32bit"
- ExitStep0_Value0 = 0x40000210
- ExitStep0_Value1 = 0x00211157
- ExitStep0_Comment = "Boot from Flash"
- UseScriptFile = 0
- ScriptFile = ""
- UseRAM = 1
- RAMAddr = 0x10000000
- RAMSize = 0x00060000
- CheckCoreID = 1
- CoreID = 0x2BA01477
- CoreIDMask = 0xFFFFFFFF
- UseAutoSpeed = 0x00000001
- ClockSpeed = 0x00000000
- EndianMode = 0
- ChipName = "Cortex-M3"
-[FLASH]
- aRangeSel[1] = 0-18
- BankSelMode = 1
- BaseAddr = 0x98000000
- CheckId = 0
- CustomRAMCode = "D:\MCU\SEGGER\JLink_V610a\Samples\JFlash\ProjectFiles\Atmel\AT91SAM9261_DataFlash_SPI0\RAMCodeV2_AT91SAM9261_DataFlash_SPI0_LE.mot"
- DeviceName = "Am29F800BB"
- NumBanks = 1
- OrgNumBits = 16
- OrgNumChips = 1
-[PRODUCTION]
- AutoBlankCheck = 1
- AutoDisconnect = 0
- AutoMode = 0
- AutoPerformsErase = 0
- AutoPerformsProgram = 0
- AutoPerformsSecure = 0
- AutoPerformsStartApp = 0
- AutoPerformsUnsecure = 0
- AutoPerformsVerify = 1
- EnableTargetPower = 0
- EraseType = 2
- MonitorVTref = 0
- MonitorVTrefMax = 0x0000157C
- MonitorVTrefMin = 0x000003E8
- OverrideTimeouts = 0
- ProgramSN = 0
- SerialFile = ""
- SkipBlankOnRead = 0
- SNAddr = 0x00000000
- SNInc = 0x00000001
- SNLen = 0x00000008
- SNListFile = ""
- SNValue = 0x00000001
- StartAppType = 0
- TargetPowerDelay = 0x00000014
- TimeoutErase = 0x00003A98
- TimeoutProgram = 0x00002710
- TimeoutVerify = 0x00002710
- VerifyType = 1
diff --git a/flasher/file_info.jlink b/flasher/file_info.jlink
deleted file mode 100644
index 1e3d542..0000000
--- a/flasher/file_info.jlink
+++ /dev/null
@@ -1,7 +0,0 @@
-define call1
-set $ImageSize = 0x11000
-set $ImageAddr = 0x0D0000
-end
-define call2
-FlasherWrite build/bin/WEBFiles.bin $ImageAddr $ImageSize
-end
diff --git a/flasher/gdb_wrfile.jlink b/flasher/gdb_wrfile.jlink
deleted file mode 100644
index b81e8c4..0000000
--- a/flasher/gdb_wrfile.jlink
+++ /dev/null
@@ -1,156 +0,0 @@
-###############
-# FlasherInit #
-###############
-define FlasherInit
-set $rtl8710_flasher_capacity = 0
-set $rtl8710_flasher_auto_erase = 1
-set $rtl8710_flasher_auto_verify = 1
-set $rtl8710_flasher_firmware_ptr = 0x10001000
-set $rtl8710_flasher_buffer = 0x10008000
-set $rtl8710_flasher_buffer_size = 421888
-set $rtl8710_flasher_sector_size = 4096
-set $rtl8710_flasher_auto_erase_sector = 0xFFFFFFFF
-end
-###############
-# FlasherWait #
-###############
-define FlasherWait
-set $fresult = {int}($rtl8710_flasher_buffer)
-while ($fresult != 0)
-set $fresult = {int}($rtl8710_flasher_buffer)
-end
-end
-###############
-# FlasherLoad #
-###############
-define FlasherLoad
-if $rtl8710_flasher_capacity == 0
- printf "initializing RTL8710 flasher\n"
- restore $arg0 binary $rtl8710_flasher_firmware_ptr 0 968
- monitor reset
- set $pc = $rtl8710_flasher_firmware_ptr
- set $sp = 0x1ffffffc
- set {int}($rtl8710_flasher_buffer + 0x08) = 0
- set {int}($rtl8710_flasher_buffer + 0x00) = 1
- #continue
- monitor go
- FlasherWait
- set $id = {int}($rtl8710_flasher_buffer + 0x0C)
- 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
- else
- printf "Flash ID = 0x%08x : (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10
- end
- printf "RTL8710 flasher initialized\n"
-else
-printf "reinitializing RTL8710 flasher\n"
-end
-end
-##################
-# FlasherWrBlock #
-##################
-define FlasherWrBlock
-#printf "FlashWrBlock 0x%08x, 0x%08x\n", $arg0, $arg1
-set {int}($rtl8710_flasher_buffer + 0x04) = 4
-set {int}($rtl8710_flasher_buffer + 0x08) = 0
-set {int}($rtl8710_flasher_buffer + 0x10) = $arg0
-set {int}($rtl8710_flasher_buffer + 0x14) = $arg1
-set {int}($rtl8710_flasher_buffer + 0x00) = 1
-FlasherWait
-set $status = {int}($rtl8710_flasher_buffer + 0x08)
-if $status > 0
- error "write error, offset 0x%08x", $arg0
-end
-end
-##################
-# FlasherVrBlock #
-##################
-define FlasherVrBlock
-#printf "FlashVrBlock 0x%08x, 0x%08x\n", $arg0, $arg1
-set {int}($rtl8710_flasher_buffer + 0x04) = 5
-set {int}($rtl8710_flasher_buffer + 0x08) = 0
-set {int}($rtl8710_flasher_buffer + 0x10) = $arg0
-set {int}($rtl8710_flasher_buffer + 0x14) = $arg1
-set {int}($rtl8710_flasher_buffer + 0x00) = 1
-FlasherWait
-set $status = {int}($rtl8710_flasher_buffer + 0x08)
-if $status > 0
- set $status = {int}($rtl8710_flasher_buffer + 0x0C)
- set $status = {int}($status + $arg0)
- error "verify error, offset 0x%08x", $status
-end
-end
-#################
-# FlashSecErase #
-#################
-define FlashSecErase
-#printf "FlashSecErase 0x%08x, 0x%08x\n", $rtl8710_flasher_buffer, $arg0
-set {int}($rtl8710_flasher_buffer + 0x04) = 2
-set {int}($rtl8710_flasher_buffer + 0x08) = 0
-set {int}($rtl8710_flasher_buffer + 0x10) = $arg0
-set {int}($rtl8710_flasher_buffer + 0x00) = 1
-FlasherWait
-end
-################
-# FlasherWrite #
-################
-define FlasherWrite
-set $sector = 0
-set $offset = 0
-set $size = $arg2
-while $offset < $size
- set $len = $size - $offset
- if $len > $rtl8710_flasher_buffer_size
- set $len = $rtl8710_flasher_buffer_size
- end
- set $flash_offset = $arg1 + $offset
- printf "write offset 0x%08x\n", $flash_offset
- set $parms1 = $rtl8710_flasher_buffer + 0x20 - $offset
- set $parms2 = $offset
- set $parms3 = $offset + $len
- restore $arg0 binary $parms1 $parms2 $parms3
- if $rtl8710_flasher_auto_erase != 0
- set $count_i = $flash_offset
- while $count_i < ($flash_offset + $len)
- set $sector = $count_i/$rtl8710_flasher_sector_size
- if $rtl8710_flasher_auto_erase_sector != $sector
- set $parms1 = $sector * $rtl8710_flasher_sector_size
- printf "erase sector %d at 0x%08x\n", $sector, $parms1
- FlashSecErase $parms1
- set $rtl8710_flasher_auto_erase_sector = $sector
- end
- set $count_i = $count_i + 1
- end
- end
- FlasherWrBlock $flash_offset $len
- printf "wrote %d bytes at 0x%08x\n", $len, $flash_offset
- if $rtl8710_flasher_auto_verify != 0
- printf "verify offset 0x%08x len %d\n", $flash_offset, $len
- FlasherVrBlock $flash_offset $len
- end
- set $offset = $offset + $rtl8710_flasher_buffer_size
-end
-end
-#########################################
-source -v flasher/gdb_flasher.jlink
-source -v flasher/file_info.jlink
-InitJlink
-SystemInit
-SetClk83MHz
-SPI_Init
-FlasherInit
-FlasherLoad flasher/rtl8710_flasher.bin
-call1
-if $ImageSize != 0
-set $ImageEnd = $ImageSize + $ImageAddr + 0x4000
-if $rtl8710_flasher_capacity >= $ImageEnd
- printf "Write Image size %d to Flash addr 0x%08x:\n", $ImageSize, $ImageAddr
- call2
-else
- printf "Error: Image size is too big!\n"
-end
-else
- printf "Error: Image size is zero!\n"
-end
-quit
diff --git a/flasher/gdb_wrflash.jlink b/flasher/gdb_wrflash.jlink
index 6d37642..4a4af92 100644
--- a/flasher/gdb_wrflash.jlink
+++ b/flasher/gdb_wrflash.jlink
@@ -7,6 +7,7 @@ set $rtl8710_flasher_auto_erase = 1
set $rtl8710_flasher_auto_verify = 1
set $rtl8710_flasher_firmware_ptr = 0x10001000
set $rtl8710_flasher_buffer = 0x10008000
+#262144
set $rtl8710_flasher_buffer_size = 421888
set $rtl8710_flasher_sector_size = 4096
set $rtl8710_flasher_auto_erase_sector = 0xFFFFFFFF
@@ -36,11 +37,12 @@ if $rtl8710_flasher_capacity == 0
monitor go
FlasherWait
set $id = {int}($rtl8710_flasher_buffer + 0x0C)
- set $rtl8710_flasher_capacity = 1 << (($id >> 16) & 0x0ff)
if ($id == 0x1420c2)
+ set $rtl8710_flasher_capacity = 1 << (($id >> 16) & 0x0ff)
printf "Flash ID = 0x%08x : MX25L8006E (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10
else
- printf "Flash ID = 0x%08x : (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10
+ set $rtl8710_flasher_capacity = 1024*1024)
+ error "Flash ID = 0x%08x : ?\n", $id
end
printf "RTL8710 flasher initialized\n"
else
@@ -106,9 +108,9 @@ while $offset < $size
end
set $flash_offset = $arg1 + $offset
printf "write offset 0x%08x\n", $flash_offset
- set $parms1 = $rtl8710_flasher_buffer + 0x20 - $flash_offset
- set $parms2 = $flash_offset
- set $parms3 = $flash_offset + $len
+ set $parms1 = $rtl8710_flasher_buffer + 0x20 - $offset - $arg1
+ set $parms2 = $offset + $arg1
+ set $parms3 = $offset + $len + $arg1
restore $arg0 binary $parms1 $parms2 $parms3
if $rtl8710_flasher_auto_erase != 0
set $count_i = $flash_offset
diff --git a/paths.mk b/paths.mk
deleted file mode 100644
index a7154c4..0000000
--- a/paths.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#---------------------------
-# User defined
-#---------------------------
-SDK_PATH = ../RTL00MP3/RTL00_SDKV35a/
-#GCC_PATH = d:/MCU/GNU_Tools_ARM_Embedded/5.2_2015q4/bin/# + or set in PATH
-#OPENOCD_PATH = d:/MCU/OpenOCD/bin/# + or set in PATH
-TOOLS_PATH ?= $(SDK_PATH)component/soc/realtek/8195a/misc/iar_utility/common/tools/
-FLASHER_TYPE ?= Jlink
-#FLASHER_TYPE ?= OCD
-FLASHER_PATH ?= flasher/
-JLINK_PATH ?= D:/MCU/SEGGER/JLink_V612i/
-JLINK_GDBSRV ?= JLinkGDBServer.exe
-#---------------------------
-# Default
-#---------------------------
-# Compilation tools
-CROSS_COMPILE = $(GCC_PATH)arm-none-eabi-
-AR = $(CROSS_COMPILE)ar
-CC = $(CROSS_COMPILE)gcc
-AS = $(CROSS_COMPILE)as
-NM = $(CROSS_COMPILE)nm
-LD = $(CROSS_COMPILE)gcc
-GDB = $(CROSS_COMPILE)gdb
-SIZE = $(CROSS_COMPILE)size
-OBJCOPY = $(CROSS_COMPILE)objcopy
-OBJDUMP = $(CROSS_COMPILE)objdump
-
-# TARGET dirs
-TARGET ?= build
-OBJ_DIR ?= $(TARGET)/obj
-BIN_DIR ?= $(TARGET)/bin
-ELFFILE ?= $(OBJ_DIR)/$(TARGET).axf
-
-# Make bunary tools
-ifneq ($(shell uname), Linux)
-EXE = .exe
-endif
-PICK = $(TOOLS_PATH)pick$(EXE)
-PADDING = $(TOOLS_PATH)padding$(EXE)
-CHCKSUM = $(TOOLS_PATH)checksum$(EXE)
-
-# openocd tools
-OPENOCD = $(OPENOCD_PATH)openocd
-
diff --git a/project.mk b/project.mk
new file mode 100644
index 0000000..a0cb30d
--- /dev/null
+++ b/project.mk
@@ -0,0 +1,51 @@
+#=============================================
+# SDK CONFIG
+#=============================================
+WEB_INA219_DRV = 1
+#USE_AT = 1
+#USE_FATFS = 1
+#USE_SDIOH = 1
+#USE_POLARSSL = 1
+#USE_P2P_WPS = 1
+#USE_GCC_LIB = 1
+USE_MBED = 1
+
+ifndef USE_AT
+USE_NEWCONSOLE = 1
+USE_WIFI_API = 1
+endif
+
+#RTOSDIR=freertos_v8.1.2
+RTOSDIR=freertos_v9.0.0
+LWIPDIR=lwip_v1.4.1
+
+include $(SDK_PATH)sdkset.mk
+#CFLAGS += -DDEFAULT_BAUDRATE=1562500
+CFLAGS += -DLOGUART_STACK_SIZE=1024
+#=============================================
+# User Files
+#=============================================
+#user main
+ADD_SRC_C += project/src/user/main.c
+ADD_SRC_C += project/src/user/user_start.c
+# components
+ADD_SRC_C += project/src/console/atcmd_user.c
+ADD_SRC_C += project/src/console/wifi_console.c
+#ADD_SRC_C += project/src/console/pwm_tst.c
+ifdef WEB_INA219_DRV
+ADD_SRC_C += project/src/driver/i2c_drv.c
+ADD_SRC_C += project/src/ina219/ina219drv.c
+CFLAGS += -DWEB_INA219_DRV=1
+endif
+
+#Web-������
+INCLUDES += project/inc/web
+ADD_SRC_C += project/src/tcpsrv/tcp_srv_conn.c
+ADD_SRC_C += project/src/webfs/webfs.c
+ADD_SRC_C += project/src/web/web_srv.c
+ADD_SRC_C += project/src/web/web_utils.c
+ADD_SRC_C += project/src/web/web_websocket.c
+ADD_SRC_C += project/src/web/websock.c
+ADD_SRC_C += project/src/web/web_int_callbacks.c
+ADD_SRC_C += project/src/web/web_int_vars.c
+ADD_SRC_C += project/src/web/web_auth.c
diff --git a/project/inc/user_config.h b/project/inc/user_config.h
index d3587ce..bef91de 100644
--- a/project/inc/user_config.h
+++ b/project/inc/user_config.h
@@ -11,7 +11,7 @@
#define WEB_DEBUG_FUNCTIONS 1 // =1 - включить в WEB отладочные функции, =0 отключить (остается только конфигурация WiFi)
-#define WEB_INA219_DRV 1
+// #define WEB_INA219_DRV 1 (set in project.mk)
#endif // _user_config_h_
diff --git a/sdkbuild.mk b/sdkbuild.mk
deleted file mode 100644
index 5291d37..0000000
--- a/sdkbuild.mk
+++ /dev/null
@@ -1,93 +0,0 @@
-
-include sdkset.mk
-include paths.mk
-
-INCFLAGS = $(patsubst %,-I%,$(patsubst sdk/%,$(SDK_PATH)%,$(INCLUDES)))
-
-LIBFLAGS = $(addprefix -L,$(patsubst sdk/%,$(SDK_PATH)%,$(PATHLIBS))) $(addprefix -l,$(LIBS))
-
-LFLAGS += -Wl,-Map=$(OBJ_DIR)/$(TARGET).map
-
-CFLAGS += $(INCFLAGS)
-
-SRC_O = $(patsubst %.c,%.o,$(patsubst sdk/%,$(SDK_PATH)%,$(ADD_SRC_C))) $(patsubst %.c,%.o,$(patsubst sdk/%,$(SDK_PATH)%,$(SRC_C)))
-DRAM_O = $(patsubst %.c,%.o,$(patsubst sdk/%,$(SDK_PATH)%,$(DRAM_C)))
-BOOT_O = $(patsubst %.c,%.o,$(patsubst sdk/%,$(SDK_PATH)%,$(BOOT_C)))
-
-SRC_C_LIST = $(patsubst sdk/%,$(SDK_PATH)%,$(ADD_SRC_C)) $(patsubst sdk/%,$(SDK_PATH)%,$(SRC_C)) $(patsubst sdk/%,$(SDK_PATH)%,$(DRAM_C)) $(patsubst sdk/%,$(SDK_PATH)%,$(BOOT_C))
-OBJ_LIST = $(addprefix $(OBJ_DIR)/,$(patsubst %.c,%.o,$(SRC_C_LIST)))
-DEPENDENCY_LIST = $(patsubst %.c,$(OBJ_DIR)/%.d,$(SRC_C_LIST))
-
-TARGET ?= build
-OBJ_DIR ?= $(TARGET)/obj
-BIN_DIR ?= $(TARGET)/bin
-ELFFILE ?= $(OBJ_DIR)/$(TARGET).axf
-
-all: prerequirement application
-mp: prerequirement application
-
-.PHONY: build_info
-build_info:
- @echo \#define UTS_VERSION \"`date +%Y/%m/%d-%T`\" > .ver
- @echo \#define RTL8195AFW_COMPILE_TIME \"`date +%Y/%m/%d-%T`\" >> .ver
- @echo \#define RTL8195AFW_COMPILE_DATE \"`date +%Y%m%d`\" >> .ver
- @echo \#define RTL8195AFW_COMPILE_BY \"`id -u -n`\" >> .ver
- @echo \#define RTL8195AFW_COMPILE_HOST \"`$(HOSTNAME_APP)`\" >> .ver
- @if [ -x /bin/dnsdomainname ]; then \
- echo \#define RTL8195AFW_COMPILE_DOMAIN \"`dnsdomainname`\"; \
- elif [ -x /bin/domainname ]; then \
- echo \#define RTL8195AFW_COMPILE_DOMAIN \"`domainname`\"; \
- else \
- echo \#define RTL8195AFW_COMPILE_DOMAIN ; \
- fi >> .ver
- @echo \#define RTL195AFW_COMPILER \"gcc `$(CC) $(CFLAGS) -dumpversion | tr --delete '\r'`\" >> .ver
- @mv -f .ver project/inc/$@.h
-
-.PHONY: application
-application: build_info $(SRC_O) $(DRAM_O) $(BOOT_O)
- @echo "==========================================================="
- @echo "Link ($(TARGET))"
-# @echo "==========================================================="
- @mkdir -p $(BIN_DIR) $(OBJ_DIR)
- @$(file > $(OBJ_DIR)/obj_list.lst,$(OBJ_LIST))
- @$(LD) $(LFLAGS) -o $(ELFFILE) @$(OBJ_DIR)/obj_list.lst $(LIBFLAGS) -T$(LDFILE)
- @$(OBJDUMP) -d $(ELFFILE) > $(OBJ_DIR)/$(TARGET).asm
-
-.PHONY: prerequirement
-#.NOTPARALLEL: prerequirement
-prerequirement:
-# @$(file >DEPENDENCY_LIST.txt,$(DEPENDENCY_LIST))
- @echo "==========================================================="
- @echo "Compile ($(TARGET))"
-# @echo "==========================================================="
- @mkdir -p $(OBJ_DIR)
-
-$(SRC_O): %.o : %.c
- @echo $<
- @mkdir -p $(OBJ_DIR)/$(dir $@)
- @$(CC) $(CFLAGS) $(INCFLAGS) -c $< -o $(OBJ_DIR)/$@
- @$(CC) -MM $(CFLAGS) $(INCFLAGS) $< -MT $@ -MF $(OBJ_DIR)/$(patsubst %.o,%.d,$@)
-
-$(DRAM_O): %.o : %.c
- @echo $<
- @mkdir -p $(OBJ_DIR)/$(dir $@)
- @$(CC) $(CFLAGS) $(INCFLAGS) -c $< -o $(OBJ_DIR)/$@
- @$(OBJCOPY) --prefix-alloc-sections .sdram $(OBJ_DIR)/$@
- @$(CC) -MM $(CFLAGS) $(INCFLAGS) $< -MT $@ -MF $(OBJ_DIR)/$(patsubst %.o,%.d,$@)
-
-$(BOOT_O): %.o : %.c
- @echo $<
- @mkdir -p $(OBJ_DIR)/$(dir $@)
- @$(CC) $(CFLAGS) $(INCFLAGS) -c $< -o $(OBJ_DIR)/$@
- @$(OBJCOPY) --prefix-alloc-sections .boot $(OBJ_DIR)/$@
- @$(CC) -MM $(CFLAGS) $(INCFLAGS) $< -MT $@ -MF $(OBJ_DIR)/$(patsubst %.o,%.d,$@)
-
--include $(DEPENDENCY_LIST)
-
-VPATH:=$(OBJ_DIR) $(SDK_PATH)
-
-#.PHONY: clean
-clean:
- rm -rf $(OBJ_DIR) $(BIN_DIR) $(OBJ_DIR)/$(SDK_PATH)
-
-
\ No newline at end of file
diff --git a/sdkset.mk b/sdkset.mk
deleted file mode 100644
index 7c7433f..0000000
--- a/sdkset.mk
+++ /dev/null
@@ -1,469 +0,0 @@
-WEB_INA219_DRV = 1
-
-#USE_AT = 1
-#USE_FATFS = 1
-#USE_SDIOH = 1
-#USE_POLARSSL = 1
-#USE_P2P_WPS = 1
-ifndef USE_AT
-USE_NEWCONSOLE = 1
-USE_WIFI_API = 1
-endif
-USE_MBED = 1
-
-#RTOSDIR=freertos_v8.1.2
-RTOSDIR=freertos_v9.0.0
-LWIPDIR=lwip_v1.4.1
-
-# FLAGS
-# -------------------------------------------------------------------
-CFLAGS = -DM3 -DCONFIG_PLATFORM_8195A -DGCC_ARMCM3 -DARDUINO_SDK -DF_CPU=166666666L -DNDEBUG
-CFLAGS += -mcpu=cortex-m3 -mthumb -g2 -Os -std=gnu99 -Wall -Werror
-CFLAGS += -fno-common -fmessage-length=0 -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-short-enums -fsigned-char
-CFLAGS += -w -Wno-pointer-sign
-LFLAGS = -mcpu=cortex-m3 -mthumb -g -Os -nostartfiles -nostdlib
-#--specs=nano.specs
-LFLAGS += -Wl,--gc-sections -Wl,--cref -Wl,--entry=Reset_Handler -Wl,--no-enum-size-warning -Wl,--no-wchar-size-warning -Wl,-nostdlib
-
-# LIBS
-# -------------------------------------------------------------------
-LIBS =
-all: LIBS +=_platform_new _wlan _p2p _wps _websocket _sdcard _xmodem _mdns
-# m c nosys gcc
-mp: LIBS +=_platform_new _wlan_mp _wps _p2p _websocket _sdcard _xmodem _mdns
-PATHLIBS = sdk/component/soc/realtek/8195a/misc/bsp/lib/common/gcc
-LDFILE = rlx8195A-symbol-v04-img2.ld
-BOOTS = sdk/component/soc/realtek/8195a/misc/bsp/image
-
-# Include folder list
-# -------------------------------------------------------------------
-INCLUDES = ../inc
-INCLUDES += project/inc
-INCLUDES += sdk/component/soc/realtek/common/bsp
-INCLUDES += sdk/component/os/freertos
-INCLUDES += sdk/component/os/freertos/$(RTOSDIR)/Source/include
-INCLUDES += sdk/component/os/freertos/$(RTOSDIR)/Source/portable/GCC/ARM_CM3
-INCLUDES += sdk/component/os/os_dep/include sdk/component/soc/realtek/8195a/misc/driver
-INCLUDES += sdk/component/common/api/network/include
-INCLUDES += sdk/component/common/api
-INCLUDES += sdk/component/common/api/platform
-INCLUDES += sdk/component/common/api/wifi
-INCLUDES += sdk/component/common/api/wifi/rtw_wpa_supplicant/src
-INCLUDES += sdk/component/common/network
-INCLUDES += sdk/component/common/network/lwip/$(LWIPDIR)/port/realtek/freertos
-INCLUDES += sdk/component/common/network/lwip/$(LWIPDIR)/src/include
-INCLUDES += sdk/component/common/network/lwip/$(LWIPDIR)/src/include/lwip
-INCLUDES += sdk/component/common/network/lwip/$(LWIPDIR)/src/include/ipv4
-INCLUDES += sdk/component/common/network/lwip/$(LWIPDIR)/port/realtek
-INCLUDES += sdk/component/common/test
-INCLUDES += sdk/component/soc/realtek/8195a/cmsis
-INCLUDES += sdk/component/soc/realtek/8195a/cmsis/device
-INCLUDES += sdk/component/soc/realtek/8195a/fwlib
-INCLUDES += sdk/component/soc/realtek/8195a/fwlib/rtl8195a
-INCLUDES += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/
-INCLUDES += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/include
-INCLUDES += sdk/component/common/drivers
-INCLUDES += sdk/component/common/drivers/i2s
-INCLUDES += sdk/component/common/drivers/wlan/realtek/include
-INCLUDES += sdk/component/common/drivers/wlan/realtek/src/osdep
-INCLUDES += sdk/component/common/drivers/wlan/realtek/src/hci
-INCLUDES += sdk/component/common/drivers/wlan/realtek/src/hal
-INCLUDES += sdk/component/common/drivers/wlan/realtek/src/hal/OUTSRC
-INCLUDES += sdk/component/common/drivers/sdio/realtek/sdio_host/inc
-INCLUDES += sdk/component/soc/realtek/8195a/fwlib/ram_lib/wlan/realtek/wlan_ram_map/rom
-INCLUDES += sdk/component/common/network/ssl/ssl_ram_map/rom
-#INCLUDES += sdk/component/common/media/codec
-#INCLUDES += sdk/component/common/drivers/usb_class/host/uvc/inc
-#INCLUDES += sdk/component/common/drivers/usb_class/device
-#INCLUDES += sdk/component/common/drivers/usb_class/device/class
-#INCLUDES += sdk/component/soc/realtek/8195a/fwlib/ram_lib/usb_otg/include
-
-# Source file list
-# -------------------------------------------------------------------
-SRC_C =
-DRAM_C =
-BOOT_C =
-
-#bootloader
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/ram_lib/rtl_bios_data.c
-BOOT_C += sdk/component/soc/realtek/8195a/fwlib/ram_lib/rtl_boot.c
-
-#cmsis
-SRC_C += sdk/component/soc/realtek/8195a/cmsis/device/system_8195a.c
-
-#console new/old
-ifdef USE_NEWCONSOLE
-SRC_C += sdk/component/soc/realtek/8195a/misc/driver/rtl_console_new.c
-else
-SRC_C += sdk/component/common/api/at_cmd/log_service.c
-SRC_C += sdk/component/soc/realtek/8195a/misc/driver/rtl_consol.c
-endif
-ifdef USE_AT
-DRAM_C += sdk/component/common/api/at_cmd/atcmd_ethernet.c
-DRAM_C += sdk/component/common/api/at_cmd/atcmd_lwip.c
-DRAM_C += sdk/component/common/api/at_cmd/atcmd_sys.c
-DRAM_C += sdk/component/common/api/at_cmd/atcmd_wifi.c
-endif
-#SRC_C += sdk/component/soc/realtek/8195a/misc/driver/low_level_io.c
-
-#network - api
-ifdef USE_P2P_WPS
-SRC_C += sdk/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_p2p_config.c
-SRC_C += sdk/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_wps_config.c
-endif
-SRC_C += sdk/component/common/api/wifi/rtw_wpa_supplicant/wpa_supplicant/wifi_eap_config.c
-SRC_C += sdk/component/common/api/wifi/wifi_conf.c
-SRC_C += sdk/component/common/api/wifi/wifi_ind.c
-SRC_C += sdk/component/common/api/wifi/wifi_promisc.c
-SRC_C += sdk/component/common/api/wifi/wifi_simple_config.c
-SRC_C += sdk/component/common/api/wifi/wifi_util.c
-SRC_C += sdk/component/common/api/lwip_netconf.c
-ifdef USE_WIFI_API
-SRC_C += sdk/component/common/api/wifi_api.c
-SRC_C += sdk/component/common/api/wifi_api_scan.c
-endif
-
-#network - lwip
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/api_lib.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/api_msg.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/err.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/netbuf.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/netdb.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/netifapi.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/sockets.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/api/tcpip.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/autoip.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/icmp.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/igmp.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/inet.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/inet_chksum.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/ip.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/ip_addr.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/ipv4/ip_frag.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/def.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/dhcp.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/dns.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/init.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/lwip_timers.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/mem.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/memp.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/netif.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/pbuf.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/raw.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/stats.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/sys.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/tcp.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/tcp_in.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/tcp_out.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/core/udp.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/src/netif/etharp.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/port/realtek/freertos/ethernetif.c
-SRC_C += sdk/component/common/drivers/wlan/realtek/src/osdep/lwip_intf.c
-SRC_C += sdk/component/common/network/lwip/$(LWIPDIR)/port/realtek/freertos/sys_arch.c
-SRC_C += sdk/component/common/network/dhcp/dhcps.c
-SRC_C += sdk/component/common/network/sntp/sntp.c
-SRC_C += sdk/component/common/network/netbios/netbios.c
-
-#network - mdns
-#SRC_C += sdk/component/common/network/mDNS/mDNSPlatform.c
-
-#os - freertos
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/portable/MemMang/heap_5.c
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/portable/GCC/ARM_CM3/port.c
-SRC_C += sdk/component/os/freertos/cmsis_os.c
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/croutine.c
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/event_groups.c
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/list.c
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/queue.c
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/tasks.c
-SRC_C += sdk/component/os/freertos/$(RTOSDIR)/Source/timers.c
-
-#os - osdep
-SRC_C += sdk/component/os/os_dep/device_lock.c
-SRC_C += sdk/component/os/freertos/freertos_service.c
-SRC_C += sdk/component/os/os_dep/mailbox.c
-SRC_C += sdk/component/os/os_dep/osdep_api.c
-SRC_C += sdk/component/os/os_dep/osdep_service.c
-SRC_C += sdk/component/os/os_dep/tcm_heap.c
-
-ifdef USE_MBED
-#peripheral - api
-INCLUDES += sdk/component/common/mbed/api
-INCLUDES += sdk/component/common/mbed/hal
-INCLUDES += sdk/component/common/mbed/hal_ext
-INCLUDES += sdk/component/common/mbed/targets/hal/rtl8195a
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/analogin_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/dma_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/efuse_api.c
-#SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/ethernet_api.c
-#SRC_C += sdk/component/common/drivers/ethernet_mii/ethernet_mii.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/flash_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/gpio_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/gpio_irq_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/i2c_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/i2s_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/log_uart_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/nfc_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/pinmap.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/pinmap_common.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/port_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/pwmout_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/rtc_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/serial_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/sleep.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/spdio_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/spi_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/sys_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/timer_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/us_ticker.c
-SRC_C += sdk/component/common/mbed/common/us_ticker_api.c
-SRC_C += sdk/component/common/mbed/common/wait_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/wdt_api.c
-SRC_C += sdk/component/common/mbed/targets/hal/rtl8195a/flash_eep.c
-endif
-
-#peripheral - hal
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_32k.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_adc.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_gdma.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_gpio.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_i2c.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_i2s.c
-#SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_mii.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_nfc.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_pcm.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_pwm.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_sdr_controller.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_ssi.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_timer.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_uart.c
-ifdef USE_SDIOH
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c
-SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sd.c
-SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c
-endif
-
-#peripheral - osdep
-SRC_C += sdk/component/os/freertos/freertos_pmu.c
-
-#peripheral - rtl8195a
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_adc.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_gdma.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_gpio.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_i2c.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_i2s.c
-#SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_mii.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_nfc.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_pwm.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_ssi.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_timer.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_uart.c
-
-#peripheral - wlan
-#SRC_C += sdk/component/common/drivers/wlan/realtek/src/core/option/rtw_opt_skbuf.c
-
-#SDRAM
-#DRAM_C += sdk/component/common/api/platform/stdlib_patch.c
-#SDRAM - polarssl
-ifdef USE_POLARSSL
-INCLUDES += sdk/component/common/network/ssl/polarssl-1.3.8/include
-
-SRC_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/bignum.c
-
-DRAM_C += sdk/component/common/network/ssl/ssl_ram_map/rom/rom_ssl_ram_map.c
-DRAM_C += sdk/component/common/network/ssl/ssl_ram_map/ssl_ram_map.c
-
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/aes.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/aesni.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/arc4.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/asn1parse.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/asn1write.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/base64.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/blowfish.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/camellia.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ccm.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/certs.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/cipher.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/cipher_wrap.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ctr_drbg.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/debug.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/des.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/dhm.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ecp.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ecp_curves.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ecdh.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ecdsa.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/entropy.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/entropy_poll.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/error.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/gcm.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/havege.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/hmac_drbg.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/md.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/md_wrap.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/md2.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/md4.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/md5.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/memory_buffer_alloc.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/net.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/oid.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/padlock.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pbkdf2.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pem.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pkcs5.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pkcs11.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pkcs12.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pk.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pk_wrap.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pkparse.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/pkwrite.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/platform.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ripemd160.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/rsa.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/sha1.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/sha256.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/sha512.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ssl_cache.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ssl_ciphersuites.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ssl_cli.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ssl_srv.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/threading.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/timing.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/version.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/version_features.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/x509.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/x509_crt.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/x509_crl.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/x509_csr.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/x509_create.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/x509write_crt.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/x509write_csr.c
-DRAM_C += sdk/component/common/network/ssl/polarssl-1.3.8/library/xtea.c
-endif
-
-#utilities - FatFS
-ifdef USE_FATFS
-INCLUDES += sdk/component/common/file_system/fatfs
-INCLUDES += sdk/component/common/file_system/fatfs/r0.10c/include
-SRC_C += sdk/component/common/file_system/fatfs/fatfs_ext/src/ff_driver.c
-SRC_C += sdk/component/common/file_system/fatfs/r0.10c/src/diskio.c
-SRC_C += sdk/component/common/file_system/fatfs/r0.10c/src/ff.c
-SRC_C += sdk/component/common/file_system/fatfs/r0.10c/src/option/ccsbcs.c
-ifdef USE_SDIOH
-SRC_C += sdk/component/common/file_system/fatfs/disk_if/src/sdcard.c
-endif
-endif
-
-# Reversed SDK component
-#ADD_SRC_C += sdk/component/soc/realtek/8195a/cmsis/device/app_start.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_dac.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_common.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_soc_ps_monitor.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_efuse.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_log_uart.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_pinmux.c
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_misc.c
-#ADD_SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_spi_flash_ram.c
-# Component clib, ...
-SRC_C += sdk/component/soc/realtek/8195a/fwlib/ram_lib/startup.c
-SRC_C += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/ram_libc.c
-SRC_C += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/ram_libgloss_retarget.c
-SRC_C += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/rtl_eabi_cast_ram.c
-SRC_C += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/rtl_math_ram.c
-#if +- nostdlib..
-SRC_C += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/ram_pvvx_libc.c
-#if c_printf() float
-SRC_C += sdk/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/c_stdio.c
-# -------------------------------------------------------------------
-# Add Source file list
-# -------------------------------------------------------------------
-ADD_SRC_C =
-# -------------------------------------------------------------------
-# SAMPLES
-# -------------------------------------------------------------------
-ifdef USE_AT
-INCLUDES += sdk/component/common/utilities
-ADD_SRC_C += sdk/component/common/api/network/src/wlan_network.c
-ADD_SRC_C += sdk/component/common/api/wifi_interactive_mode.c
-ADD_SRC_C += sdk/component/common/api/network/src/ping_test.c
-ADD_SRC_C += sdk/component/common/utilities/webserver.c
-ADD_SRC_C += sdk/component/common/utilities/tcptest.c
-ADD_SRC_C += sdk/component/common/utilities/update.c
-INCLUDES += sdk/component/common/example
-INCLUDES += sdk/component/common/example/wlan_fast_connect
-ADD_SRC_C += sdk/component/common/example/wlan_fast_connect/example_wlan_fast_connect.c
-ADD_SRC_C += sdk/component/common/example/uart_atcmd/example_uart_atcmd.c
-ADD_SRC_C += sdk/component/common/example/example_entry.c
-ADD_SRC_C += sdk/component/common/application/xmodem/uart_fw_update.c
-endif
-#application
-#INCLUDES += sdk/component/common/application/apple/WACServer/External/Curve25519
-#INCLUDES += sdk/component/common/application/apple/WACServer/External/GladmanAES
-#INCLUDES += sdk/component/common/audio
-#INCLUDES += sdk/component/common/application/xmodem
-#INCLUDES += sdk/component/common/application
-#INCLUDES += sdk/component/common/application/iotdemokit
-#INCLUDES += sdk/component/common/application/google
-#INCLUDES += sdk/component/common/media/framework
-#SDRAM - wigadget
-#DRAM_C += sdk/component/common/application/wigadget/cloud_link.c
-#DRAM_C += sdk/component/common/application/wigadget/shtc1.c
-#DRAM_C += sdk/component/common/application/wigadget/wigadget.c
-
-#utilities
-#ADD_SRC_C += sdk/component/common/utilities/cJSON.c
-#ADD_SRC_C += sdk/component/common/utilities/http_client.c
-#ADD_SRC_C += sdk/component/common/utilities/uart_socket.c
-#ADD_SRC_C += sdk/component/common/utilities/xml.c
-#ADD_SRC_C += sdk/component/common/utilities/ssl_client.c
-#ADD_SRC_C += sdk/component/common/utilities/ssl_client_ext.c
-#ADD_SRC_C += sdk/component/common/utilities/uart_ymodem.c
-#ADD_SRC_C += sdk/component/common/application/uart_adapter/uart_adapter.c
-#ADD_SRC_C += sdk/component/common/example/cJSON/cJSON_example.c
-#ADD_SRC_C += sdk/component/common/example/googlenest/example_google.c
-#ADD_SRC_C += sdk/component/common/example/mdns/example_mdns.c
-#ADD_SRC_C += sdk/component/common/example/socket_select/example_socket_select.c
-#ADD_SRC_C += sdk/component/common/example/xml/example_xml.c
-
-#=============================================
-# PROGECT
-#=============================================
-#user main
-ADD_SRC_C += project/src/user/main.c
-ADD_SRC_C += project/src/user/user_start.c
-# components
-ADD_SRC_C += project/src/console/atcmd_user.c
-ADD_SRC_C += project/src/console/wifi_console.c
-#ADD_SRC_C += project/src/console/pwm_tst.c
-#ADD_SRC_C += project/src/console/wlan_tst.c
-#ADD_SRC_C += project/src/ina219/ina219drv.c
-ifdef WEB_INA219_DRV
-ADD_SRC_C += project/src/driver/i2c_drv.c
-ADD_SRC_C += project/src/ina219/ina219drv.c
-CFLAGS += -DWEB_INA219_DRV=1
-endif
-
-#Web-свалка
-INCLUDES += project/inc/web
-ADD_SRC_C += project/src/tcpsrv/tcp_srv_conn.c
-ADD_SRC_C += project/src/webfs/webfs.c
-ADD_SRC_C += project/src/web/web_srv.c
-ADD_SRC_C += project/src/web/web_utils.c
-ADD_SRC_C += project/src/web/web_websocket.c
-ADD_SRC_C += project/src/web/websock.c
-ADD_SRC_C += project/src/web/web_int_callbacks.c
-ADD_SRC_C += project/src/web/web_int_vars.c
-ADD_SRC_C += project/src/web/web_auth.c
-
-#CFLAGS += -DDEFAULT_BAUDRATE=1562500
-#if CONFIG_ENABLE_P2P and ...:
-CFLAGS += -DLOGUART_STACK_SIZE=1024
-
-#LwIP HTTPd
-#include project/src/LwHTTPd/LwHTTPd.mk
-
-#WebSocket Client
-#ADD_SRC_C += project/src/console/ws_test.c
-#include websocket/module.mk
-#=============================================
diff --git a/userset.mk b/userset.mk
new file mode 100644
index 0000000..fe4d3d2
--- /dev/null
+++ b/userset.mk
@@ -0,0 +1,12 @@
+#=============================================
+# User defined
+#=============================================
+SDK_PATH ?= ../RTL00MP3/RTL00_SDKV35a/
+#GCC_PATH = d:/MCU/GNU_Tools_ARM_Embedded/5.2_2015q4/bin/# + or set in PATH
+#OPENOCD_PATH = d:/MCU/OpenOCD/bin/# + or set in PATH
+TOOLS_PATH ?= $(SDK_PATH)component/soc/realtek/8195a/misc/iar_utility/common/tools/
+FLASHER_TYPE ?= Jlink
+#FLASHER_TYPE ?= OCD
+FLASHER_PATH ?= flasher/
+JLINK_PATH ?= D:/MCU/SEGGER/JLink_V612i/
+JLINK_GDBSRV ?= JLinkGDBServer.exe
diff --git a/webfs.mk b/webfs.mk
index e8a6656..3830a63 100644
--- a/webfs.mk
+++ b/webfs.mk
@@ -1,4 +1,5 @@
-include paths.mk
+include userset.mk
+include $(SDK_PATH)paths.mk
all:
@mkdir -p $(BIN_DIR)