diff --git a/.cproject b/.cproject
index 283211f..6a1728a 100644
--- a/.cproject
+++ b/.cproject
@@ -612,6 +612,7 @@
+
@@ -678,14 +679,6 @@
true
false
-
- mingw32-make.exe
- -s
- setup GDB_SERVER=jlink
- true
- true
- false
-
mingw32-make.exe
-s
@@ -694,7 +687,14 @@
true
true
+
+ mingw32-make.exe
+ -s
+ runram
+ true
+ true
+ true
+
-
diff --git a/.project b/.project
index 1d31504..a3f1dc3 100644
--- a/.project
+++ b/.project
@@ -7,6 +7,7 @@
org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
diff --git a/JLinkGDB-RunRAM.bat b/JLinkGDB-RunRAM.bat
index c2ea134..8b80636 100644
--- a/JLinkGDB-RunRAM.bat
+++ b/JLinkGDB-RunRAM.bat
@@ -6,9 +6,9 @@ echo Build project...
mingw32-make.exe -f Makefile all
@if not exist build\obj\build.axf goto err
:run
-start JLinkGDBServerCL.exe -device Cortex-M3 -if SWD -ir -endian little -speed 3500
+start JLinkGDBServer.exe -device Cortex-M3 -if SWD -ir -endian little -speed 3500
arm-none-eabi-gdb.exe -x flasher/gdb_run_ram.jlink
-taskkill /F /IM JLinkGDBServerCL.exe
+taskkill /F /IM JLinkGDBServer.exe
goto end
:err
echo Error!
diff --git a/Makefile b/Makefile
index 566dc16..a0f3097 100644
--- a/Makefile
+++ b/Makefile
@@ -5,30 +5,27 @@ ram_all:
@$(MAKE) -f sdkbuild.mk
@$(MAKE) -f flasher.mk genbin23
-.PHONY: mp
-mp:
- @$(MAKE) -f sdkbuild.mk mp
- @$(MAKE) -f flasher.mk genbin23
-
-.PHONY: clean clean_all
+.PHONY: clean clean_all
clean:
@$(MAKE) -f sdkbuild.mk clean
+
clean_all:
@$(MAKE) -f sdkbuild.mk clean_all
-.PHONY: flash debug ramdebug setup
-setup: toolchain
- @$(MAKE) -f sdkbuild.mk $(MAKECMDGOALS)
-
-flashburn:
- @$(MAKE) -f flasher.mk flashburn
-
+.PHONY: debug ramdebug
debug:
@$(MAKE) -f application.mk debug
ramdebug:
@$(MAKE) -f application.mk ramdebug
+.PHONY: flashburn runram reset test readfullflash
+flashburn:
+ @$(MAKE) -f flasher.mk flashburn
+
+runram:
+ @$(MAKE) --f flasher.mk runram
+
reset:
@make -f flasher.mk reset
diff --git a/component/common/api/wifi/wifi_conf.c b/component/common/api/wifi/wifi_conf.c
index 7eb7314..fa08d27 100644
--- a/component/common/api/wifi/wifi_conf.c
+++ b/component/common/api/wifi/wifi_conf.c
@@ -391,7 +391,7 @@ int wifi_connect(
u8 wep_hex = 0;
u8 wep_pwd[14] = {0};
- if(rtw_join_status & JOIN_SIMPLE_CONFIG || rtw_join_status & JOIN_AIRKISS){
+ if((rtw_join_status & JOIN_SIMPLE_CONFIG) || (rtw_join_status & JOIN_AIRKISS)){
return RTW_ERROR;
}
@@ -556,7 +556,7 @@ int wifi_connect_bssid(
xSemaphoreHandle join_semaphore;
rtw_result_t result = RTW_SUCCESS;
- if(rtw_join_status & JOIN_SIMPLE_CONFIG || rtw_join_status & JOIN_AIRKISS){
+ if((rtw_join_status & JOIN_SIMPLE_CONFIG) || (rtw_join_status & JOIN_AIRKISS)){
return RTW_ERROR;
}
@@ -1265,7 +1265,7 @@ int wifi_scan_networks_with_ssid(int (results_handler)(char*buf, int buflen, cha
memcpy(scan_buf.buf+sizeof(int), ssid, ssid_len);
//Scan channel
- if(scan_cnt = (wifi_scan(RTW_SCAN_TYPE_ACTIVE, RTW_BSS_TYPE_ANY, &scan_buf)) < 0){
+ if((scan_cnt = (wifi_scan(RTW_SCAN_TYPE_ACTIVE, RTW_BSS_TYPE_ANY, &scan_buf))) < 0){
printf("\n\rERROR: wifi scan failed");
ret = RTW_ERROR;
}else{
diff --git a/flasher.mk b/flasher.mk
index 2bcdc10..85f71c0 100644
--- a/flasher.mk
+++ b/flasher.mk
@@ -5,6 +5,7 @@
#FLASHER = stlink-v2-1
#FLASHER = stlink-v2
FLASHER ?= Jlink
+JLINK_PATH ?= D:/MCU/SEGGER/JLink_V610a/
#---------------------------
# Default
#---------------------------
@@ -38,6 +39,9 @@ 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
@@ -96,11 +100,18 @@ _endgenbin:
@echo "Image ($(FLASH_IMAGE)) size $(shell printf '%d\n' $$(( $$(stat --printf="%s" $(FLASH_IMAGE)) )) ) bytes"
@echo "==========================================================="
-flashburn:
+flashburn:
@$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" -c "rtl8710_flash_write $(FLASH_IMAGE) 0" -c "rtl8710_reboot" -c "reset run" -c shutdown
+# @$(JLINK_PATH)$(JLINK_GDB)
reset:
- @$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_reboot" -c shutdown
+ @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed $(FLASHER_SPEED) flasher/RTLreset.JLinkScript
+# @$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_reboot" -c shutdown
+
+runram:
+ @start $(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)
test:
@$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -f $(FLASHER_PATH)cortex.ocd -c "init" -c "reset halt" -c "load_image $(TST_IMAGE) $(LD_ADDRESS) bin" -c "cortex_bootstrap $(ST_ADDRESS)" -c "shutdown"
diff --git a/flasher/Makefile b/flasher/Makefile
index 2bcdc10..5a7fc2f 100644
--- a/flasher/Makefile
+++ b/flasher/Makefile
@@ -5,6 +5,7 @@
#FLASHER = stlink-v2-1
#FLASHER = stlink-v2
FLASHER ?= Jlink
+JLINK_PATH ?= D:/MCU/SEGGER/JLink_V610a/
#---------------------------
# Default
#---------------------------
@@ -38,6 +39,9 @@ CHCKSUM = $(TOOLS_PATH)checksum$(EXE)
# openocd tools
OPENOCD = $(OPENOCD_PATH)openocd
+JLINK_GDB ?= JLinkGDBServerCL.exe
+JLINK_EXE ?= JLink.exe
+
ifeq ($(FLASHER), Jlink)
# Jlink FLASHER_SPEED ..4000 kHz
FLASHER_SPEED = 3500
@@ -96,11 +100,18 @@ _endgenbin:
@echo "Image ($(FLASH_IMAGE)) size $(shell printf '%d\n' $$(( $$(stat --printf="%s" $(FLASH_IMAGE)) )) ) bytes"
@echo "==========================================================="
-flashburn:
+flashburn:
@$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" -c "rtl8710_flash_write $(FLASH_IMAGE) 0" -c "rtl8710_reboot" -c "reset run" -c shutdown
+# @$(JLINK_PATH)$(JLINK_GDB)
reset:
- @$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_reboot" -c shutdown
+ @$(JLINK_PATH)$(JLINK_EXE) -Device CORTEX-M3 -If SWD -Speed $(FLASHER_SPEED) flasher/RTLreset.JLinkScript
+# @$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_reboot" -c shutdown
+
+runram:
+ @start $(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)
test:
@$(OPENOCD) -f interface/$(FLASHER).cfg -c "adapter_khz $(FLASHER_SPEED)" -f $(FLASHER_PATH)rtl8710.ocd -f $(FLASHER_PATH)cortex.ocd -c "init" -c "reset halt" -c "load_image $(TST_IMAGE) $(LD_ADDRESS) bin" -c "cortex_bootstrap $(ST_ADDRESS)" -c "shutdown"
diff --git a/flasher/RTLreset.JLinkScript b/flasher/RTLreset.JLinkScript
new file mode 100644
index 0000000..303f367
--- /dev/null
+++ b/flasher/RTLreset.JLinkScript
@@ -0,0 +1,5 @@
+h
+r
+w4 0x40000210,0x00211157
+g
+q
\ No newline at end of file
diff --git a/paths.mk b/paths.mk
index a57e412..b575ff7 100644
--- a/paths.mk
+++ b/paths.mk
@@ -6,6 +6,7 @@
#OPENOCD_PATH = d:/MCU/OpenOCD/bin/# + or set in PATH
TOOLS_PATH ?= component/soc/realtek/8195a/misc/iar_utility/common/tools/
FLASHER_PATH ?= flasher/
+JLINK_PATH ?= D:/MCU/SEGGER/JLink_V610a/
#---------------------------
# Default
#---------------------------