[feat] update flash tool and openocd cfg

This commit is contained in:
jzlv 2021-06-04 18:00:11 +08:00
parent 0860ef4d6e
commit f3e7d8f8a4
49 changed files with 1405 additions and 648 deletions

View File

@ -153,7 +153,7 @@
<buildTargets> <buildTargets>
<target name="bl_make" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="bl_make" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments>BOARD=bl706_iot</buildArguments> <buildArguments>build BOARD=bl706_iot</buildArguments>
<buildTarget>APP=helloworld</buildTarget> <buildTarget>APP=helloworld</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand> <useDefaultCommand>false</useDefaultCommand>
@ -161,6 +161,7 @@
</target> </target>
<target name="bl_clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="bl_clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget> <buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand> <useDefaultCommand>false</useDefaultCommand>

2
.gitignore vendored
View File

@ -2,6 +2,7 @@ out/*
build/* build/*
.vscode/settings.json .vscode/settings.json
.settings .settings
*.pyc
**/.cdk **/.cdk
**/Lst **/Lst
@ -9,7 +10,6 @@ build/*
examples/**/*.mk examples/**/*.mk
examples/**/*.cdkws examples/**/*.cdkws
!examples/bl_mcu_sdk.cdkws
examples/**/*.mk examples/**/*.mk
examples/**/*.bat examples/**/*.bat
examples/**/cdk/*.txt examples/**/cdk/*.txt

View File

@ -1,10 +1,12 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.15)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/tools/cmake/riscv64-unknown-elf-gcc.cmake) set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/tools/cmake/riscv64-unknown-elf-gcc.cmake)
include(${CMAKE_SOURCE_DIR}/tools/cmake/compiler_flags.cmake) include(${CMAKE_SOURCE_DIR}/tools/cmake/compiler_flags.cmake)
include(${CMAKE_SOURCE_DIR}/tools/cmake/tools.cmake) include(${CMAKE_SOURCE_DIR}/tools/cmake/tools.cmake)
PROJECT(${BOARD} C CXX ASM) PROJECT(${BOARD} C CXX ASM)
# set(CMAKE_VERBOSE_MAKEFILE ON)
include_directories(${CMAKE_SOURCE_DIR}/common/misc) include_directories(${CMAKE_SOURCE_DIR}/common/misc)
include_directories(${CMAKE_SOURCE_DIR}/bsp/bsp_common/platform) include_directories(${CMAKE_SOURCE_DIR}/bsp/bsp_common/platform)
@ -14,14 +16,24 @@ else()
message(FATAL_ERROR "${CMAKE_SOURCE_DIR}/bsp/board/${BOARD} is not exist") message(FATAL_ERROR "${CMAKE_SOURCE_DIR}/bsp/board/${BOARD} is not exist")
endif() endif()
if(${SUPPORT_FLOAT} STREQUAL "y")
add_definitions(-DBFLB_PRINT_FLOAT_SUPPORT)
else()
endif()
if(${SUPPORT_SHELL} STREQUAL "y")
add_definitions(-DSHELL_SUPPORT)
else()
endif()
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(components/fatfs) add_subdirectory(components/fatfs)
add_subdirectory(components/usb_stack) add_subdirectory(components/usb_stack)
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/drivers/${mcu}_driver) if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/drivers/${CHIP}_driver)
add_subdirectory(drivers/${mcu}_driver) add_subdirectory(drivers/${CHIP}_driver)
else() else()
message(FATAL_ERROR "${CMAKE_SOURCE_DIR}/drivers/${mcu}_driver is not exist") message(FATAL_ERROR "${CMAKE_SOURCE_DIR}/drivers/${CHIP}_driver is not exist")
endif() endif()
if(${SUPPORT_SHELL} STREQUAL "y") if(${SUPPORT_SHELL} STREQUAL "y")
@ -36,5 +48,16 @@ if(${SUPPORT_LVGL} STREQUAL "y")
add_subdirectory(components/lvgl) add_subdirectory(components/lvgl)
endif() endif()
search_application(${CMAKE_SOURCE_DIR}/examples) if(${SUPPORT_XZ} STREQUAL "y")
add_subdirectory(components/xz)
endif()
if(${SUPPORT_BLE} STREQUAL "y")
if(${SUPPORT_FREERTOS} STREQUAL "n")
message(FATAL_ERROR "ble need freertos,so you should set SUPPORT_FREERTOS=y")
endif()
add_subdirectory(components/ble)
endif()
search_application(${CMAKE_SOURCE_DIR}/${APP_DIR})

View File

@ -1,20 +1,30 @@
BOARD?=bl706_iot BOARD?=bl706_iot
APP?=helloworld
CHIP?=bl702 CHIP?=bl702
INTERFACE?=jlink APP_DIR?=examples
BAUDRATE ?=12000 APP?=helloworld
CPU_ID?=m0
SUPPORT_SHELL?=n SUPPORT_SHELL?=n
SUPPORT_FREERTOS?=n SUPPORT_FREERTOS?=n
SUPPORT_LVGL?=n SUPPORT_LVGL?=n
SUPPORT_FLOAT?=n SUPPORT_FLOAT?=n
SUPPORT_BLE?=n
SUPPORT_XZ?=n
INTERFACE?=jlink
BAUDRATE ?=12000
export BOARD export BOARD
export CHIP
export APP_DIR
export APP export APP
export CPU_ID
export SUPPORT_SHELL export SUPPORT_SHELL
export SUPPORT_FREERTOS export SUPPORT_FREERTOS
export SUPPORT_LVGL export SUPPORT_LVGL
export SUPPORT_FLOAT export SUPPORT_FLOAT
export SUPPORT_BLE
export SUPPORT_XZ
# The command to remove a file. # The command to remove a file.
RM = cmake -E rm -rf RM = cmake -E rm -rf

View File

@ -5,7 +5,7 @@
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/> <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/> <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/> <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doSecondReset" value="true"/> <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doSecondReset" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/> <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/> <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.enableSemihosting" value="false"/> <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.enableSemihosting" value="false"/>
@ -16,7 +16,7 @@
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="${openocd_path}/${openocd_executable}"/> <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="${openocd_path}/${openocd_executable}"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/> <intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/> <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-f tools\openocd\if_bflb_dbg.cfg -f tools\openocd\tgt_702.cfg"/> <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-f tools\openocd\if_702_hack.cfg -f tools\openocd\tgt_702.cfg"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/> <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/> <intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/> <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/>
@ -46,7 +46,7 @@
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> <booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/> <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="D:\BouffaloLabWS\bl_mcu_sdk\out\adc\adc_one_signle_test.elf"/> <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="F:\bl_mcu_sdk\out\hellowd\helloworld\helloworld_main.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="bl_mcu_sdk"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="bl_mcu_sdk"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/> <booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.base.528944072"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.base.528944072"/>
@ -59,4 +59,5 @@
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#13;&#10;"/> <stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.embedcdt.debug.gdbjtag.core.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;peripherals/&gt;&#13;&#10;"/> <stringAttribute key="org.eclipse.embedcdt.debug.gdbjtag.core.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;peripherals/&gt;&#13;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> <stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
<stringAttribute key="saved_expressions&lt;seperator&gt;Unknown" value="0x42020000,0x42010000"/>
</launchConfiguration> </launchConfiguration>

63
bl_mcu_ram.launch Normal file
View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.openocd.launchConfigurationType">
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doContinue" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doSecondReset" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.enableSemihosting" value="false"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.firstResetType" value="init"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value="-x tools\openocd\702.init"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="${openocd_path}/${openocd_executable}"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-f tools\openocd\if_702_hack.cfg -f tools\openocd\tgt_702.cfg"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherRunCommands" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.secondResetType" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.svdPath" value="${project_loc}\drivers\bl702_driver\regs\soc702_reg.svd"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU OpenOCD"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value="22010000"/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${eclipse_home}\riscv64-unknown-elf-gcc-mingw32\bin\riscv64-unknown-elf-gdb.exe"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="F:\bl_mcu_sdk\out\jtag_test\jtag_test_main.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="bl_mcu_sdk"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.base.528944072"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/bl_mcu_sdk"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;&gt;&#13;&#10; &lt;memoryBlockExpression address=&quot;570490880&quot; label=&quot;0x22010000&quot;/&gt;&#13;&#10;&lt;/memoryBlockExpressionList&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.embedcdt.debug.gdbjtag.core.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;peripherals/&gt;&#13;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
<stringAttribute key="saved_expressions&lt;seperator&gt;Unknown" value="0x42000000"/>
</launchConfiguration>

View File

@ -1,4 +1,17 @@
PHONY := __build cmake_definition+= -DCHIP=$(CHIP)
cmake_definition+= -DCPU_ID=$(CPU_ID)
cmake_definition+= -DBOARD=$(BOARD)
cmake_definition+= -DSUPPORT_FLOAT=$(SUPPORT_FLOAT)
cmake_definition+= -DSUPPORT_SHELL=$(SUPPORT_SHELL)
cmake_definition+= -DSUPPORT_FREERTOS=$(SUPPORT_FREERTOS)
cmake_definition+= -DSUPPORT_LVGL=$(SUPPORT_LVGL)
cmake_definition+= -DSUPPORT_BLE=$(SUPPORT_BLE)
cmake_definition+= -DSUPPORT_XZ=$(SUPPORT_XZ)
cmake_definition+= -DAPP_DIR=$(APP_DIR)
cmake_definition+= -DAPP=$(APP)
__build: __build:
cmake -DBOARD=$(BOARD) -DSUPPORT_SHELL=$(SUPPORT_SHELL) -DSUPPORT_FREERTOS=$(SUPPORT_FREERTOS) -DSUPPORT_LVGL=$(SUPPORT_LVGL) -DSUPPORT_FLOAT=$(SUPPORT_FLOAT) -DAPP=$(APP) .. cmake $(cmake_definition) ..
make -j make -j4
.PHONY:__build

Binary file not shown.

View File

@ -0,0 +1,21 @@
build
bflb_iot_tool.exe --chipname=bl602 --xtal=40M --firmware="D:\\bouffalolab\\tool\\bflb-flash-tool\\img\\project.bin" --build
build + download
bflb_iot_tool.exe --chipname=bl602 --port=COM9 --xtal=40M --firmware="D:\\bouffalolab\\tool\\bflb-flash-tool\\img\\project.bin"
--chipname必填
--interface默认uart
--portcom口默认自动查找
--baudrate波特率默认115200
--xtalxtal
--dtsdevice tree文件
--firmware默认img目录下的project.bin
--build只生成镜像
--erase擦除flash
--single单文件烧写
--addr烧写地址默认0
--configeflash_loader_cfg.ini

Binary file not shown.

View File

@ -0,0 +1,23 @@
build
bflb_mcu_tool.exe --chipname=bl602 --xtal=40M --flashclk=48M --firmware="D:\\bouffalolab\\tool\\bflb-flash-tool\\img\\project.bin" --build
build + download
bflb_mcu_tool.exe --chipname=bl602 --port=COM9 --xtal=40M --flashclk=48M --firmware="D:\\bouffalolab\\tool\\bflb-flash-tool\\img\\project.bin"
--chipname必填
--interface默认uart
--bootsrc默认flash
--portcom口默认自动查找
--baudrate波特率默认115200
--xtalxtal
--flashclkflash clock
--pllclkpll clock
--firmware默认img目录下的project.bin
--addr烧写地址默认2000
--build只生成镜像
--erase擦除flash

View File

@ -79,5 +79,8 @@
xtal = <36 36 0 60 60>; xtal = <36 36 0 60 60>;
pwr = <14>; pwr = <14>;
}; };
rf_temp {
en_tcal = <0>;
};
}; };
}; };

View File

@ -79,5 +79,8 @@
xtal = <36 36 0 60 60>; xtal = <36 36 0 60 60>;
pwr = <14>; pwr = <14>;
}; };
rf_temp {
en_tcal = <0>;
};
}; };
}; };

View File

@ -79,5 +79,8 @@
xtal = <36 36 0 60 60>; xtal = <36 36 0 60 60>;
pwr = <14>; pwr = <14>;
}; };
rf_temp {
en_tcal = <0>;
};
}; };
}; };

View File

@ -0,0 +1,196 @@
[EFUSE_CFG]
########################################################################
#2bits
ef_sf_aes_mode = 0
#2bits
ef_sboot_sign_mode = 0
#2bits
ef_sboot_en = 0
#2bits
ef_dbg_jtag_dis = 0
#4bits
ef_dbg_mode = 0
#32bits
ef_dbg_pwd_low = 0
#32bits
ef_dbg_pwd_high = 0
###################################################################
ef_key_slot_2_w0 = 0
ef_key_slot_2_w1 = 0
ef_key_slot_2_w2 = 0
ef_key_slot_2_w3 = 0
ef_key_slot_3_w0 = 0
ef_key_slot_3_w1 = 0
ef_key_slot_3_w2 = 0
ef_key_slot_3_w3 = 0
ef_key_slot_4_w0 = 0
ef_key_slot_4_w1 = 0
ef_key_slot_4_w2 = 0
ef_key_slot_4_w3 = 0
wr_lock_key_slot_4_l = 0
wr_lock_dbg_pwd = 0
wr_lock_key_slot_2 = 0
wr_lock_key_slot_3 = 0
wr_lock_key_slot_4_h = 0
rd_lock_dbg_pwd = 0
rd_lock_key_slot_2 = 0
rd_lock_key_slot_3 = 0
rd_lock_key_slot_4 = 0
[BOOTHEADER_CFG]
magic_code = 0x504e4642
revision = 0x01
#########################flash cfg#############################
flashcfg_magic_code = 0x47464346
#flashcfg_magic_code=0
io_mode = 4
cont_read_support = 1
sfctrl_clk_delay = 1
sfctrl_clk_invert = 0x01
reset_en_cmd = 0x66
reset_cmd = 0x99
exit_contread_cmd = 0xff
exit_contread_cmd_size = 3
jedecid_cmd = 0x9f
jedecid_cmd_dmy_clk = 0
qpi_jedecid_cmd = 0x9f
qpi_jedecid_dmy_clk = 0
sector_size = 4
mfg_id = 0xef
page_size = 256
chip_erase_cmd = 0xc7
sector_erase_cmd = 0x20
blk32k_erase_cmd = 0x52
blk64k_erase_cmd = 0xd8
write_enable_cmd = 0x06
page_prog_cmd = 0x02
qpage_prog_cmd = 0x32
qual_page_prog_addr_mode = 0
fast_read_cmd = 0x0b
fast_read_dmy_clk = 1
qpi_fast_read_cmd = 0x0b
qpi_fast_read_dmy_clk = 1
fast_read_do_cmd = 0x3b
fast_read_do_dmy_clk = 1
fast_read_dio_cmd = 0xbb
fast_read_dio_dmy_clk = 0
fast_read_qo_cmd = 0x6b
fast_read_qo_dmy_clk = 1
fast_read_qio_cmd = 0xeb
fast_read_qio_dmy_clk = 2
qpi_fast_read_qio_cmd = 0xeb
qpi_fast_read_qio_dmy_clk = 2
qpi_page_prog_cmd = 0x02
write_vreg_enable_cmd = 0x50
wel_reg_index = 0
qe_reg_index = 1
busy_reg_index = 0
wel_bit_pos = 1
qe_bit_pos = 1
busy_bit_pos = 0
wel_reg_write_len = 2
wel_reg_read_len = 1
qe_reg_write_len = 1
qe_reg_read_len = 1
release_power_down = 0xab
busy_reg_read_len = 1
reg_read_cmd0 = 0x05
reg_read_cmd1 = 0x35
reg_write_cmd0 = 0x01
reg_write_cmd1 = 0x31
enter_qpi_cmd = 0x38
exit_qpi_cmd = 0xff
cont_read_code = 0x20
cont_read_exit_code = 0xff
burst_wrap_cmd = 0x77
burst_wrap_dmy_clk = 0x03
burst_wrap_data_mode = 2
burst_wrap_code = 0x40
de_burst_wrap_cmd = 0x77
de_burst_wrap_cmd_dmy_clk = 0x03
de_burst_wrap_code_mode = 2
de_burst_wrap_code = 0xF0
sector_erase_time = 300
blk32k_erase_time = 1200
blk64k_erase_time = 1200
page_prog_time = 5
chip_erase_time = 65535
power_down_delay = 3
qe_data = 0
flashcfg_crc32 = 0
#########################clk cfg####################################
clkcfg_magic_code = 0x47464350
#clkcfg_magic_code=0
#0:Not use XTAL to set PLL, 1:XTAL is 32M, 2:XTAL is RC32M
xtal_type = 1
#0:RC32M, 1:XTAL, 2:PLL 57.6M, 3:PLL 96M, 4:PLL 144M
pll_clk = 4
hclk_div = 0
bclk_div = 1
#0:144M, 1:XCLK(RC32M or XTAL), 2:57.6M, 3:72M, 4:BCLK, 5:96M
flash_clk_type = 3
flash_clk_div = 0
clkcfg_crc32 = 0
########################boot cfg####################################
#1:ECC
sign = 0
#1:AES128,2:AES256,3:AES192
encrypt_type = 0
key_sel = 0
no_segment = 1
cache_enable = 1
notload_in_bootrom = 0
aes_region_lock = 0
cache_way_disable = 0
crc_ignore = 0
hash_ignore = 0
boot2_enable = 0
boot2_rollback = 0
########################image cfg####################################
#total image len or segment count
img_len = 0x100
bootentry = 0
#img RAM address or flash offset
img_start = 0x2000
#img hash
hash_0 = 0xdeadbeef
hash_1 = 0
hash_2 = 0
hash_3 = 0
hash_4 = 0
hash_5 = 0
hash_6 = 0
hash_7 = 0
#address of partition tables for boot2 in bootrom
boot2_pt_table_0 = 0x1000
boot2_pt_table_1 = 0x2000
crc32 = 0xdeadbeef

View File

@ -0,0 +1,15 @@
[Img_Cfg]
boot_header_file = d:\BouffaloLabWS\bl_mcu_sdk\tools\bflb_flash_tool\chips\bl702\img_create_mcu/bootheader.bin
efuse_file = d:\BouffaloLabWS\bl_mcu_sdk\tools\bflb_flash_tool\chips\bl702\img_create_mcu/efusedata.bin
efuse_mask_file = d:\BouffaloLabWS\bl_mcu_sdk\tools\bflb_flash_tool\chips\bl702\img_create_mcu/efusedata_mask.bin
encrypt_key_org = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
aesiv_file = img_create/aesiv_cpu0.bin
publickey_file = ""
privatekey_file_uecc = ""
segheader_file = d:\BouffaloLabWS\bl_mcu_sdk\tools\bflb_flash_tool\chips\bl702\img_create_mcu/segheader_tmp.bin
segdata_file = D:/BouffaloLabWS/bl_mcu_sdk/examples/timer/timer_basic/cdk/Obj/timer_basic.bin
bootinfo_file = d:\BouffaloLabWS\bl_mcu_sdk\tools\bflb_flash_tool\chips\bl702\img_create_mcu/bootinfo.bin
img_file = d:\BouffaloLabWS\bl_mcu_sdk\tools\bflb_flash_tool\chips\bl702\img_create_mcu/img.bin
whole_img_file = d:\BouffaloLabWS\bl_mcu_sdk\tools\bflb_flash_tool\chips\bl702\img_create_mcu/img_if.bin
aes_key_org = ""
aes_iv = ""

View File

@ -11,20 +11,28 @@ del /a /f /s /q .\chips\bl702\img_create_iot\*.bin
del /a /f /s /q .\chips\bl56x\img_create_iot\*.bin del /a /f /s /q .\chips\bl56x\img_create_iot\*.bin
del /a /f /s /q .\chips\bl60x\img_create_iot\*.bin del /a /f /s /q .\chips\bl60x\img_create_iot\*.bin
del /a /f /s /q .\chips\bl606p\img_create_iot\*.bin del /a /f /s /q .\chips\bl606p\img_create_iot\*.bin
del /a /f /s /q .\chips\bl602u\img_create_iot\*.bin
del /a /f /s /q .\chips\bl808\img_create_iot\*.bin
del /a /f /s /q .\chips\bl602\img_create_mcu\*.bin del /a /f /s /q .\chips\bl602\img_create_mcu\*.bin
del /a /f /s /q .\chips\bl702\img_create_mcu\*.bin del /a /f /s /q .\chips\bl702\img_create_mcu\*.bin
del /a /f /s /q .\chips\bl56x\img_create_mcu\*.bin del /a /f /s /q .\chips\bl56x\img_create_mcu\*.bin
del /a /f /s /q .\chips\bl60x\img_create_mcu\*.bin del /a /f /s /q .\chips\bl60x\img_create_mcu\*.bin
del /a /f /s /q .\chips\bl606p\img_create_mcu\*.bin del /a /f /s /q .\chips\bl606p\img_create_mcu\*.bin
del /a /f /s /q .\chips\bl602u\img_create_mcu\*.bin
del /a /f /s /q .\chips\bl808\img_create_mcu\*.bin
del /a /f /s /q .\chips\bl602\efuse_bootheader\*.bin del /a /f /s /q .\chips\bl602\efuse_bootheader\*.bin
del /a /f /s /q .\chips\bl702\efuse_bootheader\*.bin del /a /f /s /q .\chips\bl702\efuse_bootheader\*.bin
del /a /f /s /q .\chips\bl56x\efuse_bootheader\*.bin del /a /f /s /q .\chips\bl56x\efuse_bootheader\*.bin
del /a /f /s /q .\chips\bl60x\efuse_bootheader\*.bin del /a /f /s /q .\chips\bl60x\efuse_bootheader\*.bin
del /a /f /s /q .\chips\bl606p\efuse_bootheader\*.bin del /a /f /s /q .\chips\bl606p\efuse_bootheader\*.bin
del /a /f /s /q .\chips\bl602u\efuse_bootheader\*.bin
del /a /f /s /q .\chips\bl808\efuse_bootheader\*.bin
del /a /f /s /q .\chips\*.pack del /a /f /s /q .\chips\*.pack
rd /s /Q .\chips\bl602\ota rd /s /Q .\chips\bl602\ota
rd /s /Q .\chips\bl702\ota rd /s /Q .\chips\bl702\ota
rd /s /Q .\chips\bl56x\ota rd /s /Q .\chips\bl56x\ota
rd /s /Q .\chips\bl60x\ota rd /s /Q .\chips\bl60x\ota
rd /s /Q .\chips\bl606p\ota rd /s /Q .\chips\bl606p\ota
rd /s /Q .\chips\bl602u\ota
rd /s /Q .\chips\bl808\ota
pause pause

View File

@ -0,0 +1,73 @@
[FLASH_CFG]
exit_contread_cmd = 0xff
exit_contread_cmd_size = 3
mfg_id = 0xeb
io_mode = 4
de_burst_wrap_cmd = 0x77
de_burst_wrap_cmd_dmy_clk = 0x03
de_burst_wrap_code_mode = 2
de_burst_wrap_code = 0xF0
write_enable_cmd = 0x06
wel_reg_index = 0
wel_bit_pos = 1
wel_reg_read_len = 1
wel_reg_write_len = 2
qe_reg_index = 1
qe_bit_pos = 1
qe_reg_write_len = 2
qe_reg_read_len = 1
busy_reg_index = 0
busy_bit_pos = 0
busy_reg_read_len = 1
release_power_down = 0xab
reg_read_cmd0 = 0x05
reg_read_cmd1 = 0x35
reg_write_cmd0 = 0x01
reg_write_cmd1 = 0x01
fast_read_qio_cmd = 0xeb
fast_read_qio_dmy_clk = 2
cont_read_support = 1
cont_read_code = 0xa0
burst_wrap_cmd = 0x77
burst_wrap_dmy_clk = 0x03
burst_wrap_data_mode = 2
burst_wrap_code = 0x40
chip_erase_cmd = 0xc7
sector_erase_cmd = 0x20
blk32k_erase_cmd = 0x52
blk64k_erase_cmd = 0xd8
page_prog_cmd = 0x02
qpage_prog_cmd = 0x32
qual_page_prog_addr_mode = 0
reset_en_cmd = 0x66
reset_cmd = 0x99
cont_read_exit_code = 0xff
jedecid_cmd = 0x9f
jedecid_cmd_dmy_clk = 0
qpi_jedecid_cmd = 0x9f
qpi_jedecid_dmy_clk = 0
sector_size = 4
page_size = 256
fast_read_cmd = 0x0b
fast_read_dmy_clk = 1
qpi_fast_read_cmd = 0x0b
qpi_fast_read_dmy_clk = 1
fast_read_do_cmd = 0x3b
fast_read_do_dmy_clk = 1
fast_read_dio_cmd = 0xbb
fast_read_dio_dmy_clk = 0
fast_read_qo_cmd = 0x6b
fast_read_qo_dmy_clk = 1
qpi_fast_read_qio_cmd = 0xeb
qpi_fast_read_qio_dmy_clk = 2
qpi_page_prog_cmd = 0x02
write_vreg_enable_cmd = 0x50
enter_qpi_cmd = 0x38
exit_qpi_cmd = 0xff
sector_erase_time = 800
blk32k_erase_time = 3000
blk64k_erase_time = 4000
page_prog_time = 10
chip_erase_time = 65535
power_down_delay = 20
qe_data = 0

View File

@ -0,0 +1,73 @@
[FLASH_CFG]
exit_contread_cmd = 0xff
exit_contread_cmd_size = 3
mfg_id = 0x5e
io_mode = 0x11
de_burst_wrap_cmd = 0x77
de_burst_wrap_cmd_dmy_clk = 0x03
de_burst_wrap_code_mode = 2
de_burst_wrap_code = 0xF0
write_enable_cmd = 0x06
wel_reg_index = 0
wel_bit_pos = 1
wel_reg_read_len = 1
wel_reg_write_len = 2
qe_reg_index = 1
qe_bit_pos = 1
qe_reg_write_len = 1
qe_reg_read_len = 1
busy_reg_index = 0
busy_bit_pos = 0
busy_reg_read_len = 1
release_power_down = 0xab
reg_read_cmd0 = 0x05
reg_read_cmd1 = 0x35
reg_write_cmd0 = 0x01
reg_write_cmd1 = 0x31
fast_read_qio_cmd = 0xeb
fast_read_qio_dmy_clk = 2
cont_read_support = 0
cont_read_code = 0x20
burst_wrap_cmd = 0x77
burst_wrap_dmy_clk = 0x03
burst_wrap_data_mode = 2
burst_wrap_code = 0x40
chip_erase_cmd = 0xc7
sector_erase_cmd = 0x20
blk32k_erase_cmd = 0x52
blk64k_erase_cmd = 0xd8
page_prog_cmd = 0x02
qpage_prog_cmd = 0x32
qual_page_prog_addr_mode = 0
reset_en_cmd = 0x66
reset_cmd = 0x99
cont_read_exit_code = 0xff
jedecid_cmd = 0x9f
jedecid_cmd_dmy_clk = 0
qpi_jedecid_cmd = 0x9f
qpi_jedecid_dmy_clk = 0
sector_size = 4
page_size = 256
fast_read_cmd = 0x0b
fast_read_dmy_clk = 1
qpi_fast_read_cmd = 0x0b
qpi_fast_read_dmy_clk = 1
fast_read_do_cmd = 0x3b
fast_read_do_dmy_clk = 1
fast_read_dio_cmd = 0xbb
fast_read_dio_dmy_clk = 0
fast_read_qo_cmd = 0x6b
fast_read_qo_dmy_clk = 1
qpi_fast_read_qio_cmd = 0xeb
qpi_fast_read_qio_dmy_clk = 2
qpi_page_prog_cmd = 0x02
write_vreg_enable_cmd = 0x50
enter_qpi_cmd = 0x38
exit_qpi_cmd = 0xff
sector_erase_time = 300
blk32k_erase_time = 1200
blk64k_erase_time = 1200
page_prog_time = 5
chip_erase_time = 33000
power_down_delay = 8
qe_data = 0

View File

@ -0,0 +1,73 @@
[FLASH_CFG]
exit_contread_cmd = 0xff
exit_contread_cmd_size = 3
mfg_id = 0x5e
io_mode = 0x11
de_burst_wrap_cmd = 0x77
de_burst_wrap_cmd_dmy_clk = 0x03
de_burst_wrap_code_mode = 2
de_burst_wrap_code = 0xF0
write_enable_cmd = 0x06
wel_reg_index = 0
wel_bit_pos = 1
wel_reg_read_len = 1
wel_reg_write_len = 2
qe_reg_index = 1
qe_bit_pos = 1
qe_reg_write_len = 1
qe_reg_read_len = 1
busy_reg_index = 0
busy_bit_pos = 0
busy_reg_read_len = 1
release_power_down = 0xab
reg_read_cmd0 = 0x05
reg_read_cmd1 = 0x35
reg_write_cmd0 = 0x01
reg_write_cmd1 = 0x31
fast_read_qio_cmd = 0xeb
fast_read_qio_dmy_clk = 2
cont_read_support = 0
cont_read_code = 0x20
burst_wrap_cmd = 0x77
burst_wrap_dmy_clk = 0x03
burst_wrap_data_mode = 2
burst_wrap_code = 0x40
chip_erase_cmd = 0xc7
sector_erase_cmd = 0x20
blk32k_erase_cmd = 0x52
blk64k_erase_cmd = 0xd8
page_prog_cmd = 0x02
qpage_prog_cmd = 0x32
qual_page_prog_addr_mode = 0
reset_en_cmd = 0x66
reset_cmd = 0x99
cont_read_exit_code = 0xff
jedecid_cmd = 0x9f
jedecid_cmd_dmy_clk = 0
qpi_jedecid_cmd = 0x9f
qpi_jedecid_dmy_clk = 0
sector_size = 4
page_size = 256
fast_read_cmd = 0x0b
fast_read_dmy_clk = 1
qpi_fast_read_cmd = 0x0b
qpi_fast_read_dmy_clk = 1
fast_read_do_cmd = 0x3b
fast_read_do_dmy_clk = 1
fast_read_dio_cmd = 0xbb
fast_read_dio_dmy_clk = 0
fast_read_qo_cmd = 0x6b
fast_read_qo_dmy_clk = 1
qpi_fast_read_qio_cmd = 0xeb
qpi_fast_read_qio_dmy_clk = 2
qpi_page_prog_cmd = 0x02
write_vreg_enable_cmd = 0x50
enter_qpi_cmd = 0x38
exit_qpi_cmd = 0xff
sector_erase_time = 300
blk32k_erase_time = 1200
blk64k_erase_time = 1200
page_prog_time = 5
chip_erase_time = 33000
power_down_delay = 8
qe_data = 0

View File

@ -0,0 +1,73 @@
[FLASH_CFG]
exit_contread_cmd = 0xff
exit_contread_cmd_size = 3
mfg_id = 0x5e
io_mode = 4
de_burst_wrap_cmd = 0x77
de_burst_wrap_cmd_dmy_clk = 0x03
de_burst_wrap_code_mode = 2
de_burst_wrap_code = 0xF0
write_enable_cmd = 0x06
wel_reg_index = 0
wel_bit_pos = 1
wel_reg_read_len = 1
wel_reg_write_len = 2
qe_reg_index = 1
qe_bit_pos = 1
qe_reg_write_len = 1
qe_reg_read_len = 1
busy_reg_index = 0
busy_bit_pos = 0
busy_reg_read_len = 1
release_power_down = 0xab
reg_read_cmd0 = 0x05
reg_read_cmd1 = 0x35
reg_write_cmd0 = 0x01
reg_write_cmd1 = 0x31
fast_read_qio_cmd = 0xeb
fast_read_qio_dmy_clk = 2
cont_read_support = 1
cont_read_code = 0x20
burst_wrap_cmd = 0x77
burst_wrap_dmy_clk = 0x03
burst_wrap_data_mode = 2
burst_wrap_code = 0x40
chip_erase_cmd = 0xc7
sector_erase_cmd = 0x20
blk32k_erase_cmd = 0x52
blk64k_erase_cmd = 0xd8
page_prog_cmd = 0x02
qpage_prog_cmd = 0x32
qual_page_prog_addr_mode = 0
reset_en_cmd = 0x66
reset_cmd = 0x99
cont_read_exit_code = 0xff
jedecid_cmd = 0x9f
jedecid_cmd_dmy_clk = 0
qpi_jedecid_cmd = 0x9f
qpi_jedecid_dmy_clk = 0
sector_size = 4
page_size = 256
fast_read_cmd = 0x0b
fast_read_dmy_clk = 1
qpi_fast_read_cmd = 0x0b
qpi_fast_read_dmy_clk = 1
fast_read_do_cmd = 0x3b
fast_read_do_dmy_clk = 1
fast_read_dio_cmd = 0xbb
fast_read_dio_dmy_clk = 0
fast_read_qo_cmd = 0x6b
fast_read_qo_dmy_clk = 1
qpi_fast_read_qio_cmd = 0xeb
qpi_fast_read_qio_dmy_clk = 2
qpi_page_prog_cmd = 0x02
write_vreg_enable_cmd = 0x50
enter_qpi_cmd = 0x38
exit_qpi_cmd = 0xff
sector_erase_time = 300
blk32k_erase_time = 1200
blk64k_erase_time = 1200
page_prog_time = 5
chip_erase_time = 33000
power_down_delay = 8
qe_data = 0

View File

@ -64,9 +64,9 @@ qpi_page_prog_cmd = 0x02
write_vreg_enable_cmd = 0x50 write_vreg_enable_cmd = 0x50
enter_qpi_cmd = 0x38 enter_qpi_cmd = 0x38
exit_qpi_cmd = 0xff exit_qpi_cmd = 0xff
sector_erase_time = 300 sector_erase_time = 400
blk32k_erase_time = 1200 blk32k_erase_time = 1600
blk64k_erase_time = 1200 blk64k_erase_time = 2000
page_prog_time = 5 page_prog_time = 5
chip_erase_time = 65535 chip_erase_time = 65535
power_down_delay = 8 power_down_delay = 8

View File

@ -0,0 +1,73 @@
[FLASH_CFG]
exit_contread_cmd = 0xff
exit_contread_cmd_size = 3
mfg_id = 0x5e
io_mode = 4
de_burst_wrap_cmd = 0x77
de_burst_wrap_cmd_dmy_clk = 0x03
de_burst_wrap_code_mode = 2
de_burst_wrap_code = 0xF0
write_enable_cmd = 0x06
wel_reg_index = 0
wel_bit_pos = 1
wel_reg_read_len = 1
wel_reg_write_len = 2
qe_reg_index = 1
qe_bit_pos = 1
qe_reg_write_len = 1
qe_reg_read_len = 1
busy_reg_index = 0
busy_bit_pos = 0
busy_reg_read_len = 1
release_power_down = 0xab
reg_read_cmd0 = 0x05
reg_read_cmd1 = 0x35
reg_write_cmd0 = 0x01
reg_write_cmd1 = 0x31
fast_read_qio_cmd = 0xeb
fast_read_qio_dmy_clk = 2
cont_read_support = 1
cont_read_code = 0x20
burst_wrap_cmd = 0x77
burst_wrap_dmy_clk = 0x03
burst_wrap_data_mode = 2
burst_wrap_code = 0x40
chip_erase_cmd = 0xc7
sector_erase_cmd = 0x20
blk32k_erase_cmd = 0x52
blk64k_erase_cmd = 0xd8
page_prog_cmd = 0x02
qpage_prog_cmd = 0x32
qual_page_prog_addr_mode = 0
reset_en_cmd = 0x66
reset_cmd = 0x99
cont_read_exit_code = 0xff
jedecid_cmd = 0x9f
jedecid_cmd_dmy_clk = 0
qpi_jedecid_cmd = 0x9f
qpi_jedecid_dmy_clk = 0
sector_size = 4
page_size = 256
fast_read_cmd = 0x0b
fast_read_dmy_clk = 1
qpi_fast_read_cmd = 0x0b
qpi_fast_read_dmy_clk = 1
fast_read_do_cmd = 0x3b
fast_read_do_dmy_clk = 1
fast_read_dio_cmd = 0xbb
fast_read_dio_dmy_clk = 0
fast_read_qo_cmd = 0x6b
fast_read_qo_dmy_clk = 1
qpi_fast_read_qio_cmd = 0xeb
qpi_fast_read_qio_dmy_clk = 2
qpi_page_prog_cmd = 0x02
write_vreg_enable_cmd = 0x50
enter_qpi_cmd = 0x38
exit_qpi_cmd = 0xff
sector_erase_time = 300
blk32k_erase_time = 1200
blk64k_erase_time = 1200
page_prog_time = 5
chip_erase_time = 33000
power_down_delay = 8
qe_data = 0

Binary file not shown.

View File

@ -0,0 +1,16 @@
# BouffaloLab USB-JTAG/TTL adapter
interface ftdi
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 0
#ftdi_tdo_sample_edge falling
transport select jtag
adapter_khz 4000
ftdi_layout_init 0x00f8 0x00fb
#ftdi_layout_signal nTRST -data 0x0400
#ftdi_layout_signal nSRST -ndata 0x0020
#reset_config srst_only srst_push_pull
#adapter_nsrst_delay 100
#adapter_nsrst_assert_width 100

View File

@ -1,100 +1,18 @@
#set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) include(${CMAKE_SOURCE_DIR}/drivers/${CHIP}_driver/cpu_flags.cmake)
# Object build options
# -O0 No optimizations, reduce compilation time and make debugging produce the expected results.
# -fno-builtin Do not use built-in functions provided by GCC.
# -Wall Print only standard warnings, for all use Wextra
# -ffunction-sections Place each function item into its own section in the output file.
# -fdata-sections Place each data item into its own section in the output file.
# -fomit-frame-pointer Omit the frame pointer in functions that dont need one.
# -Og Enables optimizations that do not interfere with debugging.
# -g Produce debugging information in the operating systems native format.
# -Os Optimize for size. -Os enables all -O2 optimizations.
# -flto Runs the standard link-time optimizer.
SET(MCPU "riscv-e24")
if(${SUPPORT_FLOAT} STREQUAL "y")
SET(MARCH "rv32imafc")
SET(MABI "ilp32f")
else()
SET(MARCH "rv32imac")
SET(MABI "ilp32")
endif()
SET(MCU_FLAG "-march=${MARCH} -mabi=${MABI}")
SET(COMMON_FLAGS "-Os -g3 -fshort-enums -fno-common \ list(APPEND GLOBAL_C_FLAGS -Os -g3)
-fms-extensions -ffunction-sections -fdata-sections -fstrict-volatile-bitfields \ list(APPEND GLOBAL_C_FLAGS -fshort-enums -fno-common -fms-extensions -ffunction-sections -fdata-sections -fstrict-volatile-bitfields)
-Wall -Wshift-negative-value -Wchar-subscripts -Wformat -Wuninitialized -Winit-self \ list(APPEND GLOBAL_C_FLAGS -Wall -Wshift-negative-value -Wchar-subscripts -Wformat -Wuninitialized -Winit-self -Wignored-qualifiers -Wunused -Wundef)
-Wignored-qualifiers -Wunused -Wundef -msmall-data-limit=4") list(APPEND GLOBAL_C_FLAGS -msmall-data-limit=4)
# compiler: language specific flags list(APPEND GLOBAL_LD_FLAGS -Wl,--cref -Wl,--gc-sections -nostartfiles -g3)
set(CMAKE_C_FLAGS "${MCU_FLAG} ${COMMON_FLAGS} -std=c99" CACHE INTERNAL "c compiler flags") list(APPEND GLOBAL_LD_FLAGS -fms-extensions -ffunction-sections -fdata-sections)
set(CMAKE_C_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "c compiler flags: Debug") list(APPEND GLOBAL_LD_FLAGS -Wall -Wchar-subscripts -std=c99)
set(CMAKE_C_FLAGS_RELEASE "-Os" CACHE INTERNAL "c compiler flags: Release")
# message("") # Add common options
# message("-----------------------------------------------------------------------------------------------------------------------------------------------------") add_compile_options(${GLOBAL_C_FLAGS})
# message("Setting C compiler") add_compile_options($<$<COMPILE_LANGUAGE:C>:-std=c99>)
# message("C compiler flags options: ${CMAKE_C_FLAGS}") add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++11>)
# message("C compiler debug options: ${CMAKE_C_FLAGS_DEBUG}") add_link_options(${GLOBAL_LD_FLAGS})
# message("C compiler release options: ${CMAKE_C_FLAGS_RELEASE}")
# message("-----------------------------------------------------------------------------------------------------------------------------------------------------")
set(CMAKE_CXX_FLAGS "${MCU_FLAG} ${COMMON_FLAGS} -std=c++11 " CACHE INTERNAL "cxx compiler flags")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "cxx compiler flags: Debug")
set(CMAKE_CXX_FLAGS_RELEASE "-Os" CACHE INTERNAL "cxx compiler flags: Release")
# message("")
# message("-----------------------------------------------------------------------------------------------------------------------------------------------------")
# message("Setting C++ compiler")
# message("C++ compiler flags options: ${CMAKE_CXX_FLAGS}")
# message("C++ compiler debug options: ${CMAKE_CXX_FLAGS_DEBUG}")
# message("C++ compiler release options: ${CMAKE_CXX_FLAGS_RELEASE}")
# message("-----------------------------------------------------------------------------------------------------------------------------------------------------")
set(CMAKE_ASM_FLAGS "${MCU_FLAG} ${COMMON_FLAGS}" CACHE INTERNAL "asm compiler flags")
set(CMAKE_ASM_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "asm compiler flags: Debug")
set(CMAKE_ASM_FLAGS_RELEASE "-Os" CACHE INTERNAL "asm compiler flags: Release")
# message("")
# message("-----------------------------------------------------------------------------------------------------------------------------------------------------")
# message("Setting ASM compiler")
# message("ASM compiler flags options: ${CMAKE_ASM_FLAGS}")
# message("ASM compiler debug options: ${CMAKE_ASM_FLAGS_DEBUG}")
# message("ASM compiler release options: ${CMAKE_ASM_FLAGS_RELEASE}")
# message("-----------------------------------------------------------------------------------------------------------------------------------------------------")
# -Wl,--gc-sections Perform the dead code elimination.
# --specs=nano.specs Link with newlib-nano.
# --specs=nosys.specs No syscalls, provide empty implementations for the POSIX system calls.
if(${SUPPORT_FLOAT} STREQUAL "y")
add_definitions(-DBFLB_PRINT_FLOAT_SUPPORT)
else()
endif()
if(${SUPPORT_SHELL} STREQUAL "y")
add_definitions(-DSHELL_SUPPORT)
else()
endif()
if(${BOARD} MATCHES "(bl602u.*)")
set(mcu bl602u)
elseif(${BOARD} MATCHES "(bl602).*")
set(mcu bl602)
elseif(${BOARD} MATCHES "(bl702|bl704|bl706).*")
set(mcu bl702)
elseif(${BOARD} MATCHES "(bl606p).*")
set(mcu bl606p)
else()
endif()
SET(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/drivers/${mcu}_driver/${mcu}_flash.ld)
set(CMAKE_EXE_LINKER_FLAGS "${MCU_FLAG} -Wl,--cref -Wl,--gc-sections -nostartfiles -lc -lm -g3 \
-fms-extensions -ffunction-sections -fdata-sections -Wall -Wchar-subscripts \
-Wformat -Wuninitialized -Winit-self -Wignored-qualifiers -Wswitch-default -Wunused -Wundef -std=c99" CACHE INTERNAL "Linker options")

View File

@ -1,17 +1,21 @@
function(generate_library) function(generate_library)
get_filename_component(library_name ${CMAKE_CURRENT_LIST_DIR} NAME) get_filename_component(library_name ${CMAKE_CURRENT_LIST_DIR} NAME)
message(STATUS "[register library component: ${library_name} ], path:${CMAKE_CURRENT_LIST_DIR}") message(STATUS "[register library component: ${library_name}], path:${CMAKE_CURRENT_LIST_DIR}")
# Add src to lib # Add src to lib
if(ADD_SRCS) if(ADD_SRCS)
add_library(${library_name} STATIC ${ADD_SRCS}) add_library(${library_name} STATIC ${ADD_SRCS})
set(include_type PUBLIC) set(include_type PUBLIC)
else()
add_library(${library_name} INTERFACE) foreach(f ${ADD_SRCS})
set(include_type INTERFACE) if(${f} MATCHES ".S|.s")
set_property(SOURCE ${f} PROPERTY LANGUAGE C)
endif()
endforeach()
endif() endif()
# Add include # Add global config include
if(ADD_INCLUDE)
foreach(include_dir ${ADD_INCLUDE}) foreach(include_dir ${ADD_INCLUDE})
get_filename_component(abs_dir ${include_dir} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) get_filename_component(abs_dir ${include_dir} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR})
if(NOT IS_DIRECTORY ${abs_dir}) if(NOT IS_DIRECTORY ${abs_dir})
@ -19,79 +23,74 @@ function(generate_library)
endif() endif()
target_include_directories(${library_name} ${include_type} ${abs_dir}) target_include_directories(${library_name} ${include_type} ${abs_dir})
endforeach() endforeach()
endif()
# Add private include # Add private include
if(ADD_PRIVATE_INCLUDE)
foreach(include_dir ${ADD_PRIVATE_INCLUDE}) foreach(include_dir ${ADD_PRIVATE_INCLUDE})
if(${include_type} STREQUAL INTERFACE)
message(FATAL_ERROR "${CMAKE_CURRENT_LIST_FILE}: ADD_PRIVATE_INCLUDE set but no source file")
endif()
get_filename_component(abs_dir ${include_dir} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) get_filename_component(abs_dir ${include_dir} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR})
if(NOT IS_DIRECTORY ${abs_dir}) if(NOT IS_DIRECTORY ${abs_dir})
message(FATAL_ERROR "${CMAKE_CURRENT_LIST_FILE}: ${include_dir} not found!") message(FATAL_ERROR "${CMAKE_CURRENT_LIST_FILE}: ${include_dir} not found!")
endif() endif()
target_include_directories(${library_name} PRIVATE ${abs_dir}) target_include_directories(${library_name} PRIVATE ${abs_dir})
endforeach() endforeach()
endif()
# Add global config include
target_include_directories(${library_name} PUBLIC ${global_config_dir})
# Add requirements
target_link_libraries(${library_name} ${ADD_REQUIREMENTS})
# Add definitions public # Add definitions public
foreach(difinition ${ADD_DEFINITIONS}) if(ADD_DEFINITIONS)
target_compile_options(${library_name} PUBLIC ${difinition}) target_compile_options(${library_name} PUBLIC ${ADD_DEFINITIONS})
endforeach() endif()
# Add definitions private # Add definitions private
foreach(difinition ${ADD_DEFINITIONS_PRIVATE}) if(ADD_DEFINITIONS_PRIVATE)
target_compile_options(${library_name} PRIVATE ${difinition}) target_compile_options(${library_name} PRIVATE ${ADD_DEFINITIONS_PRIVATE})
endforeach() endif()
# Add requirements
if(ADD_REQUIREMENTS)
foreach(lib ${ADD_REQUIREMENTS})
if(TARGET ${lib})
add_dependencies(${library_name} ${lib})
target_link_libraries(${library_name} ${lib})
else()
message(FATAL_ERROR "${lib} is not a target")
endif()
endforeach()
endif()
# Add static lib # Add static lib
if(ADD_STATIC_LIB) if(ADD_STATIC_LIB)
foreach(lib ${ADD_STATIC_LIB}) foreach(lib ${ADD_STATIC_LIB})
if(NOT EXISTS "${lib}") if(NOT EXISTS "${lib}")
prepend(lib_full "${CMAKE_CURRENT_LIST_DIR}/" ${lib}) message(FATAL_ERROR "Can not find ${lib}")
if(NOT EXISTS "${lib_full}")
message(FATAL_ERROR "Can not find ${lib} or ${lib_full}")
endif()
set(lib ${lib_full})
endif() endif()
target_link_libraries(${library_name} ${lib}) get_filename_component(static_lib_relative_dir ${lib} DIRECTORY)
get_filename_component(static_lib_name ${lib} NAME)
target_link_directories(${library_name} PUBLIC ${static_lib_relative_dir})
target_link_libraries(${library_name} ${static_lib_name})
endforeach() endforeach()
endif() endif()
# Add dynamic lib # Add dynamic lib
if(ADD_DYNAMIC_LIB) if(ADD_DYNAMIC_LIB)
set(dynamic_libs ${g_dynamic_libs})
foreach(lib ${ADD_DYNAMIC_LIB}) foreach(lib ${ADD_DYNAMIC_LIB})
if(NOT EXISTS "${lib}") if(NOT EXISTS "${lib}")
prepend(lib_full "${CMAKE_CURRENT_LIST_DIR}/" ${lib}) message(FATAL_ERROR "Can not find ${lib}")
if(NOT EXISTS "${lib_full}")
message(FATAL_ERROR "Can not find ${lib} or ${lib_full}")
endif()
set(lib ${lib_full})
endif() endif()
list(APPEND dynamic_libs ${lib}) get_filename_component(dynamic_lib_relative_dir ${lib} DIRECTORY)
get_filename_component(lib_dir ${lib} DIRECTORY) get_filename_component(dynamic_lib_name ${lib} NAME)
get_filename_component(lib_name ${lib} NAME) target_link_directories(${library_name} PUBLIC ${dynamic_lib_relative_dir})
target_link_libraries(${library_name} -L${lib_dir} ${lib_name}) target_link_libraries(${library_name} ${dynamic_lib_name})
endforeach() endforeach()
set(g_dynamic_libs ${dynamic_libs} CACHE INTERNAL "g_dynamic_libs")
endif() endif()
endfunction() endfunction()
function(generate_bin) function(generate_bin)
get_filename_component(current_relative_dir_name ${CMAKE_CURRENT_LIST_DIR} NAME) get_filename_component(current_relative_dir_name ${CMAKE_CURRENT_LIST_DIR} NAME)
#上面写法等价于string(REGEX REPLACE ".*/(.*)" "\\1" current_relative_dir_name ${CMAKE_CURRENT_LIST_DIR})
string(REGEX REPLACE "(.*)/${current_relative_dir_name}$" "\\1" above_absolute_dir ${CMAKE_CURRENT_LIST_DIR}) string(REGEX REPLACE "(.*)/${current_relative_dir_name}$" "\\1" above_absolute_dir ${CMAKE_CURRENT_LIST_DIR})
get_filename_component(above_relative_dir_name ${above_absolute_dir} NAME) get_filename_component(above_relative_dir_name ${above_absolute_dir} NAME)
set(platform ${CMAKE_SOURCE_DIR}/bsp/bsp_common/platform/bflb_platform.c)
foreach(mainfile IN LISTS mains) foreach(mainfile IN LISTS mains)
# Get file name without directory # Get file name without directory
get_filename_component(mainname ${mainfile} NAME_WE) get_filename_component(mainname ${mainfile} NAME_WE)
@ -101,31 +100,39 @@ function(generate_bin)
set(target_name firmware) set(target_name firmware)
else() else()
if(${above_relative_dir_name} STREQUAL "examples") if(${above_relative_dir_name} STREQUAL "examples")
set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/out/${current_relative_dir_name}) set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/out/${APP_DIR}/${current_relative_dir_name})
set(target_name ${current_relative_dir_name}_${mainname}) set(target_name ${current_relative_dir_name}_${mainname})
else() else()
set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/out/${above_relative_dir_name}/${current_relative_dir_name}) set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/out/${APP_DIR}/${above_relative_dir_name}/${current_relative_dir_name})
set(target_name ${current_relative_dir_name}_${mainname}) set(target_name ${current_relative_dir_name}_${mainname})
endif() endif()
endif() endif()
file(MAKE_DIRECTORY ${OUTPUT_DIR}) file(MAKE_DIRECTORY ${OUTPUT_DIR})
set(HEX_FILE ${OUTPUT_DIR}/main.hex) set(HEX_FILE ${OUTPUT_DIR}/${target_name}.hex)
set(BIN_FILE ${OUTPUT_DIR}/main.bin) set(BIN_FILE ${OUTPUT_DIR}/${target_name}.bin)
set(MAP_FILE ${OUTPUT_DIR}/main.map) set(MAP_FILE ${OUTPUT_DIR}/${target_name}.map)
set(ASM_FILE ${OUTPUT_DIR}/main.asm) set(ASM_FILE ${OUTPUT_DIR}/${target_name}.asm)
if(TARGET_REQUIRED_SRCS) if(TARGET_REQUIRED_SRCS)
list(APPEND SRCS ${TARGET_REQUIRED_SRCS}) foreach(src ${TARGET_REQUIRED_SRCS})
if((NOT EXISTS ${src}) AND (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${src}))
message(FATAL_ERROR "${src} not exist,maybe you should autocomplete your path\r\n")
endif()
list(APPEND SRCS ${src})
endforeach()
endif() endif()
list(APPEND SRCS ${CMAKE_SOURCE_DIR}/bsp/bsp_common/platform/bflb_platform.c)
list(APPEND SRCS ${CMAKE_SOURCE_DIR}/bsp/board/${BOARD}/board.c) list(APPEND SRCS ${CMAKE_SOURCE_DIR}/bsp/board/${BOARD}/board.c)
add_executable(${target_name}.elf ${mainfile} ${SRCS} ${platform}) add_executable(${target_name}.elf ${mainfile} ${SRCS})
set_target_properties(${target_name}.elf PROPERTIES LINK_FLAGS "-T${LINKER_SCRIPT}") set_target_properties(${target_name}.elf PROPERTIES LINK_FLAGS "-T${LINKER_SCRIPT} -Wl,-Map=${MAP_FILE}")
set_target_properties(${target_name}.elf PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT}) set_target_properties(${target_name}.elf PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT})
set_target_properties(${target_name}.elf PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}") set_target_properties(${target_name}.elf PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}")
# Add private include # Add private include
@ -138,11 +145,13 @@ function(generate_bin)
endforeach() endforeach()
# Add definitions private # Add definitions private
foreach(difinition ${TARGET_REQUIRED_PRIVATE_OPTIONS}) if(TARGET_REQUIRED_PRIVATE_OPTIONS)
target_compile_options(${target_name}.elf PRIVATE ${difinition}) target_compile_options(${target_name}.elf PRIVATE ${TARGET_REQUIRED_PRIVATE_OPTIONS})
endforeach() endif()
add_dependencies(${target_name}.elf ${CHIP}_driver)
# Add libs # Add libs
target_link_libraries(${target_name}.elf ${mcu}_driver) target_link_libraries(${target_name}.elf ${CHIP}_driver)
if(${SUPPORT_SHELL} STREQUAL "y") if(${SUPPORT_SHELL} STREQUAL "y")
target_link_libraries(${target_name}.elf shell) target_link_libraries(${target_name}.elf shell)
@ -154,7 +163,7 @@ function(generate_bin)
target_link_libraries(${target_name}.elf ${TARGET_REQUIRED_LIBS}) target_link_libraries(${target_name}.elf ${TARGET_REQUIRED_LIBS})
endif() endif()
target_link_libraries(${target_name}.elf "-Wl,-Map=${MAP_FILE}") target_link_libraries(${target_name}.elf m)
add_custom_command(TARGET ${target_name}.elf POST_BUILD add_custom_command(TARGET ${target_name}.elf POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${target_name}.elf> ${BIN_FILE} COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${target_name}.elf> ${BIN_FILE}
@ -176,11 +185,11 @@ if(DEFINED APP)
get_filename_component(app_relative_dir ${cmakelists_file} DIRECTORY) get_filename_component(app_relative_dir ${cmakelists_file} DIRECTORY)
get_filename_component(app_name ${app_relative_dir} NAME) get_filename_component(app_name ${app_relative_dir} NAME)
if(${APP} STREQUAL "all") if(${APP} STREQUAL "all")
message("[run app:${app_name}],path:${app_relative_dir}") message(STATUS "[run app:${app_name}], path:${app_relative_dir}")
add_subdirectory(${app_relative_dir}) add_subdirectory(${app_relative_dir})
set(app_find_ok 1) set(app_find_ok 1)
elseif(${app_name} MATCHES "^${APP}") elseif(${app_name} MATCHES "^${APP}")
message("[run app:${app_name}],path:${app_relative_dir}") message(STATUS "[run app:${app_name}], path:${app_relative_dir}")
add_subdirectory(${app_relative_dir}) add_subdirectory(${app_relative_dir})
set(app_find_ok 1) set(app_find_ok 1)
endif() endif()

View File

@ -0,0 +1,21 @@
# BouffaloLab USB-JTAG/TTL adapter
interface ftdi
#adapter driver ftdi
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 0
#ftdi_tdo_sample_edge falling
transport select jtag
adapter_khz 5000
#adapter speed 1000
ftdi_layout_init 0x00f8 0x00fb
#ftdi_layout_signal nTRST -data 0x0400
#ftdi_layout_signal nSRST -ndata 0x0020
#reset_config srst_only srst_push_pull
#adapter_nsrst_delay 100
#adapter_nsrst_assert_width 100
#bindto 0.0.0.0

View File

@ -12,12 +12,12 @@ echo "Ready for Remote Connections"
$_TARGETNAME.0 configure -event reset-assert-pre { $_TARGETNAME.0 configure -event reset-assert-pre {
echo "reset-assert-pre" echo "reset-assert-pre"
adapter_khz 100 adapter_khz 5000
} }
$_TARGETNAME.0 configure -event reset-deassert-post { $_TARGETNAME.0 configure -event reset-deassert-post {
echo "reset-deassert-post" echo "reset-deassert-post"
adapter_khz 4000 adapter_khz 5000
reg mstatus 0x7800 reg mstatus 0x7800
reg mie 0x0 reg mie 0x0
# reg pc 0x22008000 # reg pc 0x22008000
@ -26,7 +26,7 @@ $_TARGETNAME.0 configure -event reset-deassert-post {
$_TARGETNAME.0 configure -event reset-init { $_TARGETNAME.0 configure -event reset-init {
echo "reset-init" echo "reset-init"
# 4MHz for FPGA # 4MHz for FPGA
adapter_khz 4000 adapter_khz 5000
} }
gdb_memory_map enable gdb_memory_map enable

View File

@ -0,0 +1,45 @@
#target chip
set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10000b6f
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME
$_TARGETNAME.0 configure -work-area-phys 0x3eff0000 -work-area-size 0x10000 -work-area-backup 0
#$_TARGETNAME.0 configure -rtos auto
echo "Ready for Remote Connections"
$_TARGETNAME.0 configure -event reset-assert-pre {
echo "reset-assert-pre"
adapter speed 4000
}
$_TARGETNAME.0 configure -event reset-deassert-post {
echo "reset-deassert-post"
adapter speed 4000
reg mstatus 0x7800
reg mie 0x0
# reg pc 0x22008000
}
$_TARGETNAME.0 configure -event reset-init {
echo "reset-init"
# 4MHz for FPGA
adapter speed 4000
}
gdb_memory_map enable
gdb_flash_program disable
riscv set_prefer_sba off
riscv set_command_timeout_sec 1
init
#reset init
#jtag arp_init
#resume
#exit