The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Compiling Custom Netduino Firmware: Step-By-Step Instructions - Help
I'm trying to compile some modified firmware and thought I'd try to document is as best I can during the process. I seem to be having some hickups along the way and somewhat stuck at this point on the compile step with MSbuild. I've read a few tutorials and write-ups and they all seem to have some holes or assumptions that the people reading them have done it before.
I've been getting quite a few errors and started googling each one and got to where I am now. I'm jumping all over the place and thought I'd come back here.
I'm going to precisely detail my steps that I've done to get where I currently am.
Assumptions: Using Netduino 4.3 firmware/framework, and 4.3 SDK and VS2012 Express. Everything is installed and working correctly. OS: Windows 7 x64. Device: Netduino 2 (not a plus, but I think there are very few differences at the command line to get the plus compiled and we could cover that here)
Follow Instructions/Prompts for installing the porting kit
A folder: "C:\MicroFrameworkPK_v4_3" should now exist
Extract the Netduino firmware zip anywhere. Copy the folder c:\[your extract location]\\netduinofirmware_source_4.3.1.0\MicroFrameworkPK_v4_3 <-This folder.
Switch back to C:\ and Paste.You will get some prompts; overwrite everything.
Install 20110429 Yagarto. Use Installation directory "C:\Yagarto46"
Everything is installed and in the correct locations (as far as I know and what previous tutorials say)
(Make your firmware modifications at this step) for this example and minimizing errors, I will skip this step)
Goto Start->All Programs->Microsoft Visual Studio 2012-> Visual Studio Tools -> Developer Command Prompt for VS2012
Setup the compiler environment (version A)
?type in the command prompt: cd C:\MicroFrameworkPK_v4_3
press enter
type in the command prompt: setenv.cmd 4.6 C:\Yagarto46
press enter.
ALTERNATIVE: Setup the compiler environment (version
?type in the command prompt: cd C:\MicroFrameworkPK_v4_3
press enter
type in the command prompt: setenv_base.cmd GCC 4.6 PORT C:\Yagarto46
press enter.
?A and B WARNINGS: Could not find vsvars32.bat & VISUAL C++ DOES NOT APPEAR TO BE INSTALLED ON THIS MACHINE (google didn't help me so much, I didn't install VS C++ express after this either. I continued onward)
?Attempt toCOMPILE
For Netduino 2(I have this device):
type into the command prompt: msbuild C:\MicroFrameworkPK_v4_3\Solutions\Netduino2\dotnetmf.proj /t:rebuild /p:flavor=release /filelogger
press enter
For Netduino 2 Plus(I don't have this device)
type into the command prompt: msbuild C:\MicroFrameworkPK_v4_3\Solutions\NetduinoPlus2\dotnetmf.proj /t:rebuild /p:flavor=release;tcp_ip_stack=lwip /filelogger
press enter
ERROR: MSbuild is not recognized as an internal or external command, operable program or batch file.
Google step 5. and this answer got me the closest...I located msbuild.exe and tried this: in the command prompt: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSbuild.exe C:\MicroFrameworkPK_v4_3\Solutions\Netduino2\dotnetmf.proj /t:rebuild /p:flavor=release /filelogger
OK, now a lot of stuff is flying by in the command prompt! a lot of cyan text, then it starts looking very red, and 6.67 seconds later it ends. 1 Warning(s) 75 Error(s)
This is where I've decided to reach out to the community to help resolve this. I'd like to maintain this top post as a working set of steps so I'll update it as some feedback comes in and these steps work.
Thanks! I hope we can get a working step-by-step!
Update: I've installed the Windows7 SDK v7.1 and I'm using SDK Command Prompt with MSbuild
I'm getting less errors with MSBuild, but still getting a lot of errors.
Unrelated to netduino, but we only use the .net SDK on our buildserver, and compiles c++ code, only stuff that uses MFC and crap like that is troublesome, but that doesnt affect netduino.. I hope.
Few updates. I've got a machine with VS2012,(not express) and am giving it a shot again and pretty much getting the same erros when setting up the build environment. Here are 3 cases:
Win7 SDK Cmd Prompt[As administrator:
VS2012 Developer Command Prompt[not as administrator] Note: First Line: Location of VS Common Tools Folder
VS2012 Developer Command Prompt[As Administrator] Note: VS Common Tools Folder Error goes away until I come back to setenv!
Also
vsvars32.bat lives here:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools
I still have not made a successful build. However, I cannot recreate your issue with msbuild.
In my case I followed ziggurat29's tutorial to get the the 4.2 QFE1 with netduino plus 2 4.2.2.0 firmware to build. I then downloaded the PK and 4.3 firmware from the links posted. After extracting the PK I copied the netduino firmware into the PK directory in the same way that ziggurat29 did in the tutorial.
I opened my command line from the directory in which the PK resides. I did not use the VS2012 command prompt.
I then ran the following :
setenv_base.cmd GCC4.6 PORT c:\yagarto-4.6.0
which returned 'Compiler: GCC4.6 PORT c:\yagarto-4.6.0'
C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\clr\core\InteropAssembliesTable.proj(91,5): error MSB3491: Could not write lines to file "\\Solutions\NetduinoPlus2\TinyCLR\CLR_RT_InteropAssembliesTable.cpp". The network path was not found.\r
EDIT: the first error seems to happen when building TinyBooter, it says the target CPU doesn't support ARM mode
EDIT2: I made a few modification to tools\targets\microsoft.spot.system.gcc.targets, taken from Ziqqurat's modifications (from his 4.2.2 tutorial) and I'm down to 1 warning and 2 errors
EDIT: the first error seems to happen when building TinyBooter, it says the target CPU doesn't support ARM mode
The Cortex-M is not supported in the build files, you'd have to add appropriate -mcpu directive in the Microsoft.Spot.System.GCC.Targets file; plus a few other changes. The easiest way is to download Microsoft.Spot.system.gcc.targets from NicolasG's repository, copy it into \Tools\Targets directory (overwrite the existing one).
However, you'll get several other errors, some were introduced in BitConverter.cpp, also there are missing GCC scatterfiles in Netduino2 solutions, which are mandatory for the linker.
I am now working on fixing GCC support for Netduino2 solutions, I'll publish the source code with detailed instructions when it's done.
EDIT2: I made a few modification to tools\targets\microsoft.spot.system.gcc.targets, taken from Ziqqurat's modifications (from his 4.2.2 tutorial) and I'm down to 1 warning and 2 errors
Kip,
Did you run the patch file from the tutorial? I read through the changes in the text file and there are quite a few modifications that are made across several files. What did you modify?
I'm on the point to start the build of the 4.3.1 firmware of my N2P, and therefore, would like to know the progress of your work.
Any chance to get an updated tutorial ?
Regards
- Billounet
Hey Billounet,
I'm still fussing around with some things, but some of the 4.3 Porting Kit files needed to be adapted so that N2 firmware can be built with the free GCC ARM compilier. I'm researching some things and it also looks like CW2 is working on it too. Hopefully we can find a solution.
I will update the top post. Btw, do you have Visual Studio Pro or just express?
This is another question to be answered, but I think you need VS Pro to compile it, but maybe having both VS Express C# and VS Express C++ might work. Someone may want to try this out and see if they get any error messages.