initial commit

This commit is contained in:
Tautvydas Belgeras 2018-06-05 16:16:17 +03:00
commit 60a7afcc83
2528 changed files with 1001987 additions and 0 deletions

View file

@ -0,0 +1,38 @@
@echo off
set RAMFILENAME=".\Debug\ram_all.bin"
::echo %RAMFILENAME%
cp ..\..\..\..\..\component\soc\realtek\8195a\misc\gcc_utility\target_NORMALB.axf ..\..\..\..\..\component\soc\realtek\8195a\misc\gcc_utility\target_NORMAL.axf
::===============================================================================
::get file size and translate to HEX
for %%A in (%RAMFILENAME%) do set fileSize=%%~zA
@call :toHex %fileSize% fileSizeHex
::echo %fileSize%
::echo %fileSizeHex%
echo set $RamFileSize = 0x%fileSizeHex% > .\Debug\fwsize.gdb
:: start GDB for flash write, argument 1 (%1) could be rather "openocd" or "jlink"
::echo %1
..\..\..\..\..\tools\arm-none-eabi-gcc\4_8-2014q3\bin\arm-none-eabi-gdb -x ..\..\..\..\..\component\soc\realtek\8195a\misc\gcc_utility\eclipse\rtl_eclipse_flash_write_%1.txt
exit
:toHex dec hex -- convert a decimal number to hexadecimal, i.e. -20 to FFFFFFEC or 26 to 0000001A
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set /a dec=%~1
set "hex="
set "map=0123456789ABCDEF"
for /L %%N in (1,1,8) do (
set /a "d=dec&15,dec>>=4"
for %%D in (!d!) do set "hex=!map:~%%D,1!!hex!"
)
( ENDLOCAL & REM RETURN VALUES
IF "%~2" NEQ "" (SET %~2=%hex%) ELSE ECHO.%hex%
)
EXIT /b

View file

@ -0,0 +1,38 @@
:: application/Debug
@echo off
set bindir=.
set gccdir=..\..\..\..\..\..\tools\arm-none-eabi-gcc\4_8-2014q3\bin
::e.g. arm-none-eabi-gcc -c -mcpu=cortex-m3 -mthumb -std=gnu99 -DGCC_ARMCM3 -DM3 -DCONFIG_PLATFORM_8195A -DF_CPU=166000000L -I..\..\..\..\inc -I..\..\..\..\..\..\component\soc\realtek\common\bsp -I..\..\..\..\..\..\component\os\freertos -I..\..\..\..\..\..\component\os\freertos\freertos_v8.1.2\Source\include -I..\..\..\..\..\..\component\os\freertos\freertos_v8.1.2\Source\portable\GCC\ARM_CM3 -I..\..\..\..\..\..\component\os\os_dep\include -I..\..\..\..\..\..\component\soc\realtek\8195a\misc\driver -I..\..\..\..\..\..\component\common\api\network\include -I..\..\..\..\..\..\component\common\api -I..\..\..\..\..\..\component\common\api\platform -I..\..\..\..\..\..\component\common\api\wifi -I..\..\..\..\..\..\component\common\api\wifi\rtw_wpa_supplicant\src -I..\..\..\..\..\..\component\common\application -I..\..\..\..\..\..\component\common\media\framework -I..\..\..\..\..\..\component\common\example -I..\..\..\..\..\..\component\common\example\wlan_fast_connect -I..\..\..\..\..\..\component\common\mbed\api -I..\..\..\..\..\..\component\common\mbed\hal -I..\..\..\..\..\..\component\common\mbed\hal_ext -I..\..\..\..\..\..\component\common\mbed\targets\hal\rtl8195a -I..\..\..\..\..\..\component\common\network -I..\..\..\..\..\..\component\common\network\lwip\lwip_v1.4.1\port\realtek\freertos -I..\..\..\..\..\..\component\common\network\lwip\lwip_v1.4.1\src\include -I..\..\..\..\..\..\component\common\network\lwip\lwip_v1.4.1\src\include\lwip -I..\..\..\..\..\..\component\common\network\lwip\lwip_v1.4.1\src\include\ipv4 -I..\..\..\..\..\..\component\common\network\lwip\lwip_v1.4.1\port\realtek -I..\..\..\..\..\..\component\common\test -I..\..\..\..\..\..\component\soc\realtek\8195a\cmsis -I..\..\..\..\..\..\component\soc\realtek\8195a\cmsis\device -I..\..\..\..\..\..\component\soc\realtek\8195a\fwlib -I..\..\..\..\..\..\component\soc\realtek\8195a\fwlib\rtl8195a -I..\..\..\..\..\..\component\soc\realtek\8195a\misc\rtl_std_lib\include -I..\..\..\..\..\..\component\common\drivers\wlan\realtek\include -I..\..\..\..\..\..\component\common\drivers\wlan\realtek\src\osdep -I..\..\..\..\..\..\component\soc\realtek\8195a\fwlib\ram_lib\wlan\realtek\wlan_ram_map\rom -I..\..\..\..\..\..\component\common\network\ssl\polarssl-1.3.8\include -I..\..\..\..\..\..\component\common\network\ssl\ssl_ram_map\rom -I..\..\..\..\..\..\component\common\utilities -I..\..\..\..\..\..\component\soc\realtek\8195a\misc\rtl_std_lib\include -I..\..\..\..\..\..\component\soc\realtek\8195a\fwlib\ram_lib\usb_otg\include -I..\..\..\..\..\..\component\common\video\v4l2\inc -I..\..\..\..\..\..\component\common\media\codec -I..\..\..\..\..\..\component\common\drivers\usb_class\host\uvc\inc -I..\..\..\..\..\..\component\common\drivers\usb_class\device -I..\..\..\..\..\..\component\common\drivers\usb_class\device\class -I..\..\..\..\..\..\component\common\file_system\fatfs -I..\..\..\..\..\..\component\common\file_system\fatfs\r0.10c\include -I..\..\..\..\..\..\component\common\drivers\sdio\realtek\sdio_host\inc -I..\..\..\..\..\..\component\common\audio -I..\..\..\..\..\..\component\common\drivers\i2s -I..\..\..\..\..\..\component\common\application\apple\WACServer\External\Curve25519 -I..\..\..\..\..\..\component\common\application\apple\WACServer\External\GladmanAES -I..\..\..\..\..\..\component\common\application\google -I..\..\..\..\..\..\component\common\application\xmodem -O2 -g -Wno-pointer-sign -fno-common -fmessage-length=0 -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-short-enums -fsigned-char -MMD -MP -MFSDRAM/polarssl/aes.d -MTSDRAM/polarssl/aes.o -o SDRAM/polarssl/aes.o D:/test/sdk-ameba1-v3.5b_beta_v2/component/common/network/ssl/polarssl-1.3.8/library/aes.c
REM get last two argument which is the output object file
call :GetLastTwoArg %*
::echo %lastTwoArg%
:: check argument count
::set argC=0
::for %%x in (%*) do Set /A argC+=1
::echo %argC%
:: gcc compile, %1 might be gcc or arm-none-eabi-gcc
set arg1=%1
if not "%arg1:arm-none-eabi-=%" == "%arg1%" (
::echo is arm-none-eabi-gcc
%gccdir%\%*
) else (
::echo is gcc
%gccdir%\arm-none-eabi-%*
)
:: objcopy append .sdram section info
%gccdir%\arm-none-eabi-objcopy --prefix-alloc-sections .sdram %lastTwoArg%
REM This subroutine gets the last command-line argument by using SHIFT
:GetLastTwoArg
set "lastTwoArg=%~1"
shift
if not "%~2"=="" goto GetLastTwoArg
goto :eof
exit

View file

@ -0,0 +1,74 @@
:: application/Debug
@echo off
set bindir=.
set tooldir=..\..\..\..\..\..\component\soc\realtek\8195a\misc\iar_utility\common\tools
set libdir=..\..\..\..\..\..\component\soc\realtek\8195a\misc\bsp
set gccdir=..\..\..\..\..\..\tools\arm-none-eabi-gcc\4_8-2014q3\bin
::echo %tooldir%
::echo %libdir%
::copy bootloader and convert from image to object file
::copy ../../../../../component/soc/realtek/8195a/misc/bsp/image/ram_1.r.bin ram_1.r.bin
::%gccdir%/arm-none-eabi-objcopy --rename-section .data=.loader.data,contents,alloc,load,readonly,data -I binary -O elf32-littlearm -B arm ram_1.r.bin ram_1.r.o
::del Debug/Exe/target.map Debug/Exe/application.asm *.bin
cmd /c "%gccdir%\arm-none-eabi-nm %bindir%/application.axf | %tooldir%\sort > %bindir%/application.nm.map"
cmd /c "%gccdir%\arm-none-eabi-objdump -d %bindir%/application.axf > %bindir%/application.asm"
for /f "delims=" %%i in ('cmd /c "%tooldir%\grep __ram_image2_text_start__ %bindir%/application.nm.map | %tooldir%\gawk '{print $1}'"') do set ram2_start=0x%%i
for /f "delims=" %%i in ('cmd /c "%tooldir%\grep __sdram_data_start__ %bindir%/application.nm.map | %tooldir%\gawk '{print $1}'"') do set ram3_start=0x%%i
for /f "delims=" %%i in ('cmd /c "%tooldir%\grep __ram_image2_text_end__ %bindir%/application.nm.map | %tooldir%\gawk '{print $1}'"') do set ram2_end=0x%%i
for /f "delims=" %%i in ('cmd /c "%tooldir%\grep __sdram_data_end__ %bindir%/application.nm.map | %tooldir%\gawk '{print $1}'"') do set ram3_end=0x%%i
::echo %ram1_start% > tmp.txt
echo %ram2_start%
echo %ram3_start%
::echo %ram1_end% >> tmp.txt
echo %ram2_end%
echo %ram3_end%
%gccdir%\arm-none-eabi-objcopy -j .image2.start.table -j .ram_image2.text -j .ram_image2.rodata -j .ram.data -Obinary %bindir%/application.axf %bindir%/ram_2.bin
if NOT %ram3_start% == %ram3_end% (
%gccdir%\arm-none-eabi-objcopy -j .sdr_text -j .sdr_rodata -j .sdr_data -Obinary %bindir%/application.axf %bindir%/sdram.bin
)
%tooldir%\pick %ram2_start% %ram2_end% %bindir%\ram_2.bin %bindir%\ram_2.p.bin body+reset_offset+sig
if defined %ram3_start (
%tooldir%\pick %ram3_start% %ram3_end% %bindir%\sdram.bin %bindir%\ram_3.p.bin body+reset_offset
)
:: check ram_1.p.bin exist, copy default
if not exist %bindir%\ram_1.p.bin (
copy %libdir%\image\ram_1.p.bin %bindir%\ram_1.p.bin
)
::padding ram_1.p.bin to 32K+4K+4K+4K, LOADER/RSVD/SYSTEM/CALIBRATION
%tooldir%\padding 44k 0xFF %bindir%\ram_1.p.bin
:: SDRAM case
if defined %ram3_start (
copy /b %bindir%\ram_1.p.bin+%bindir%\ram_2.p.bin+%bindir%\ram_3.p.bin %bindir%\ram_all.bin
copy /b %bindir%\ram_2.p.bin+%bindir%\ram_3.p.bin %bindir%\ota.bin
)
%tooldir%\checksum Debug\Exe\ota.bin
:: NO SDRAM case
if not defined %ram3_start (
copy /b %bindir%\ram_1.p.bin+%bindir%\ram_2.p.bin %bindir%\ram_all.bin
copy /b %bindir%\ram_2.p.bin %bindir%\ota.bin
)
del ram_1.r.*
del ram*.p.bin
del ram_2.bin
if exist sdram.bin (
del sdram.bin
)
exit

View file

@ -0,0 +1,48 @@
:: application/Debug
@echo off
set bindir=.
:: unzip arm-none-eabi-gcc\4_8-2014q3.tar
set tooldir=..\..\..\..\..\..\component\soc\realtek\8195a\misc\gcc_utility\tools
set currentdir=%cd%
:CheckOS
if exist "%PROGRAMFILES(X86)%" (goto 64bit) else (goto 32bit)
:64bit
set os_prefix=x86_64
goto next
:32bit
set os_prefix=x86
:next
if not exist ..\..\..\..\..\..\tools\arm-none-eabi-gcc\4_8-2014q3\ (
:: %tooldir%\%os_prefix%\gzip -dc ..\..\..\..\..\..\tools\arm-none-eabi-gcc\4.8.3-2014q1.tar.gz > ..\..\..\..\..\..\tools\arm-none-eabi-gcc\4.8.3-2014q1.tar
cd ..\..\..\..\..\..\tools\arm-none-eabi-gcc
..\..\component\soc\realtek\8195a\misc\gcc_utility\tools\%os_prefix%\tar -xf 4_8-2014q3.tar
cd %currentdir%
)
set gccdir=..\..\..\..\..\..\tools\arm-none-eabi-gcc\4_8-2014q3\bin
::echo %tooldir%
:: Generate build_info.h
for /f "usebackq" %%i in (`hostname`) do set hostname=%%i
echo #define UTS_VERSION "%date:~0,10%-%time:~0,8%" > ..\..\..\..\inc\build_info.h
echo #define RTL8195AFW_COMPILE_TIME "%date:~0,10%-%time:~0,8%" >> ..\..\..\..\inc\build_info.h
echo #define RTL8195AFW_COMPILE_DATE "%date:~0,4%%date:~5,2%%date:~8,2%" >> ..\..\..\..\inc\build_info.h
echo #define RTL8195AFW_COMPILE_BY "%USERNAME%" >> ..\..\..\..\inc\build_info.h
echo #define RTL8195AFW_COMPILE_HOST "%hostname%" >> ..\..\..\..\inc\build_info.h
echo #define RTL8195AFW_COMPILE_DOMAIN >> ..\..\..\..\inc\build_info.h
echo #define RTL195AFW_COMPILER "GCC compiler" >> ..\..\..\..\inc\build_info.h
xcopy /Y ..\..\..\rlx8195A-symbol-v02-img2.ld .
xcopy /Y ..\..\..\export-rom_v02.txt .
::copy bootloader and convert from image to object file
xcopy /Y ..\..\..\..\..\..\component\soc\realtek\8195a\misc\bsp\image\ram_1.r.bin .
%gccdir%\arm-none-eabi-objcopy --rename-section .data=.loader.data,contents,alloc,load,readonly,data -I binary -O elf32-littlearm -B arm ram_1.r.bin ram_1.r.o
exit

View file

@ -0,0 +1,199 @@
# GDB script for loading ram.bin process
#===============================================================================
#set GDB connection
set remotetimeout 100000
target remote :2331
#===============================================================================
#set file path
set $BINFILE = "./Debug/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 ./Debug/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 ./Debug/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 ./Debug/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 ./Debug/dump.bin $dumpstartaddr $dumpendaddr
delete
b rtl_flash_download.c:556
c
quit
#===============================================================================

View file

@ -0,0 +1,198 @@
# GDB script for loading ram.bin process
#===============================================================================
#set GDB connection
set remotetimeout 100000
target remote :3333
#===============================================================================
#set file path
set $BINFILE = "./Debug/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 init
monitor halt
monitor sleep 20
#===============================================================================
#Variables declaration (1)
#binary file size
set $RamFileSize = 0x0000
source ./Debug/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 ./Debug/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 ./Debug/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 ./Debug/dump.bin $dumpstartaddr $dumpendaddr
delete
b rtl_flash_download.c:556
c
quit
#===============================================================================