From fe3d455876b11469809e4a2ba214bf829524041d Mon Sep 17 00:00:00 2001 From: Yaochenger <1516081466@qq.com> Date: Mon, 18 Aug 2025 18:51:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[xuantie/bsp]=20=E4=BF=AE=E6=AD=A3=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=8E=84=E9=93=81CDK=E5=B7=A5=E7=A8=8B=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=B9=B6=E9=80=82=E9=85=8DE906=20BSP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/xuantie/smartl/e906/board/SConscript | 17 +- bsp/xuantie/smartl/e906/template.cdkproj | 250 +++++++++++++++++++++ bsp/xuantie/smartl/e906/template.cdkws | 11 + bsp/xuantie/smartl/e906/utilities/gdb.init | 6 + tools/targets/cdk.py | 5 +- 5 files changed, 287 insertions(+), 2 deletions(-) create mode 100644 bsp/xuantie/smartl/e906/template.cdkproj create mode 100644 bsp/xuantie/smartl/e906/template.cdkws create mode 100644 bsp/xuantie/smartl/e906/utilities/gdb.init diff --git a/bsp/xuantie/smartl/e906/board/SConscript b/bsp/xuantie/smartl/e906/board/SConscript index d9603bd08e2..159ef0c5215 100644 --- a/bsp/xuantie/smartl/e906/board/SConscript +++ b/bsp/xuantie/smartl/e906/board/SConscript @@ -11,5 +11,20 @@ src = ['board.c'] path = [cwd] -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) +# CPPDEFINES = ['CONFIG_KERNEL_RTTHREAD=1', 'RT_USING_LIBC'] +CPPDEFINES = [ + 'CONFIG_KERNEL_RTTHREAD=1 ' + ,'__RT_KERNEL_SOURCE__=1 ' + ,'CONFIG_CSI_V2=1 ' + ,'CONFIG_CSI="csi2" ' + ,'CONFIG_SUPPORT_TSPEND=0 ' + ,'CONFIG_SUPPORT_IRQ_NESTED=0 ' + ,'CONFIG_XIP=1 ' + ,'CONFIG_ARCH_MAINSTACK=4096 ' + ,'CONFIG_ARCH_INTERRUPTSTACK=4096 ' + ,'CONFIG_BOARD_SMARTL_EVB=1 ' + ,'CLI_CONFIG_STACK_SIZE=4096 ' + ,'CONFIG_CPU_XUANTIE_E906FD=1 ' +] +group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) Return('group') diff --git a/bsp/xuantie/smartl/e906/template.cdkproj b/bsp/xuantie/smartl/e906/template.cdkproj new file mode 100644 index 00000000000..b03a7efe44f --- /dev/null +++ b/bsp/xuantie/smartl/e906/template.cdkproj @@ -0,0 +1,250 @@ + + + + + + new_psf_project_SmartL_E906FD-R2S2(V1.7.9) + + + + XTGccElfNewlib + latest + + + + + ;;; + ;;MHZ + + + + + + + + + + + + + no + + + + + no + + + + + no + + + + + no + + + + + no + + + + + + + no + + + yes + + + no + + + yes + + + no + + + yes + + + no + + + yes + + + no + + + yes + + + e906fd + yes + little + no + no + no + + + no + + + $(ProjectName) + Executable + no + no + no + yes + no + no + + + + no + + no + + + no + + no + + + no + + no + + + + + + + Optimize size (-Os) + Maximum (-g3) + $(ProjectPath);$(ProjectPath)/../../../../../csi_core/include;$(ProjectPath)/../../../../../csi_driver/include;$(ProjectPath)/../../../../../libs/include;$(ProjectPath)/../../../../../csi_driver/smartl_rv32/include;$(ProjectPath)/../../../../../csi_kernel/include;$(ProjectPath)/../../../../../csi_kernel/freertosv10.3.1/include/;$(ProjectPath)/../../../../../csi_kernel/freertosv10.3.1/FreeRTOS/Source/include;$(ProjectPath)/../../../../../csi_kernel/freertosv10.3.1/FreeRTOS/Source/portable/GCC/riscv;$(ProjectPath)/../../../../../csi_kernel/freertosv10.3.1/FreeRTOS/Source/portable/GCC/riscv/chip_specific_extensions/thead_rv32;$(ProjectPath)/../../../../../board/smartl_e906_evb/include;$(ProjectPath)/../../../../../projects/tests/dtest/include;$(ProjectPath)/../../../../../projects/tests/kernel/include;;;;;;;$(ProjectPath)/../../../../../projects/tests/kernel/freertos/configs + -ffunction-sections -fdata-sections + no + no + no + no + no + no + yes + no + yes + no + no + + + + + + -D"Default_IRQHandler=SW_handler" + gdwarf2 + + + yes + yes + $(ProjectPath)/../../libraries/xuantie_libraries/chip_riscv_dummy/gcc_flash_smartl.ld + m + + -Wl,-zmax-page-size=1024 + no + + no + none + no + no + + + yes + SIM + yes + main + $(ProjectPath)/utilities/gdb.init + + + yes + Hard Reset + 0 + no + + no + + + + localhost + 1025 + 0 + 12000 + 10 + 100 + 50 + yes + no + no + no + Normal + soft + 0 + None + no + yes + + Local + + no + 1000 + no + 1026 + latest + no + + + soccfg/riscv32/smartl_e906_cfg.xml + + yes + no + no + latest + + + + yes + no + 4444 + no + 6666 + + 5000 + localhost + 3333 + openocd-sifive + latest + + + + $(ProjectPath)/../../../../../utilities//flash.init + + Erase Sectors + + yes + no + no + + + no + 0 + no + + + + + + diff --git a/bsp/xuantie/smartl/e906/template.cdkws b/bsp/xuantie/smartl/e906/template.cdkws new file mode 100644 index 00000000000..a1c3cd0a730 --- /dev/null +++ b/bsp/xuantie/smartl/e906/template.cdkws @@ -0,0 +1,11 @@ + + + $(CDKWS)\__workspace_pack__ + + + + + + + + diff --git a/bsp/xuantie/smartl/e906/utilities/gdb.init b/bsp/xuantie/smartl/e906/utilities/gdb.init new file mode 100644 index 00000000000..7792c77445e --- /dev/null +++ b/bsp/xuantie/smartl/e906/utilities/gdb.init @@ -0,0 +1,6 @@ +set *(int *)0x0=0x6f +si +reset +set *(int *)0x40011008=0x0 +set *(int *)0x4001101c=0x0 + diff --git a/tools/targets/cdk.py b/tools/targets/cdk.py index 8a473f72914..73fb06559ca 100644 --- a/tools/targets/cdk.py +++ b/tools/targets/cdk.py @@ -114,6 +114,9 @@ def _CDKProject(tree, target, script): Define = tree.find('BuildConfigs/BuildConfig/Compiler/Define') Define.text = '; '.join(set(CPPDEFINES)) + + Define = tree.find('BuildConfigs/BuildConfig/Asm/Define') + Define.text = '; '.join(set(CPPDEFINES)) CC_Misc = tree.find('BuildConfigs/BuildConfig/Compiler/OtherFlags') CC_Misc.text = CCFLAGS @@ -128,7 +131,7 @@ def _CDKProject(tree, target, script): LibName.text=';'.join(LIBS) xml_indent(root) - out.write(etree.tostring(root, encoding='utf-8')) + out.write(etree.tostring(root, encoding='utf-8').decode('utf-8')) out.close() def CDKProject(target, script): From c81b7254854a7c89706868838f0c9a52ade70214 Mon Sep 17 00:00:00 2001 From: Yaochenger <75192526+Yaochenger@users.noreply.github.com> Date: Tue, 19 Aug 2025 09:25:28 +0800 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- bsp/xuantie/smartl/e906/board/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/xuantie/smartl/e906/board/SConscript b/bsp/xuantie/smartl/e906/board/SConscript index 159ef0c5215..41f593ec6d4 100644 --- a/bsp/xuantie/smartl/e906/board/SConscript +++ b/bsp/xuantie/smartl/e906/board/SConscript @@ -13,7 +13,7 @@ path = [cwd] # CPPDEFINES = ['CONFIG_KERNEL_RTTHREAD=1', 'RT_USING_LIBC'] CPPDEFINES = [ - 'CONFIG_KERNEL_RTTHREAD=1 ' + 'CONFIG_KERNEL_RTTHREAD=1' ,'__RT_KERNEL_SOURCE__=1 ' ,'CONFIG_CSI_V2=1 ' ,'CONFIG_CSI="csi2" ' From 9099d7db1de2a7b93da2ed6fa2542e3e08137f37 Mon Sep 17 00:00:00 2001 From: Yaochenger <75192526+Yaochenger@users.noreply.github.com> Date: Tue, 19 Aug 2025 09:29:31 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- bsp/xuantie/smartl/e906/board/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/xuantie/smartl/e906/board/SConscript b/bsp/xuantie/smartl/e906/board/SConscript index 41f593ec6d4..7e7b944703d 100644 --- a/bsp/xuantie/smartl/e906/board/SConscript +++ b/bsp/xuantie/smartl/e906/board/SConscript @@ -14,7 +14,7 @@ path = [cwd] # CPPDEFINES = ['CONFIG_KERNEL_RTTHREAD=1', 'RT_USING_LIBC'] CPPDEFINES = [ 'CONFIG_KERNEL_RTTHREAD=1' - ,'__RT_KERNEL_SOURCE__=1 ' + ,'__RT_KERNEL_SOURCE__=1' ,'CONFIG_CSI_V2=1 ' ,'CONFIG_CSI="csi2" ' ,'CONFIG_SUPPORT_TSPEND=0 '