Hey guys.
I wanted to play with fresh .NET Micro Framework 4.4 (vNext) but compiling it wasn’t quite straightforward task. So I decided to make this quick guide to share the knowledge.
The SDK/Vsix/PK and MCBSTM32F400 solution builds without errors, but I don’t have MCBSTM32F400 board and don’t know if it is actually run on real hardware.
Testing, updates and suggestions are very welcome.
[title]Building .NET Micro Framework v4.4 (vNext) SDK and Porting Kit with SMT32F4 support using Visual Studio 2013[/title]
Tested with ChangeSet 43297 from Feb 4 12:57 AM
[title]Test SDK/Vsix building[/title]
1. Download zipped sources from [url=https://netmf.codeplex.com/SourceControl/latest]https://netmf.codeplex.com/SourceControl/latest[/url]
2. Create netmf folder in the root folder (eg. c:) and extract those entries into it:
[quote]
bin
BuildProcessTemplates
client_vNext
TeamProjectConfig
test
tools[/quote]
3. Download Visual Studio 2012/2013 SDK assemblies (see Downloads) and extract v11 and v12 folders to c:\netmf\tools\x86\MicrosoftSDKs\VsSDK folder
4. Download PK4.3 Crypto libs and extract them to c:\netmf\client_vNext\crypto\lib folder
5. Copy c:\netmf\client_vNext\BuildEnv.props to the root folder (c:\BuildEnv.props)
6. Create c:\builds folder in the root folder (eg. c:)
7. Go to client_vNext folder and start building SDK (replace DEV43297 with actual ChangeSet number):
Open new command prompt
[quote]
cd /D c:\netmf\client_vNext
build_sdk.cmd 0 c:\builds client_vNext “(DEV43297)”[/quote]
8. After build is finished, check sdkpre.log, sdk.log and vsixpkg.log logs in [b]c:\netmf\client_vNext[/b] - they should end with “0 Error(s)”
[title]Including SMT32F4/MCBSTM32F400 into Porting Kit[/title]
9. If you use different Keil version (eg. 5.13) add new section to c:\netmf\client_vNext\tools\Targets\Microsoft.Spot.system.mdk.targets right after “MDK5.05” section:
[quote]
“$(MDK_TOOL_PATH)\ARMCC\bin\armcc.exe”
“$(MDK_TOOL_PATH)\ARMCC\bin\armcc.exe”
“$(MDK_TOOL_PATH)\ARMCC\bin\armasm.exe”
10. Fix lib and include paths for Keil 5.xx in file c:\netmf\client_vNext\setenv_base.cmd replace
[quote]
SET RVCT31LIB=%MDK_TOOL_PATH%\RV31\LIB
SET RVCT31INC=%MDK_TOOL_PATH%\RV31\INC[/quote]with
[quote]
IF “%MDK_EXT%”==“5” (
SET RVCT31LIB=%MDK_TOOL_PATH%\ARMCC\lib
SET RVCT31INC=%MDK_TOOL_PATH%\ARMCC\include
) ELSE (
SET RVCT31LIB=%MDK_TOOL_PATH%\RV31\LIB
SET RVCT31INC=%MDK_TOOL_PATH%\RV31\INC
}[/quote]
11. Copy CMSIS files from Keil_v5:
[quote]
c:\Keil_v5\ARM\Pack\ARM\CMSIS\4.2.0\CMSIS\Include to c:\netmf\client_vNext\DeviceCode\Cores\arm\CMSIS\Include
c:\Keil_v5\ARM\Pack\ARM\CMSIS\4.2.0\CMSIS\Driver\Include to c:\netmf\client_vNext\DeviceCode\Cores\arm\CMSIS\Driver\Include
c:\Keil_v5\ARM\Pack\ARM\CMSIS\4.2.0\CMSIS_RTX\INC to c:\netmf\client_vNext\DeviceCode\Cores\arm\CMSIS_RTX\INC
c:\Keil_v5\ARM\Pack\ARM\CMSIS\4.2.0\CMSIS_RTX\SRC to c:\netmf\client_vNext\DeviceCode\Cores\arm\CMSIS_RTX\SRC[/quote]
12. In file c:\netmf\client_vNext\DeviceCode\Targets\OS\CMSIS_RTOS\DeviceCode\lwip_1_4_1_os\arch\sys_arch.cpp
change line #include to #include “mutex”
13. In file c:\netmf\client_vNext\tools\scripts\port\SourceCopyList.txt add lines:
[quote]
+, %SPOCLIENT%\DeviceCode\Cores\arm\CMSIS.…
+, %SPOCLIENT%\DeviceCode\Cores\arm\CMSIS_RTX.…
+, %SPOCLIENT%\DeviceCode\Targets\OS\CMSIS_RTOS.…
+, %SPOCLIENT%\DeviceCode\Targets\Native\STM32F4.…
+, %SPOCLIENT%\Solutions\MCBSTM32F400.…[/quote]
[title]Building final clean SDK/Vsix/PortingKit[/title]
14. Delete contents of c:\builds folder and c:\netmf\client_vNext*.log files
15. In file c:\netmf\client_vNext\build_sdk_and_port.cmd:
[quote]
replace line SET PRODVER_MINOR=3 with SET PRODVER_MINOR=4
replace line call setenv_vs.cmd 11 with call setenv_vs.cmd 12
remove all /p:SignBuild=true
replace all %VSSDK110Install% with %VSSDK120Install%[/quote]
16. Go to client_vNext folder and start building SDK (replace DEV43297 with actual ChangeSet number):
Open new command prompt
[quote]
cd /D c:\netmf\client_vNext
build_sdk_and_port.cmd 0 c:\builds client_vNext “(DEV43297)”[/quote]
17. After build is completed, check logs for errors.
Ignore errors in PK-NET-ARM/PK-NET-THUMB/PK-NET-THUMB2/PK-NET-SH2 steps (req. RVDS3.1/HEW9.2 compiler?)
[title]Testing[/title]
18. Install SDK/Vsix/PortingKit:
19. Build MCBSTM32F400 sample solution
Open new command prompt (required!)
[quote]
cd /D c:\MicroFrameworkPK_v4_4
setenv_vs.cmd 12
setenv_mdk.cmd 5.13 c:\Keil_v5\ARM
cd c:\MicroFrameworkPK_v4_4\Solutions\MCBSTM32F400
msbuild /t:rebuild /p:flavor=release;memory=flash >msbuild.log[/quote]
20. After build is finished check c:\MicroFrameworkPK_v4_4\Solutions\MCBSTM32F400\msbuild.log for errors
Output files (Tinybooter.hex and tinyclr.hex) should be in c:\MicroFrameworkPK_v4_4\BuildOutput\THUMB2FP\MDK5.13\le\FLASH\release\MCBSTM32F400\bin folder
21. Open Visual Studio and create new .NET Micro Framework app and rebuild it
File → New → Project → Templates → Visual C# → Micro Framework → Console Application → OK
Build → Rebuild Solution
[title]Downloads[/title]
- Visual Studio 2012/2013 SDK Assemblies: VsSDK.v11.v12.zip
- Porting Kit 4.3 (RTM QFE1) Crypto lib: PK4.3 Crypto lib.zip
- Micro Framework v4.4 (DEV43297) SDK: MicroFrameworkSDK.MSI
- Micro Framework v4.4 (DEV43297) Visual Studio 2013 Addin: netmfvs2013.vsix
- Micro Framework v4.4 (DEV43297) Porting Kit: MicroFrameworkPK.zip
- Micro Framework v4.4 (DEV43297) Porting Kit Crypto Pack: MicroFrameworkPK (Crypto Pack).zip