diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d483d8a --- /dev/null +++ b/.gitignore @@ -0,0 +1,61 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf +*.bin + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf +/project/realtek_ameba1_va0_example/GCC-RELEASE/application +/tools/arm-none-eabi-gcc +build_info.h +component/soc/realtek/8195a/misc/gcc_utility/target_NORMAL.axf +project/realtek_ameba1_va0_example/GCC-RELEASE/fwsize.gdb +component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_debug.txt +component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_flash_write.txt +component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_ramdebug.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..405b5de --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +I recommend a cheap DAP-link, I got 12MHz on SWD easily, but STLink should also work +Use Cygwin if on Windows (or change uname to include CYGWIN). +open two terminals in `rtl_firmware/project/realtek_ameba1_va0_example/GCC-RELEASE/` +in #1: +`export GDB_SERVER=openocd` +`make setup` +`make` +`./run_openocd_stlink.sh` or `./run_openocd_daplink.sh` +in #2: +`make flash` +You can change hostname in `component\common\network\lwip\lwip_v1.4.1\src\core\dhcp.c` (there has to be a better way but this code is spaghetti anyway, it works) +If you have problems with flashing uncomment `(STRIP) $(BIN_DIR)/$(TARGET).axf` in `rtl_firmware/project/realtek_ameba1_va0_example/GCC-RELEASE/application.mk` (it caused problems with my setup) +General instruction: https://github.com/parasite85/tuya_tygwzw1_hack diff --git a/component/common/example/socket_tcp_trx/example_socket_tcp_trx_1.c b/component/common/example/socket_tcp_trx/example_socket_tcp_trx_1.c index 5e198c8..83c53a7 100644 --- a/component/common/example/socket_tcp_trx/example_socket_tcp_trx_1.c +++ b/component/common/example/socket_tcp_trx/example_socket_tcp_trx_1.c @@ -12,6 +12,13 @@ #define UART_TX PA_7 #define UART_RX PA_6 +#define GPIO_LEDB_PIN PC_0 +#define GPIO_LEDR_PIN PC_1 +#define GPIO_PUSHBT_PIN PB_2 +gpio_t gpio_ledb; +gpio_t gpio_ledr; +gpio_t gpio_btn; + static int tx_exit = 0, rx_exit = 0; //static _Sema tcp_tx_rx_sema; static _sema tcp_tx_rx_sema; @@ -63,6 +70,7 @@ static void tx_thread(void *param) if (j>0) { + gpio_write(&gpio_ledr, 1); #ifdef Z_UART_DEBUG printf("%d bytes UART->TCP: ", j); int i = 0; @@ -81,6 +89,7 @@ static void tx_thread(void *param) { printf("buff corrupted"); } + gpio_write(&gpio_ledr, 0); } else { @@ -117,6 +126,7 @@ static void rx_thread(void *param) getsockopt(client_fd, SOL_SOCKET, SO_ERROR, &sock_err, &err_len); rtw_up_sema(&tcp_tx_rx_sema); if (ret > 0){ + gpio_write(&gpio_ledb, 1); #ifdef Z_UART_DEBUG printf("%d bytes TCP->UART: ", ret); int i=0; @@ -127,6 +137,7 @@ static void rx_thread(void *param) printf("\n"); #endif uart_send_data( &sobj, buffer, ret); + gpio_write(&gpio_ledb, 0); } // ret == -1 and socket error == EAGAIN when no data received for nonblocking @@ -211,6 +222,21 @@ static void example_socket_tcp_trx_thread(void *param) void example_socket_tcp_trx_1(void) { + // Init LED control pin + gpio_init(&gpio_ledb, GPIO_LEDB_PIN); + gpio_dir(&gpio_ledb, PIN_OUTPUT); // Direction: Output + gpio_mode(&gpio_ledb, PullNone); // No pull + + // Init LED control pin + gpio_init(&gpio_ledr, GPIO_LEDR_PIN); + gpio_dir(&gpio_ledr, PIN_OUTPUT); // Direction: Output + gpio_mode(&gpio_ledr, PullNone); // No pull + + // Initial Push Button pin + gpio_init(&gpio_btn, GPIO_PUSHBT_PIN); + gpio_dir(&gpio_btn, PIN_INPUT); // Direction: Input + gpio_mode(&gpio_btn, PullUp); // Pull-High + // mbed uart test rtw_init_sema(&uart_tx_rx_sema, 1); serial_init(&sobj,UART_TX,UART_RX); diff --git a/component/common/network/lwip/lwip_v1.4.1/src/core/dhcp.c b/component/common/network/lwip/lwip_v1.4.1/src/core/dhcp.c index e980026..a80bca3 100644 --- a/component/common/network/lwip/lwip_v1.4.1/src/core/dhcp.c +++ b/component/common/network/lwip/lwip_v1.4.1/src/core/dhcp.c @@ -1476,6 +1476,7 @@ dhcp_option_long(struct dhcp *dhcp, u32_t value) static void dhcp_option_hostname(struct dhcp *dhcp, struct netif *netif) { + netif->hostname = "ZB2MQTT"; if (netif->hostname != NULL) { size_t namelen = strlen(netif->hostname); if (namelen > 0) { diff --git a/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1.cfg b/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1.cfg index 019cbdb..27831ba 100644 --- a/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1.cfg +++ b/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1.cfg @@ -45,8 +45,9 @@ set _TARGETNAME $_CHIPNAME.cpu dap create dap_name -chain-position $_TARGETNAME target create $_TARGETNAME cortex_m -dap dap_name -adapter_khz 500 -adapter_nsrst_delay 100 +adapter_khz 12000 +#adapter_khz 500 +#adapter_nsrst_delay 100 # delays on reset lines adapter_nsrst_delay 200 diff --git a/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_daplink.cfg b/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_daplink.cfg new file mode 100644 index 0000000..27831ba --- /dev/null +++ b/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_daplink.cfg @@ -0,0 +1,123 @@ +# Main file for Ameba1 series Cortex-M3 parts +# +# !!!!!! +# + +set CHIPNAME rtl8195a +set CHIPSERIES ameba1 + +# Adapt based on what transport is active. +source [find target/swj-dp.tcl] + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + error "CHIPNAME not set. Please do not include ameba1.cfg directly." +} + +if { [info exists CHIPSERIES] } { + # Validate chip series is supported + if { $CHIPSERIES != "ameba1" } { + error "Unsupported chip series specified." + } + set _CHIPSERIES $CHIPSERIES +} else { + error "CHIPSERIES not set. Please do not include ameba1.cfg directly." +} + +if { [info exists CPUTAPID] } { + # Allow user override + set _CPUTAPID $CPUTAPID +} else { + # Ameba1 use a Cortex M3 core. + if { $_CHIPSERIES == "ameba1" } { + if { [using_jtag] } { + set _CPUTAPID 0x4ba00477 + } { + set _CPUTAPID 0x2ba01477 + } + } +} + +swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID + +set _TARGETNAME $_CHIPNAME.cpu +dap create dap_name -chain-position $_TARGETNAME +target create $_TARGETNAME cortex_m -dap dap_name + +adapter_khz 12000 +#adapter_khz 500 +#adapter_nsrst_delay 100 + +# delays on reset lines +adapter_nsrst_delay 200 +if {[using_jtag]} { + jtag_ntrst_delay 200 +} + + +# Ameba1 (Cortex M3 core) support SYSRESETREQ +if {![using_hla]} { + # if srst is not fitted use SYSRESETREQ to + # perform a soft reset + cortex_m reset_config sysresetreq +} + +$_TARGETNAME configure -event reset-init {ameba1_init} + +# Ameba1 SDRAM enable +proc ameba1_init { } { + # init System + mww 0x40000014 0x00000021 + sleep 10 + mww 0x40000304 0x1fc00002 + sleep 10 + mww 0x40000250 0x00000400 + sleep 10 + mww 0x40000340 0x00000000 + sleep 10 + mww 0x40000230 0x0000dcc4 + sleep 10 + mww 0x40000210 0x00011117 + sleep 10 + mww 0x40000210 0x00011157 + sleep 10 + mww 0x400002c0 0x00110011 + sleep 10 + mww 0x40000320 0xffffffff + sleep 10 + # init SDRAM + mww 0x40000040 0x00fcc702 + sleep 10 + mdw 0x40000040 + mww 0x40005224 0x00000001 + sleep 10 + mww 0x40005004 0x00000208 + sleep 10 + mww 0x40005008 0xffffd000 + sleep 13 + mww 0x40005020 0x00000022 + sleep 13 + mww 0x40005010 0x09006201 + sleep 13 + mww 0x40005014 0x00002611 + sleep 13 + mww 0x40005018 0x00068413 + sleep 13 + mww 0x4000501c 0x00000042 + sleep 13 + mww 0x4000500c 0x700 ;# set Idle + sleep 20 + mww 0x40005000 0x1 ;# start init + sleep 100 + mdw 0x40005000 + mww 0x4000500c 0x600 ;# enter memory mode + sleep 30 + + mww 0x40005008 0x00000000 ;# 0xf00 + ;# mww 0x40005008 0x00000f00 + sleep 3 + mww 0x40000300 0x0006005e ;# 0x5e + ;# mww 0x40000300 0x0000005e + sleep 3 +} diff --git a/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_stlink.cfg b/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_stlink.cfg new file mode 100644 index 0000000..b5a6526 --- /dev/null +++ b/component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_stlink.cfg @@ -0,0 +1,121 @@ +# Main file for Ameba1 series Cortex-M3 parts +# +# !!!!!! +# + +set CHIPNAME rtl8195a +set CHIPSERIES ameba1 + +# Adapt based on what transport is active. +source [find target/swj-dp.tcl] + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + error "CHIPNAME not set. Please do not include ameba1.cfg directly." +} + +if { [info exists CHIPSERIES] } { + # Validate chip series is supported + if { $CHIPSERIES != "ameba1" } { + error "Unsupported chip series specified." + } + set _CHIPSERIES $CHIPSERIES +} else { + error "CHIPSERIES not set. Please do not include ameba1.cfg directly." +} + +if { [info exists CPUTAPID] } { + # Allow user override + set _CPUTAPID $CPUTAPID +} else { + # Ameba1 use a Cortex M3 core. + if { $_CHIPSERIES == "ameba1" } { + if { [using_jtag] } { + set _CPUTAPID 0x4ba00477 + } { + set _CPUTAPID 0x2ba01477 + } + } +} + +swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID + +set _TARGETNAME $_CHIPNAME.cpu +dap create dap_name -chain-position $_TARGETNAME +target create $_TARGETNAME cortex_m -dap dap_name + +adapter_khz 500 + +# delays on reset lines +adapter_nsrst_delay 200 +if {[using_jtag]} { + jtag_ntrst_delay 200 +} + + +# Ameba1 (Cortex M3 core) support SYSRESETREQ +if {![using_hla]} { + # if srst is not fitted use SYSRESETREQ to + # perform a soft reset + cortex_m reset_config sysresetreq +} + +$_TARGETNAME configure -event reset-init {ameba1_init} + +# Ameba1 SDRAM enable +proc ameba1_init { } { + # init System + mww 0x40000014 0x00000021 + sleep 10 + mww 0x40000304 0x1fc00002 + sleep 10 + mww 0x40000250 0x00000400 + sleep 10 + mww 0x40000340 0x00000000 + sleep 10 + mww 0x40000230 0x0000dcc4 + sleep 10 + mww 0x40000210 0x00011117 + sleep 10 + mww 0x40000210 0x00011157 + sleep 10 + mww 0x400002c0 0x00110011 + sleep 10 + mww 0x40000320 0xffffffff + sleep 10 + # init SDRAM + mww 0x40000040 0x00fcc702 + sleep 10 + mdw 0x40000040 + mww 0x40005224 0x00000001 + sleep 10 + mww 0x40005004 0x00000208 + sleep 10 + mww 0x40005008 0xffffd000 + sleep 13 + mww 0x40005020 0x00000022 + sleep 13 + mww 0x40005010 0x09006201 + sleep 13 + mww 0x40005014 0x00002611 + sleep 13 + mww 0x40005018 0x00068413 + sleep 13 + mww 0x4000501c 0x00000042 + sleep 13 + mww 0x4000500c 0x700 ;# set Idle + sleep 20 + mww 0x40005000 0x1 ;# start init + sleep 100 + mdw 0x40005000 + mww 0x4000500c 0x600 ;# enter memory mode + sleep 30 + + mww 0x40005008 0x00000000 ;# 0xf00 + ;# mww 0x40005008 0x00000f00 + sleep 3 + mww 0x40000300 0x0006005e ;# 0x5e + ;# mww 0x40000300 0x0000005e + sleep 3 +} diff --git a/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_debug.txt b/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_debug.txt deleted file mode 100644 index 5133478..0000000 --- a/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_debug.txt +++ /dev/null @@ -1,55 +0,0 @@ -# GDB script for loading ram.bin process - -#=============================================================================== -#set GDB connection -set remotetimeout 100000 -target remote :2331 - -#=============================================================================== -#Message display setting -#disable all messages - -set verbose off -set complaints 0 -set confirm off -set exec-done-display off -show exec-done-display -set trace-commands off -#set debug aix-thread off -#set debug dwarf2-die 0 -set debug displaced off -set debug expression 0 -set debug frame 0 -set debug infrun 0 -set debug observer 0 -set debug overload 0 -set debugvarobj 0 -set pagination off -set print address off -set print symbol-filename off -set print symbol off -set print pretty off -set print object off -#set debug notification off -set debug parser off -set debug remote 0 - -#=============================================================================== -monitor reset 1 -monitor sleep 20 -monitor clrbp -#=============================================================================== -#Load flash download file -file ./application/Debug/bin/application.axf - -#x /1xw 0x40000210 - -b main -continue -clear main -#Load the file -#lo - - - - diff --git a/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_flash_write.txt b/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_flash_write.txt deleted file mode 100644 index 488c1e2..0000000 --- a/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_flash_write.txt +++ /dev/null @@ -1,199 +0,0 @@ -# GDB script for loading ram.bin process - -#=============================================================================== -#set GDB connection -set remotetimeout 100000 -target remote :2331 - -#=============================================================================== -#set file path -set $BINFILE = "./application/Debug/bin/ram_all.bin" - -#=============================================================================== -#Message display setting -#disable all messages - -set verbose off -set complaints 0 -set confirm off -set exec-done-display off -show exec-done-display -set trace-commands off -#set debug aix-thread off -#set debug dwarf2-die 0 -set debug displaced off -set debug expression 0 -set debug frame 0 -set debug infrun 0 -set debug observer 0 -set debug overload 0 -set debugvarobj 0 -set pagination off -set print address off -set print symbol-filename off -set print symbol off -set print pretty off -set print object off -#set debug notification off -set debug parser off -set debug remote 0 - -#=============================================================================== -#set JTAG and external SRAM -monitor reset 1 -monitor sleep 20 -monitor clrbp -#=============================================================================== -#Variables declaration (1) -#binary file size -set $RamFileSize = 0x0000 -source fwsize.gdb -printf "-------------------------------\n" -printf "RamFileSize: %x\n",$RamFileSize -printf "-------------------------------\n" - -#=============================================================================== -set $FLASHDATBUFSIZE = 0x800 - -#=============================================================================== -#define PERI_ON_BASE 0x40000000 -set $PERI_ON_BASE = 0x40000000 -#define REG_SOC_PERI_FUNC0_EN 0x0218 -set $REG_SOC_PERI_FUNC0_EN = 0x0210 - -#define SPI_FLASH_BASE 0x4000000 -set $SPI_FLASH_BASE = 0x98000000 - -#------------------------------------------------------------------ -set $Temp = 0x0 - -#=============================================================================== -#Load flash download file -file ../../../component/soc/realtek/8195a/misc/gcc_utility/target_NORMAL.axf - -#Load the file -lo - -printf "Load flash controller.\n" - -#=============================================================================== -#Set for executing flash controller funciton -set $Temp = {int}($PERI_ON_BASE+$REG_SOC_PERI_FUNC0_EN) -p /x $Temp - -set $Temp = ($Temp | (0x01 << 27)) -p /x $Temp - -set {int}($PERI_ON_BASE+$REG_SOC_PERI_FUNC0_EN) = $Temp -printf "....\n" -printf "wakeup bit(%x):%x\n", ($PERI_ON_BASE+$REG_SOC_PERI_FUNC0_EN), {int}($PERI_ON_BASE+$REG_SOC_PERI_FUNC0_EN) -#=============================================================================== -#Direct the startup wake function to flash program function -#the function pointer address -#set $testpointer = 0x200006b4 -#set $testpointer2 = 0x200006b8 -#set $FuntionPointer = 0x200006c4 -#set $FPTemp = 0x200a08e9 -#set {int}($FuntionPointer) = $FPTemp -#printf "testpointer(%x):%x\n", $testpointer, {int}$testpointer -#printf "testpointer2(%x):%x\n", $testpointer2, {int}$testpointer2 -#printf "FuntionPointer(%x):%x\n", $FuntionPointer, {int}$FuntionPointer - -#=============================================================================== -#Load file -# restore filename [binary] bias start end -# Restore the contents of file filename into memory. -# The restore command can automatically recognize any known bfd file format, except for raw binary. -# To restore a raw binary file you must specify the optional keyword binary after the filename. -#=============================================================================== - -set $LoopNum = ($RamFileSize / $FLASHDATBUFSIZE) -printf "LoopNum = %x\n", $LoopNum -set $TailSize = ($RamFileSize % $FLASHDATBUFSIZE) -printf "TailSize = %x\n", $TailSize - -printf "global variables\n" - -set $FLASHDATSRC = 0x0 -set $FILESTARTADDR = 0X0 -set $FILEENDADDR = $FILESTARTADDR + $FLASHDATBUFSIZE - -#b RtlFlashProgram:StartOfFlashBlockWrite -b rtl_flash_download.c:489 -b rtl_flash_download.c:524 -#b Rtl_flash_control.c:RtlFlashProgram - -#continue to 489 -c - -# Mode 0: erase full chip, Mode 1: skip calibration section and erase to firmware size -set EraseMode=1 -print EraseMode -set FirmwareSize=$RamFileSize -print FirmwareSize - -#continue to 524 -c - -#printf "...\n" -set $FLASHDATSRC = FlashDatSrc -printf "FlashDatSrc:%x\n", $FLASHDATSRC - -printf "FlashBlockWriteSize " -set FlashBlockWriteSize = $FLASHDATBUFSIZE -#p /x FlashBlockWriteSize -printf "FlashBlockWriteSize:%x\n", FlashBlockWriteSize - -printf "FlashAddrForWrite" -set FlashAddrForWrite = 0x0 - - - -printf "Flash write start...\n" -set $LoopCnt = 0 -while ($LoopCnt < $LoopNum) - p /x FlashAddrForWrite - restore ./application/Debug/bin/ram_all.bin binary ($FLASHDATSRC-$FILESTARTADDR) $FILESTARTADDR $FILEENDADDR - c - - printf "FILEENDADDR" - p /x $FILEENDADDR - set FlashBlockWriteSize = $FLASHDATBUFSIZE - set FlashAddrForWrite = $FILEENDADDR - set $FILESTARTADDR = $FILEENDADDR - set $FILEENDADDR = $FILESTARTADDR + $FLASHDATBUFSIZE - - set $LoopCnt = $LoopCnt + 0x01 -end - -#set FlashBlockWriteSize = $FLASHDATBUFSIZE -#set FlashAddrForWrite = $FILEENDADDR -#set $FILESTARTADDR = $FILEENDADDR -set $FILEENDADDR = $FILESTARTADDR + $TailSize -restore ./application/Debug/bin/ram_all.bin binary ($FLASHDATSRC-$FILESTARTADDR) $FILESTARTADDR $FILEENDADDR -c - -#Set complete flas -set FlashWriteComplete = 0x1 - -printf "dump for check\n" - -set $LoopCnt = 0 -set $dumpaddr = 0 - -set $dumpstartaddr = $SPI_FLASH_BASE -set $dumpendaddr = $SPI_FLASH_BASE + $RamFileSize -printf "start addr of dumping" -p /x $dumpstartaddr -printf "end addr of dumping" -p /x $dumpendaddr -dump binary memory ./application/Debug/bin/dump.bin $dumpstartaddr $dumpendaddr - - -delete -b rtl_flash_download.c:556 -c - -quit -#=============================================================================== - diff --git a/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_ramdebug.txt b/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_ramdebug.txt deleted file mode 100644 index 9dd4fa1..0000000 --- a/component/soc/realtek/8195a/misc/gcc_utility/rtl_gdb_ramdebug.txt +++ /dev/null @@ -1,112 +0,0 @@ -# GDB script for loading ram.bin process - -#=============================================================================== -#set GDB connection -set remotetimeout 100000 -target remote :2331 - -#=============================================================================== -#Message display setting -#disable all messages - -set verbose off -set complaints 0 -set confirm off -set exec-done-display off -show exec-done-display -set trace-commands off -#set debug aix-thread off -#set debug dwarf2-die 0 -set debug displaced off -set debug expression 0 -set debug frame 0 -set debug infrun 0 -set debug observer 0 -set debug overload 0 -set debugvarobj 0 -set pagination off -set print address off -set print symbol-filename off -set print symbol off -set print pretty off -set print object off -#set debug notification off -set debug parser off -set debug remote 0 - -#=============================================================================== -monitor reset 1 -monitor sleep 20 -monitor clrbp -#=============================================================================== -#Init SDRAM here - # init System -monitor MemU32 0x40000014=0x00000021 -monitor sleep 10 -monitor MemU32 0x40000304=0x1fc00002 -monitor sleep 10 -monitor MemU32 0x40000250=0x00000400 -monitor sleep 10 -monitor MemU32 0x40000340=0x00000000 -monitor sleep 10 -monitor MemU32 0x40000230=0x0000dcc4 -monitor sleep 10 -monitor MemU32 0x40000210=0x00011117 -monitor sleep 10 -monitor MemU32 0x40000210=0x00011157 -monitor sleep 10 -monitor MemU32 0x400002c0=0x00110011 -monitor sleep 10 -monitor MemU32 0x40000320=0xffffffff -monitor sleep 10 - # init SDRAM -monitor MemU32 0x40000040=0x00fcc702 -monitor sleep 10 -monitor MemU32 0x40000040 -monitor MemU32 0x40005224=0x00000001 -monitor sleep 10 -monitor MemU32 0x40005004=0x00000208 -monitor sleep 10 -monitor MemU32 0x40005008=0xffffd000 -monitor sleep 13 -monitor MemU32 0x40005020=0x00000022 -monitor sleep 13 -monitor MemU32 0x40005010=0x09006201 -monitor sleep 13 -monitor MemU32 0x40005014=0x00002611 -monitor sleep 13 -monitor MemU32 0x40005018=0x00068413 -monitor sleep 13 -monitor MemU32 0x4000501c=0x00000042 -monitor sleep 13 -monitor MemU32 0x4000500c=0x700 -monitor sleep 20 -monitor MemU32 0x40005000=0x1 -monitor sleep 100 -monitor MemU32 0x40005000 -monitor MemU32 0x4000500c=0x600 -monitor sleep 30 - -monitor MemU32 0x40005008=0x00000000 -monitor sleep 3 -monitor MemU32 0x40000300=0x0006005e -monitor sleep 3 -#=============================================================================== -#Load flash download file -file ./application/Debug/bin/application.axf - -#boot from ram, igonore loading flash -monitor MemU32 0x40000210=0x8011157 - -#Load the file -lo - -#Run to main -b main -continue -clear main - - - - - diff --git a/component/soc/realtek/8195a/misc/gcc_utility/target_NORMAL.axf b/component/soc/realtek/8195a/misc/gcc_utility/target_NORMAL.axf deleted file mode 100644 index 694e1c6..0000000 Binary files a/component/soc/realtek/8195a/misc/gcc_utility/target_NORMAL.axf and /dev/null differ diff --git a/project/realtek_ameba1_va0_example/GCC-RELEASE/application.mk b/project/realtek_ameba1_va0_example/GCC-RELEASE/application.mk index 82ad334..e05b23c 100644 --- a/project/realtek_ameba1_va0_example/GCC-RELEASE/application.mk +++ b/project/realtek_ameba1_va0_example/GCC-RELEASE/application.mk @@ -1,6 +1,6 @@ # Flags # ------------------------------------------------------------------- -SHELL = bash +#SHELL = bash CONFIG_BT = 0 # ------------------------------------------------------------------- # Initialize tool chain @@ -659,7 +659,7 @@ manipulate_images: @echo =========================================================== @echo Image manipulating @echo =========================================================== - $(STRIP) $(BIN_DIR)/$(TARGET).axf +# $(STRIP) $(BIN_DIR)/$(TARGET).axf $(NM) $(BIN_DIR)/$(TARGET).axf | sort > $(BIN_DIR)/$(TARGET).nmap $(OBJCOPY) -j .image2.start.table -j .ram_image2.text -j .ram_image2.rodata -j .ram.data -Obinary $(BIN_DIR)/$(TARGET).axf $(BIN_DIR)/ram_2.bin $(OBJCOPY) -j .sdr_text -j .sdr_rodata -j .sdr_data -Obinary $(BIN_DIR)/$(TARGET).axf $(BIN_DIR)/sdram.bin diff --git a/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd.bat b/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd.bat deleted file mode 100644 index 71d3fcb..0000000 --- a/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd.bat +++ /dev/null @@ -1,2 +0,0 @@ -taskkill /F /IM openocd.exe -openocd -f interface\cmsis-dap.cfg -f ..\..\..\component\soc\realtek\8195a\misc\gcc_utility\openocd\ameba1.cfg diff --git a/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd_daplink.sh b/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd_daplink.sh new file mode 100644 index 0000000..e76e16e --- /dev/null +++ b/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd_daplink.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +OS=`uname | cut -c 1-6` + +PID=`ps aux | grep openocd | gawk '{print $1}'` + +if [ ! -z "$PID" -a "$PID" != " " ]; then + echo Found openocd running, Kill it + kill $PID +else + if [ $OS == CYGWIN ]; then + echo Try to search windows process + PID=`ps --windows | grep openocd | gawk '{print $1}'` + if [ -n PID ]; then + echo Found openocd running, Kill it + taskkill /F /pid $PID + fi + fi +fi + +openocd -f interface/cmsis-dap.cfg -f ../../../component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_daplink.cfg diff --git a/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd.sh b/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd_stlink.sh old mode 100755 new mode 100644 similarity index 89% rename from project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd.sh rename to project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd_stlink.sh index 2b10d80..fefd9f4 --- a/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd.sh +++ b/project/realtek_ameba1_va0_example/GCC-RELEASE/run_openocd_stlink.sh @@ -18,4 +18,4 @@ else fi fi -openocd -f interface/stlink-v2.cfg -f ../../../component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1.cfg +openocd -f interface/stlink-v2.cfg -f ../../../component/soc/realtek/8195a/misc/gcc_utility/openocd/ameba1_stlink.cfg diff --git a/project/realtek_ameba1_va0_example/inc/build_info.h b/project/realtek_ameba1_va0_example/inc/build_info.h deleted file mode 100644 index c5ded67..0000000 --- a/project/realtek_ameba1_va0_example/inc/build_info.h +++ /dev/null @@ -1,9 +0,0 @@ -#define RTL_FW_COMPILE_TIME RTL8195AFW_COMPILE_TIME -#define RTL_FW_COMPILE_DATE RTL8195AFW_COMPILE_DATE -#define UTS_VERSION "2022/07/06-14:23:16" -#define RTL8195AFW_COMPILE_TIME "2022/07/06-14:23:16" -#define RTL8195AFW_COMPILE_DATE "20220706" -#define RTL8195AFW_COMPILE_BY "evan_pan" -#define RTL8195AFW_COMPILE_HOST "" -#define RTL8195AFW_COMPILE_DOMAIN "realtek.com.tw" -#define RTL8195AFW_COMPILER "gcc 4.8.4" diff --git a/project/realtek_ameba1_va0_example/inc/platform_opts.h b/project/realtek_ameba1_va0_example/inc/platform_opts.h index fe86dbd..50cab73 100644 --- a/project/realtek_ameba1_va0_example/inc/platform_opts.h +++ b/project/realtek_ameba1_va0_example/inc/platform_opts.h @@ -9,6 +9,7 @@ /*For MP mode setting*/ #define SUPPORT_MP_MODE 0 +#define LWIP_NETIF_HOSTNAME 1 /** * For AT cmd Log service configurations @@ -116,11 +117,11 @@ /*For fast reconnection*/ #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 1 -#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT -#define CONFIG_FAST_DHCP 1 -#else +//#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT #TODO: ugly workaround to get hostname working +//#define CONFIG_FAST_DHCP 1 +//#else #define CONFIG_FAST_DHCP 0 -#endif +//#endif /*For wowlan service settings*/ #define CONFIG_WOWLAN_SERVICE 0