Skip to content

Commit f4e4188

Browse files
authored
[xuantie/bsp] 修正生成玄铁CDK工程脚本并适配E906 BSP #10616
1 parent 7448763 commit f4e4188

File tree

5 files changed

+287
-2
lines changed

5 files changed

+287
-2
lines changed

bsp/xuantie/smartl/e906/board/SConscript

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,20 @@ src = ['board.c']
1111

1212
path = [cwd]
1313

14-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
14+
# CPPDEFINES = ['CONFIG_KERNEL_RTTHREAD=1', 'RT_USING_LIBC']
15+
CPPDEFINES = [
16+
'CONFIG_KERNEL_RTTHREAD=1'
17+
,'__RT_KERNEL_SOURCE__=1'
18+
,'CONFIG_CSI_V2=1 '
19+
,'CONFIG_CSI="csi2" '
20+
,'CONFIG_SUPPORT_TSPEND=0 '
21+
,'CONFIG_SUPPORT_IRQ_NESTED=0 '
22+
,'CONFIG_XIP=1 '
23+
,'CONFIG_ARCH_MAINSTACK=4096 '
24+
,'CONFIG_ARCH_INTERRUPTSTACK=4096 '
25+
,'CONFIG_BOARD_SMARTL_EVB=1 '
26+
,'CLI_CONFIG_STACK_SIZE=4096 '
27+
,'CONFIG_CPU_XUANTIE_E906FD=1 '
28+
]
29+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
1530
Return('group')
Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Project Name="xuantie_rtthread" Version="1" Language="C">
3+
<Description/>
4+
<Dependencies Name="Debug"/>
5+
<VendorInfo>
6+
<VendorName>new_psf_project_SmartL_E906FD-R2S2(V1.7.9)</VendorName>
7+
</VendorInfo>
8+
<ToolsConfig>
9+
<Compiler>
10+
<Name>XTGccElfNewlib</Name>
11+
<Version>latest</Version>
12+
</Compiler>
13+
</ToolsConfig>
14+
<DebugSessions>
15+
<watchExpressions/>
16+
<memoryExpressions>;;;</memoryExpressions>
17+
<statistics>;;MHZ</statistics>
18+
<peripheralTabs/>
19+
<WatchDisplayFormat/>
20+
<LocalDisplayFormat/>
21+
<debugLayout/>
22+
<memoryTabColSizeExpressions/>
23+
<QuickWatchDisplayFormat/>
24+
</DebugSessions>
25+
<BuildConfigs>
26+
<BuildConfig Name="BuildSet">
27+
<Target>
28+
<ROMBank Selected="1">
29+
<ROM1>
30+
<InUse>no</InUse>
31+
<Start/>
32+
<Size/>
33+
</ROM1>
34+
<ROM2>
35+
<InUse>no</InUse>
36+
<Start/>
37+
<Size/>
38+
</ROM2>
39+
<ROM3>
40+
<InUse>no</InUse>
41+
<Start/>
42+
<Size/>
43+
</ROM3>
44+
<ROM4>
45+
<InUse>no</InUse>
46+
<Start/>
47+
<Size/>
48+
</ROM4>
49+
<ROM5>
50+
<InUse>no</InUse>
51+
<Start/>
52+
<Size/>
53+
</ROM5>
54+
</ROMBank>
55+
<RAMBank>
56+
<RAM1>
57+
<InUse>no</InUse>
58+
<Start/>
59+
<Size/>
60+
<Init>yes</Init>
61+
</RAM1>
62+
<RAM2>
63+
<InUse>no</InUse>
64+
<Start/>
65+
<Size/>
66+
<Init>yes</Init>
67+
</RAM2>
68+
<RAM3>
69+
<InUse>no</InUse>
70+
<Start/>
71+
<Size/>
72+
<Init>yes</Init>
73+
</RAM3>
74+
<RAM4>
75+
<InUse>no</InUse>
76+
<Start/>
77+
<Size/>
78+
<Init>yes</Init>
79+
</RAM4>
80+
<RAM5>
81+
<InUse>no</InUse>
82+
<Start/>
83+
<Size/>
84+
<Init>yes</Init>
85+
</RAM5>
86+
</RAMBank>
87+
<CPU>e906fd</CPU>
88+
<UseMiniLib>yes</UseMiniLib>
89+
<Endian>little</Endian>
90+
<UseHardFloat>no</UseHardFloat>
91+
<UseEnhancedLRW>no</UseEnhancedLRW>
92+
<UseContinueBuild>no</UseContinueBuild>
93+
<ToolchainID/>
94+
<ToolchainVersion/>
95+
<UseSemiHost>no</UseSemiHost>
96+
</Target>
97+
<Output>
98+
<OutputName>$(ProjectName)</OutputName>
99+
<Type>Executable</Type>
100+
<CreateHexFile>no</CreateHexFile>
101+
<CreateBinFile>no</CreateBinFile>
102+
<Preprocessor>no</Preprocessor>
103+
<Disassmeble>yes</Disassmeble>
104+
<CallGraph>no</CallGraph>
105+
<Map>no</Map>
106+
</Output>
107+
<User>
108+
<BeforeCompile>
109+
<RunUserProg>no</RunUserProg>
110+
<UserProgName/>
111+
<IsBatchScript>no</IsBatchScript>
112+
</BeforeCompile>
113+
<BeforeMake>
114+
<RunUserProg>no</RunUserProg>
115+
<UserProgName/>
116+
<IsBatchScript>no</IsBatchScript>
117+
</BeforeMake>
118+
<AfterMake>
119+
<RunUserProg>no</RunUserProg>
120+
<UserProgName/>
121+
<IsBatchScript>no</IsBatchScript>
122+
</AfterMake>
123+
<Tools/>
124+
</User>
125+
<Compiler>
126+
<Define/>
127+
<Undefine/>
128+
<Optim>Optimize size (-Os)</Optim>
129+
<DebugLevel>Maximum (-g3)</DebugLevel>
130+
<IncludePath>$(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</IncludePath>
131+
<OtherFlags>-ffunction-sections -fdata-sections</OtherFlags>
132+
<Verbose>no</Verbose>
133+
<Ansi>no</Ansi>
134+
<Syntax>no</Syntax>
135+
<Pedantic>no</Pedantic>
136+
<PedanticErr>no</PedanticErr>
137+
<InhibitWarn>no</InhibitWarn>
138+
<AllWarn>yes</AllWarn>
139+
<WarnErr>no</WarnErr>
140+
<OneElfS>yes</OneElfS>
141+
<OneElfSPerData>no</OneElfSPerData>
142+
<Fstrict>no</Fstrict>
143+
</Compiler>
144+
<Asm>
145+
<Define/>
146+
<Undefine/>
147+
<IncludePath/>
148+
<OtherFlags>-D"Default_IRQHandler=SW_handler"</OtherFlags>
149+
<DebugLevel>gdwarf2</DebugLevel>
150+
</Asm>
151+
<Linker>
152+
<Garbage>yes</Garbage>
153+
<Garbage2>yes</Garbage2>
154+
<LDFile>$(ProjectPath)/../../libraries/xuantie_libraries/chip_riscv_dummy/gcc_flash_smartl.ld</LDFile>
155+
<LibName>m</LibName>
156+
<LibPath/>
157+
<OtherFlags>-Wl,-zmax-page-size=1024</OtherFlags>
158+
<AutoLDFile>no</AutoLDFile>
159+
<LinkType/>
160+
<IncludeAllLibs>no</IncludeAllLibs>
161+
<LinkSpecsType>none</LinkSpecsType>
162+
<LinkUseNewlibNano>no</LinkUseNewlibNano>
163+
<LinkUseMinilibc>no</LinkUseMinilibc>
164+
</Linker>
165+
<Debug>
166+
<LoadApplicationAtStartup>yes</LoadApplicationAtStartup>
167+
<Connector>SIM</Connector>
168+
<StopAt>yes</StopAt>
169+
<StopAtText>main</StopAtText>
170+
<InitFile>$(ProjectPath)/utilities/gdb.init</InitFile>
171+
<PreInit/>
172+
<AfterLoadFile/>
173+
<AutoRun>yes</AutoRun>
174+
<ResetType>Hard Reset</ResetType>
175+
<SoftResetVal>0</SoftResetVal>
176+
<ResetAfterLoad>no</ResetAfterLoad>
177+
<AfterResetFile/>
178+
<Dumpcore>no</Dumpcore>
179+
<DumpcoreText/>
180+
<SVCFile/>
181+
<ConfigICE>
182+
<IP>localhost</IP>
183+
<PORT>1025</PORT>
184+
<CPUNumber>0</CPUNumber>
185+
<Clock>12000</Clock>
186+
<Delay>10</Delay>
187+
<NResetDelay>100</NResetDelay>
188+
<WaitReset>50</WaitReset>
189+
<DDC>yes</DDC>
190+
<TRST>no</TRST>
191+
<PreReset>no</PreReset>
192+
<DebugPrint>no</DebugPrint>
193+
<Connect>Normal</Connect>
194+
<ResetType>soft</ResetType>
195+
<SoftResetVal>0</SoftResetVal>
196+
<RTOSType>None</RTOSType>
197+
<DownloadToFlash>no</DownloadToFlash>
198+
<ResetAfterConnect>yes</ResetAfterConnect>
199+
<GDBName/>
200+
<GDBServerType>Local</GDBServerType>
201+
<OtherFlags/>
202+
<ICEEnablePCSampling>no</ICEEnablePCSampling>
203+
<ICESamplingFreq>1000</ICESamplingFreq>
204+
<RemoteICEEnablePCSampling>no</RemoteICEEnablePCSampling>
205+
<RemoteICESamplingPort>1026</RemoteICESamplingPort>
206+
<Version>latest</Version>
207+
<SupportRemoteICEAsyncDebug>no</SupportRemoteICEAsyncDebug>
208+
</ConfigICE>
209+
<ConfigSIM>
210+
<SIMTarget>soccfg/riscv32/smartl_e906_cfg.xml</SIMTarget>
211+
<OtherFlags/>
212+
<NoGraphic>yes</NoGraphic>
213+
<Log>no</Log>
214+
<SimTrace>no</SimTrace>
215+
<Version>latest</Version>
216+
</ConfigSIM>
217+
<ConfigOpenOCD>
218+
<OpenOCDExecutablePath/>
219+
<OpenOCDLocally>yes</OpenOCDLocally>
220+
<OpenOCDTelnetPortEnable>no</OpenOCDTelnetPortEnable>
221+
<OpenOCDTelnetPort>4444</OpenOCDTelnetPort>
222+
<OpenOCDTclPortEnable>no</OpenOCDTclPortEnable>
223+
<OpenOCDTclPort>6666</OpenOCDTclPort>
224+
<OpenOCDConfigOptions/>
225+
<OpenOCDTimeout>5000</OpenOCDTimeout>
226+
<OpenOCDRemoteIP>localhost</OpenOCDRemoteIP>
227+
<OpenOCDRemotePort>3333</OpenOCDRemotePort>
228+
<PluginID>openocd-sifive</PluginID>
229+
<Version>latest</Version>
230+
</ConfigOpenOCD>
231+
</Debug>
232+
<Flash>
233+
<InitFile>$(ProjectPath)/../../../../../utilities//flash.init</InitFile>
234+
<PreInit/>
235+
<Erase>Erase Sectors</Erase>
236+
<Algorithms Path=""/>
237+
<Program>yes</Program>
238+
<Verify>no</Verify>
239+
<ResetAndRun>no</ResetAndRun>
240+
<ResetType/>
241+
<SoftResetVal/>
242+
<FlashIndex>no</FlashIndex>
243+
<FlashIndexVal>0</FlashIndexVal>
244+
<External>no</External>
245+
<Command/>
246+
<Arguments/>
247+
</Flash>
248+
</BuildConfig>
249+
</BuildConfigs>
250+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CDK_Workspace Name="template" Database="LanguageSever" DoubleClick="Yes">
3+
<DefaultPackPath>$(CDKWS)\__workspace_pack__</DefaultPackPath>
4+
<Project Name="xuantie_rtthread" Path="template.cdkproj" RootPath="" Active="Yes"/>
5+
<BuildMatrix>
6+
<WorkspaceConfiguration Name="Debug" Selected="yes">
7+
<Environment/>
8+
<Project Name="xuantie_rtthread" ConfigName="BuildSet"/>
9+
</WorkspaceConfiguration>
10+
</BuildMatrix>
11+
</CDK_Workspace>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set *(int *)0x0=0x6f
2+
si
3+
reset
4+
set *(int *)0x40011008=0x0
5+
set *(int *)0x4001101c=0x0
6+

tools/targets/cdk.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ def _CDKProject(tree, target, script):
114114

115115
Define = tree.find('BuildConfigs/BuildConfig/Compiler/Define')
116116
Define.text = '; '.join(set(CPPDEFINES))
117+
118+
Define = tree.find('BuildConfigs/BuildConfig/Asm/Define')
119+
Define.text = '; '.join(set(CPPDEFINES))
117120

118121
CC_Misc = tree.find('BuildConfigs/BuildConfig/Compiler/OtherFlags')
119122
CC_Misc.text = CCFLAGS
@@ -128,7 +131,7 @@ def _CDKProject(tree, target, script):
128131
LibName.text=';'.join(LIBS)
129132

130133
xml_indent(root)
131-
out.write(etree.tostring(root, encoding='utf-8'))
134+
out.write(etree.tostring(root, encoding='utf-8').decode('utf-8'))
132135
out.close()
133136

134137
def CDKProject(target, script):

0 commit comments

Comments
 (0)