8 Commits

Author SHA1 Message Date
f4ac7db357 [修改] Keil工程支持MDK5
[详细说明]
    1. 兼容MDK4、MDK5编译;
    2. NSPE 增加自定义内容
        2.1. 增加开关宏: CONFIG_GY3513;
        2.2. 增加EVAL板定义集;
2023-06-15 16:26:54 +00:00
6503e589b4 [修改] bat脚本与exe工具增加可执行权限 2023-06-15 16:13:40 +00:00
58a63c59fb [修改] 忽略Keil工程中间产物 2023-06-15 16:11:08 +00:00
ada62165a6 [修改] 更新Readme说明 2023-06-14 16:03:01 +00:00
853a9461a0 [修改] 增加CONFIG_GY3513定制内容
[详细说明]
    1. 增加LED任务;
    2. 修复LED3配置错误问题;
2023-06-14 16:01:34 +00:00
242a8865ae [修改] VSCode工程 clang插件相关配置 2023-06-14 16:00:40 +00:00
3ca2c491d5 [Mod] 修改目标单板 EVAL 2023-06-13 16:38:23 +00:00
a389b906af [修改] 支持clangd插件 2023-06-13 16:37:59 +00:00
19 changed files with 7255 additions and 6909 deletions

192
.clang-format Normal file
View File

@ -0,0 +1,192 @@
---
Language: Cpp
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: DontAlign
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: WebKit
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: BinPack
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

9
.gitignore vendored
View File

@ -1,6 +1,7 @@
_build_date.h
.cache/
.cmake/
output/
scripts/images/
@ -9,3 +10,11 @@ scripts/images/
## Keil Project
MBL/Project/KEIL/*.ini
*.uvgui*
MBL/Project/KEIL/RTE/
MBL/Project/KEIL/mbl_ns/
NSPE/Project/WIFI_IOT/KEIL/RTE/
NSPE/Project/WIFI_IOT/KEIL/wifi_iot/
# Clang
compile_commands.json

View File

@ -5,6 +5,7 @@ project(GD32W51X LANGUAGES C ASM)
set(CONFIG_TZ_ENABLED OFF CACHE BOOL "Whether to enable trustzone")
set(CONFIG_OS "FREERTOS" CACHE STRING "Select which OS")
set(CONFIG_STATIC_LIB_BUILDED ON CACHE BOOL "Whether static lib builded, like wlan, iperf3 lib")
set(CONFIG_GY3513 ON CACHE BOOL "Whether to allow gaoyang3513's modification or not.")
include(${CMAKE_TOOLCHAIN_FILE})
toolchain_reload_compiler()
@ -23,6 +24,14 @@ include_directories(
ROM-EXPORT/mbedtls-2.17.0-rom/include
)
if(CONFIG_GY3513)
add_definitions(-DCONFIG_GY3513)
include_directories(
NSPE/Utilities
)
endif(CONFIG_GY3513)
if (CONFIG_TZ_ENABLED)
add_subdirectory(MBL/source)
include_directories(MBL/source)
@ -31,5 +40,4 @@ else()
add_subdirectory(MBL/source_ns)
endif()
add_subdirectory(NSPE)

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>15</nTsel>
<nTsel>14</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@ -212,7 +212,7 @@
<Group>
<GroupName>bootloader</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@ -10,14 +10,14 @@
<TargetName>Target_GDM32</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6090000::V6.9::.\ARMCLANG</pCCUsed>
<pCCUsed>6190000::V6.19::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>GD32W515PIQ6</Device>
<Vendor>GigaDevice</Vendor>
<PackID>GigaDevice.GD32W51x_DFP.1.0.2</PackID>
<PackURL>http://gd32mcu.com/data/documents/pack/</PackURL>
<PackID>GigaDevice.GD32W51x_DFP.1.0.3</PackID>
<PackURL>https://gd32mcu.com/data/documents/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x70000) IRAM2(0x30000000,0x70000) IROM(0x08000000,0x0200000) IROM2(0x0C000000,0x0200000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
@ -184,6 +184,9 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>1</hadIROM2>
<StupSel>8</StupSel>
@ -350,7 +353,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>

10
MBL/Project/mbl_afterbuild.bat Normal file → Executable file
View File

@ -10,12 +10,22 @@ set ROOT=%OUTPUT_PATH%\..\..\..\..\..
set SREC_CAT=%ROOT%\scripts\imgtool\srec_cat.exe
set OUTPUT_IMAGE_PATH=%ROOT%\scripts\images
for /f "tokens=1,2 delims=\" %%a in ("%TOOLKIT_PATH%") do set driver=%%a &set version=%%b
if "%TOOLKIT%" == "KEIL" (
if "%version%" == "Keil_v5" (
:: Generate txt for debug
%TOOLKIT_PATH%\ARM\ARMCLANG\bin\fromelf.exe --text -c -d --output=%OUTPUT_PATH%\..\%OUTPUT_NAME%.txt %OUTPUT_PATH%\%OUTPUT_NAME%.axf
:: Generate binary image
%TOOLKIT_PATH%\ARM\ARMCLANG\bin\fromelf.exe --bin --8x1 --bincombined --output=%OUTPUT_PATH%\..\%OUTPUT_NAME%.bin %OUTPUT_PATH%\%OUTPUT_NAME%.axf
) else (
:: Generate txt for debug
%TOOLKIT_PATH%\ARM\ARMCC\bin\fromelf.exe --text -c -d --output=%OUTPUT_PATH%\..\%OUTPUT_NAME%.txt %OUTPUT_PATH%\%OUTPUT_NAME%.axf
:: Generate binary image
%TOOLKIT_PATH%\ARM\ARMCC\bin\fromelf.exe --bin --8x1 --bincombined --output=%OUTPUT_PATH%\..\%OUTPUT_NAME%.bin %OUTPUT_PATH%\%OUTPUT_NAME%.axf
)
)
if "%TOOLKIT%" == "IAR" (
:: Generate ASM file

View File

@ -1,15 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectWorkspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_mpw.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<WorkspaceName>WorkSpace</WorkspaceName>
<project>
<PathAndName>.\MBL\project\KEIL\Project_MBL_NS.uvprojx</PathAndName>
</project>
<project>
<PathAndName>.\NSPE\Project\WIFI_IOT\KEIL\Project_WIFI_IOT.uvprojx</PathAndName>
<NodeIsActive>1</NodeIsActive>
<NodeIsExpanded>1</NodeIsExpanded>
</project>
<project>
<PathAndName>.\NSPE\Project\WIFI_IOT\KEIL\Project_WIFI_IOT.uvprojx</PathAndName>
<NodeIsExpanded>1</NodeIsExpanded>
</project>
</ProjectWorkspace>

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>15</nTsel>
<nTsel>14</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@ -120,7 +120,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>CMSIS_AGDI_V8M</Key>
<Name>-X"Any" -UAny -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BE12477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC2000 -FN1 -FF0GD32W515_NS -FS08000000 -FL0200000 -FP0($$Device:GD32W515PIQ6$Flash\GD32W515_NS.FLM)</Name>
<Name>-X"Any" -UAny -O206 -S0 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(0BE12477) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC2000 -FN1 -FF0GD32W515_NS.FLM -FS08000000 -FL0200000 -FP0($$Device:GD32W515PIQ6$Flash\GD32W515_NS.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -2787,6 +2787,26 @@
</File>
</Group>
<Group>
<GroupName>Utilities</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>15</GroupNumber>
<FileNumber>195</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\Utilities\gd32w515p_eval.c</PathWithFileName>
<FilenameWithoutPath>gd32w515p_eval.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
<tvExp>0</tvExp>

View File

@ -10,14 +10,14 @@
<TargetName>Project_Freertos</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6090000::V6.9::.\ARMCLANG</pCCUsed>
<pCCUsed>6190000::V6.19::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>GD32W515PIQ6</Device>
<Vendor>GigaDevice</Vendor>
<PackID>GigaDevice.GD32W51x_DFP.1.0.2</PackID>
<PackURL>http://gd32mcu.com/data/documents/pack/</PackURL>
<PackID>GigaDevice.GD32W51x_DFP.1.0.3</PackID>
<PackURL>https://gd32mcu.com/data/documents/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x70000) IRAM2(0x30000000,0x70000) IROM(0x08000000,0x0200000) IROM2(0x0C000000,0x0200000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
@ -184,6 +184,9 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>1</hadIROM2>
<StupSel>8</StupSel>
@ -335,9 +338,9 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls>-fshort-wchar</MiscControls>
<Define>PLATFORM_OS_FREERTOS</Define>
<Define>PLATFORM_OS_FREERTOS CONFIG_GY3513</Define>
<Undefine></Undefine>
<IncludePath>..\..\..\Firmware\CMSIS\DSP_Lib_v1.6.0\include;..\..\..\Firmware\CMSIS\GD\GD32W51x\Include;..\..\..\Firmware\GD32W51x_standard_peripheral\Include;..\..\..\Firmware\GD32W51x_wifi_driver\inc;..\..\..\Firmware\GD32W51x_wifi_driver\osal;..\..\..\Firmware\GD32W51x_wifi_driver\cmn;..\..\..\Firmware\GD32W51x_wifi_driver\soc;..\..\..\WIFI_IOT\app;..\..\..\WIFI_IOT\bsp;..\..\..\WIFI_IOT\wifi;..\..\..\WIFI_IOT\os;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\Source\include;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\Source\portable\Keil\ARM_CM33_NTZ;..\..\..\WIFI_IOT\network\lwip-2.1.2\apps;..\..\..\WIFI_IOT\network\lwip-2.1.2\port;..\..\..\WIFI_IOT\network\lwip-2.1.2\src\include;..\..\..\WIFI_IOT\network\lwip-2.1.2\src\include\lwip;..\..\..\WIFI_IOT\network\lwip-2.1.2\port\arch;..\..\..\WIFI_IOT\network\mbedtls-2.17.0-ssl\include;..\..\..\WIFI_IOT\network\mbedtls-2.17.0-ssl\ns_interface;..\..\..\WIFI_IOT\network\iperf3;..\..\..\WIFI_IOT\cloud\alicloud;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\infra;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\dev_model;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\wrappers;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\wifi_provision;..\..\..\WIFI_IOT\FatFS;..\..\..\WIFI_IOT\FatFS\src;..\..\..\..\config;..\..\..\..\ROM-EXPORT\source;..\..\..\..\ROM-EXPORT\platform;..\..\..\..\ROM-EXPORT\mbedtls-2.17.0-rom\include;..\..\..\..\ROM-EXPORT\mbedtls-2.17.0-rom\include\mbedtls;..\..\..\..\MBL\platform;..\..\..\..\MBL\source;..\..\..\..\MBL\source_ns;..\..\..\..\PROT\trusted-firmware-m\interface\include;..\..\..\..\PROT\mbedtls_ns_callable;..\..\..\WIFI_IOT\demo;..\..\..\WIFI_IOT\common;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\CMSIS\RTOS2\FreeRTOS\Include;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\CMSIS\RTOS2\FreeRTOS\Source</IncludePath>
<IncludePath>..\..\..\Firmware\CMSIS\DSP_Lib_v1.6.0\include;..\..\..\Firmware\CMSIS\GD\GD32W51x\Include;..\..\..\Firmware\GD32W51x_standard_peripheral\Include;..\..\..\Firmware\GD32W51x_wifi_driver\inc;..\..\..\Firmware\GD32W51x_wifi_driver\osal;..\..\..\Firmware\GD32W51x_wifi_driver\cmn;..\..\..\Firmware\GD32W51x_wifi_driver\soc;..\..\..\WIFI_IOT\app;..\..\..\WIFI_IOT\bsp;..\..\..\WIFI_IOT\wifi;..\..\..\WIFI_IOT\os;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\Source\include;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\Source\portable\Keil\ARM_CM33_NTZ;..\..\..\WIFI_IOT\network\lwip-2.1.2\apps;..\..\..\WIFI_IOT\network\lwip-2.1.2\port;..\..\..\WIFI_IOT\network\lwip-2.1.2\src\include;..\..\..\WIFI_IOT\network\lwip-2.1.2\src\include\lwip;..\..\..\WIFI_IOT\network\lwip-2.1.2\port\arch;..\..\..\WIFI_IOT\network\mbedtls-2.17.0-ssl\include;..\..\..\WIFI_IOT\network\mbedtls-2.17.0-ssl\ns_interface;..\..\..\WIFI_IOT\network\iperf3;..\..\..\WIFI_IOT\cloud\alicloud;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\infra;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\dev_model;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\wrappers;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src;..\..\..\WIFI_IOT\cloud\alicloud\iotkit-embedded-3.2.0\lib_iot_sdk_src\eng\wifi_provision;..\..\..\WIFI_IOT\FatFS;..\..\..\WIFI_IOT\FatFS\src;..\..\..\..\config;..\..\..\..\ROM-EXPORT\source;..\..\..\..\ROM-EXPORT\platform;..\..\..\..\ROM-EXPORT\mbedtls-2.17.0-rom\include;..\..\..\..\ROM-EXPORT\mbedtls-2.17.0-rom\include\mbedtls;..\..\..\..\MBL\platform;..\..\..\..\MBL\source;..\..\..\..\MBL\source_ns;..\..\..\..\PROT\trusted-firmware-m\interface\include;..\..\..\..\PROT\mbedtls_ns_callable;..\..\..\WIFI_IOT\demo;..\..\..\WIFI_IOT\common;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\CMSIS\RTOS2\FreeRTOS\Include;..\..\..\WIFI_IOT\os\FreeRTOSv10.3.1\CMSIS\RTOS2\FreeRTOS\Source;..\..\..\Utilities</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -350,7 +353,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -508,7 +511,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls>--cpreproc</MiscControls>
<Define></Define>
@ -1392,7 +1395,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1525,6 +1528,16 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Utilities</GroupName>
<Files>
<File>
<FileName>gd32w515p_eval.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\Utilities\gd32w515p_eval.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>
@ -1540,7 +1553,7 @@
<TargetCommonOption>
<Device>ARMCM33_DSP_FP_TZ</Device>
<Vendor>ARM</Vendor>
<PackID>ARM.CMSIS.5.8.0</PackID>
<PackID>ARM.CMSIS.5.9.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x20200000,0x00020000) IROM(0x00000000,0x00200000) IROM2(0x00200000,0x00200000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ESEL ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -1708,6 +1721,9 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>1</hadIROM2>
<StupSel>8</StupSel>
@ -1874,7 +1890,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -2032,7 +2048,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls>--cpreproc</MiscControls>
<Define></Define>
@ -2317,7 +2333,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -3100,6 +3116,16 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Utilities</GroupName>
<Files>
<File>
<FileName>gd32w515p_eval.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\Utilities\gd32w515p_eval.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>
@ -3121,4 +3147,13 @@
<files/>
</RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>Project_WIFI_IOT</LayName>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project>

0
NSPE/Project/WIFI_IOT/build_date.bat Normal file → Executable file
View File

12
NSPE/Project/WIFI_IOT/nspe_afterbuild.bat Normal file → Executable file
View File

@ -15,12 +15,22 @@ set OUTPUT_FILE=nspe
IF EXIST %OUTPUT_PATH%\..\nspe* del %OUTPUT_PATH%\..\nspe*
for /f "tokens=1,2 delims=\" %%a in ("%TOOLKIT_PATH%") do set driver=%%a &set version=%%b
if "%TOOLKIT%" == "KEIL" (
if "%version%" == "Keil_v5" (
:: Generate txt for debug
%TOOLKIT_PATH%\ARM\ARMCLANG\bin\fromelf.exe --text -c -d --output=%OUTPUT_PATH%\..\%OUTPUT_FILE%.txt %OUTPUT_PATH%\%OUTPUT_FILE%.axf
:: Generate binary image
%TOOLKIT_PATH%\ARM\ARMCLANG\bin\fromelf.exe --bin --8x1 --bincombined --output=%OUTPUT_PATH%\..\%OUTPUT_FILE%.bin %OUTPUT_PATH%\%OUTPUT_FILE%.axf
) else (
:: Generate txt for debug
%TOOLKIT_PATH%\ARM\ARMCC\bin\fromelf.exe --text -c -d --output=%OUTPUT_PATH%\..\%OUTPUT_FILE%.txt %OUTPUT_PATH%\%OUTPUT_FILE%.axf
:: Generate binary image
%TOOLKIT_PATH%\ARM\ARMCC\bin\fromelf.exe --bin --8x1 --bincombined --output=%OUTPUT_PATH%\..\nspe.bin %OUTPUT_PATH%\%OUTPUT_FILE%.axf
%TOOLKIT_PATH%\ARM\ARMCC\bin\fromelf.exe --bin --8x1 --bincombined --output=%OUTPUT_PATH%\..\%OUTPUT_FILE%.bin %OUTPUT_PATH%\%OUTPUT_FILE%.axf
)
)
if "%TOOLKIT%" == "IAR" (
:: Generate ASM file

0
NSPE/Project/WIFI_IOT/wifi_version.bat Normal file → Executable file
View File

View File

@ -71,9 +71,9 @@ typedef enum
#define LED2_GPIO_PORT GPIOA
#define LED2_GPIO_CLK RCU_GPIOA
#define LED3_PIN GPIO_PIN_8
#define LED3_GPIO_PORT GPIOB
#define LED3_GPIO_CLK RCU_GPIOB
#define LED3_PIN GPIO_PIN_6
#define LED3_GPIO_PORT GPIOA
#define LED3_GPIO_CLK RCU_GPIOA
#define COMn 1U
#define EVAL_COM0 USART2

View File

@ -32,6 +32,13 @@ target_sources(app
../demo/cmsis_os_demo.c
)
if(CONFIG_GY3513)
target_sources(app
PRIVATE
../../Utilities/gd32w515p_eval.c
)
endif(CONFIG_GY3513)
target_link_libraries(app
gd32w51x_peripheral_api
gd32w51x_wifi_api

View File

@ -33,6 +33,7 @@ OF SUCH DAMAGE.
*/
/*============================ INCLUDES ======================================*/
#include "wrapper_freertos.h"
#include "wrapper_os.h"
#include "debug_print.h"
#include "bsp_inc.h"
@ -48,6 +49,10 @@ OF SUCH DAMAGE.
#ifdef CONFIG_FATFS_SUPPORT
#include "fatfs.h"
#endif
#if defined (CONFIG_GY3513)
#include <gd32w515p_eval.h>
#endif // CONFIG_GY3513
/*============================ MACROS ========================================*/
/*============================ MACRO FUNCTIONS ===============================*/
/*============================ TYPES =========================================*/
@ -74,6 +79,31 @@ void do_ram_code_copy(void)
}
#endif
#if defined (CONFIG_GY3513)
static int32_t led_init(void)
{
gd_eval_led_init(LED1);
gd_eval_led_init(LED2);
gd_eval_led_init(LED3);
return 0;
}
void led_task(void *p_arg)
{
while (1) {
gd_eval_led_toggle(LED1);
sys_ms_sleep(200);
gd_eval_led_toggle(LED2);
sys_ms_sleep(200);
gd_eval_led_toggle(LED3);
sys_ms_sleep(200);
}
sys_task_delete(NULL);
}
#endif // CONFIG_GY3513
/*!
\brief initialize application
\param[in] none
@ -121,7 +151,14 @@ void start_task(void *p_arg)
*/
int main(void)
{
#if defined (CONFIG_GY3513)
TaskHandle_t *stTaskHndl_led = NULL;
#endif // CONFIG_GY3513
platform_init();
#if defined (CONFIG_GY3513)
led_init();
#endif // CONFIG_GY3513
DEBUGPRINT("SDK git revision: "WIFI_GIT_REVISION" \r\n");
DEBUGPRINT("SDK version: V%d.%d.%d\r\n", (RE_NSPE_VERSION >> 24), ((RE_NSPE_VERSION & 0xFF0000) >> 16), (RE_NSPE_VERSION & 0xFFFF));
@ -129,8 +166,17 @@ int main(void)
sys_os_init();
if (NULL == sys_task_create(NULL, (const uint8_t *)"start_task", NULL, START_TASK_STK_SIZE, 0,
START_TASK_PRIO, start_task, NULL)) {
#if defined (CONFIG_GY3513)
#define LED_TASK_STK_SIZE 256
#define LED_TASK_PRIO (TASK_PRIO_APP_BASE + TASK_PRIO_HIGHER(1))
stTaskHndl_led = sys_task_create(NULL, (const uint8_t *)"led_task", NULL, LED_TASK_STK_SIZE, 0, LED_TASK_PRIO, led_task, NULL);
if (stTaskHndl_led == NULL) {
DEBUG_ERROR("Error, task create failed.\r\n");
}
#endif // CONFIG_GY3513
if (NULL == sys_task_create(NULL, (const uint8_t *)"start_task", NULL, START_TASK_STK_SIZE, 0, START_TASK_PRIO, start_task, NULL)) {
DEBUGPRINT("ERROR: create start task failed\r\n");
}

View File

@ -735,5 +735,6 @@ void platform_init(void)
gdm3210x_fpga_init();
#elif CONFIG_PLATFORM == PLATFORM_ASIC_32W51X
gd32w51x_asic_init();
#endif
}

View File

@ -1,6 +1,6 @@
# GD32W51x_WiFi_IOT
本仓库作为本人学习GD32 + RTOS + cmake知识使用开发环境为是在Linux。
本仓库作为本人学习GD32 + RTOS + Cmake相关知识使用开发环境为Linux(Ubuntu 22.04)
## 说明

View File

@ -51,7 +51,7 @@ OF SUCH DAMAGE.
#define PLATFORM_BOARD_32W515T_START 0
#define PLATFORM_BOARD_32W515P_EVAL 1
#ifdef CONFIG_PLATFORM_ASIC
#define CONFIG_BOARD PLATFORM_BOARD_32W515T_START
#define CONFIG_BOARD PLATFORM_BOARD_32W515P_EVAL
#endif
#define XIP_FLASH_SIP 0

0
scripts/imgtool/srec_cat.exe Normal file → Executable file
View File