Netduino home hardware projects downloads community

Jump to content


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.
Photo

Compiling Custom Netduino Firmware: Step-By-Step Instructions - Help

firmware gcc yagarto

  • Please log in to reply
17 replies to this topic

#1 gismo

gismo

    Advanced Member

  • Members
  • PipPipPip
  • 110 posts

Posted 27 February 2014 - 09:42 PM

Thank You CW2 for figuring it out!

 

Thread Here: http://forums.netdui...th-gcc-support/

 

 

 

Original Post - (Some debugging and error fixing can be found below)

-------------------------------------------------------

 

 

Hey Everyone,

 

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)

 

  1. Download the netmf 4.3 Porting Kit https://netmf.codepl...oads/get/790686 PK.zip
  2. Download the 4.3.1.0 Netduino Source Code: http://www.netduino....rce_4.3.1.0.zip
  3. Extract PK.zip (anywhere)
  4. Download Yagarto: I have 2 for testing:
  5. Run/Double-click MicroFrameworkPK.MSI
  6. Follow Instructions/Prompts for installing the porting kit
  7. A folder: "C:\MicroFrameworkPK_v4_3" should now exist
  8. Extract the Netduino firmware zip anywhere. Copy the folder c:\[your extract location]\\netduinofirmware_source_4.3.1.0\MicroFrameworkPK_v4_3 <-This folder.
  9. Switch back to C:\ and Paste.You will get some prompts; overwrite everything. 
  10. Install 20110429 Yagarto. Use Installation directory "C:\Yagarto46"
  11. Everything is installed and in the correct locations (as far as I know and what previous tutorials say)
  12. (Make your firmware modifications at this step) for this example and minimizing errors, I will skip this step)
  13. Goto Start->All Programs->Microsoft Visual Studio 2012-> Visual Studio Tools -> Developer Command Prompt for VS2012
    1. Setup the compiler environment (version A)
      1. ?type in the command prompt: cd C:\MicroFrameworkPK_v4_3
      2. press enter   
      3. type in the command prompt: setenv.cmd 4.6 C:\Yagarto46
      4. press enter.
    2. ALTERNATIVE: Setup the compiler environment (version B)
      1. ?type in the command prompt: cd C:\MicroFrameworkPK_v4_3
      2. press enter   
      3. type in the command prompt: setenv_base.cmd GCC 4.6 PORT C:\Yagarto46
      4. press enter.
    3. ?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)
    4. ?Attempt to COMPILE
      1. 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
      2. 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
    5. ERROR: MSbuild is not recognized as an internal or external command, operable program or batch file. 
    6. 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
    7. 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.



#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 27 February 2014 - 10:51 PM

Assumptions: Using Netduino 4.3 firmware/framework, and 4.3 SDK and VS2012 Express.

 

The Express edition is not enough for building the firmware, you need Visual C++ compiler too, that means Visual Studio 2012 Professional or higher.



#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2014 - 12:14 AM

Hi CW2,

The Express edition is not enough for building the firmware, you need Visual C++ compiler too, that means Visual Studio 2012 Professional or higher.

I build with Visual Studio installed, but I noticed this in the PK release notes...

Visual Studio...
...or both .NET Framework 3.5 and Windows SDK for Windows (downloadable from microsoft.com).


Is it possible to build the SDK with just the Windows SDK tools and .NET 3.5 runtime?

Chris

#4 gismo

gismo

    Advanced Member

  • Members
  • PipPipPip
  • 110 posts

Posted 28 February 2014 - 07:48 PM

When you install the SDK it says it's installing C++ compilers. I thought that would so the trick...

On a side..There are so many MS products it's hard to tell what's doing what....especially in this context.

Are there any third party compilers or MS independent option? Maybe one with a GUI?? Or is that wishful thinking?

#5 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 01 March 2014 - 12:30 PM

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. :)

--
Asbjrn


#6 gismo

gismo

    Advanced Member

  • Members
  • PipPipPip
  • 110 posts

Posted 01 March 2014 - 07:43 PM

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:

DRXi4Uk.jpg
 

VS2012 Developer Command Prompt[not as administrator] Note: First Line: Location of VS Common Tools Folder

rFlKVg0.jpg

 

VS2012 Developer Command Prompt[As Administrator] Note: VS Common Tools Folder Error goes away until I come back to setenv!

mCy8k3J.jpg

 

Also

vsvars32.bat lives here:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools

 

Also, The above errors are with this fix applied:

 

I've applied this fix: http://schrievkrom.w...n-tools-folder/

 

Also here's a download link to the build log with the current conditions: http://www.datafilehost.com/d/cffe84a1



#7 yogotie

yogotie

    Member

  • Members
  • PipPip
  • 16 posts

Posted 02 March 2014 - 05:03 AM

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'
 
and then ran
 
Msbuild Solutions\NetduinoPlus2\dotnetmf.proj /T:rebuild /p:flavor=release;tcp_ip_stack=lwip /filelogger
 
which ended in 2 errors 
 
"C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Solutions\NetduinoPlus2\dotnetmf.proj" (rebuild target) (1) ->
"C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Solutions\NetduinoPlus2\TinyBooter\TinyBooter.proj" (Build target) (2) ->
"C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Application\TinyBooter\TinyBooterLib.proj" (Build target) (3) ->
"C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Framework\Tools\CreateCLRDefines.proj" (Build target) (8:2) -> (BuildClrDefines target) ->
  C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Framework\Tools\CreateCLRDefines.proj(12,5): error : Value cannot be null.\r
C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Framework\Tools\CreateCLRDefines.proj(12,5): error : Parameter name: path
 
 
"C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Solutions\NetduinoPlus2\dotnetmf.proj" (rebuild target) (1) ->
"C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\Solutions\NetduinoPlus2\TinyCLR\TinyCLR.proj" (Build target) (124) ->
"C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\clr\core\InteropAssembliesTable.proj" (Build target) (135) -> (GenerateInteropTable target) ->
  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
C:\Projects\DotNetMf\NetduinoPlus2_4.3_QFE1\clr\core\InteropAssembliesTable.proj(91,5): error MSB3491:
 

I'll continue to investigate my compile issues



#8 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 02 March 2014 - 07:19 AM

 

setenv_base.cmd GCC4.6 PORT c:\yagarto-4.6.0

 

The 'PORT' parameter is not used in NETMF 4.3, you should call setenv_gcc.cmd:

 

setenv_gcc.cmd 4.6.2 C:\Yagarto-4.6.2

 

The version number (4.6.2) must match the directory name in lib\gcc\arm-none-eabi.



#9 Kip

Kip

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationItaly

Posted 02 March 2014 - 12:10 PM

I tried with the two Yagarto versions of the first post and with the latest version of the GNU Tools For ARM.

In all the cases I used the VS2012 Developer Command Prompt as Administrator (I have both VS2012 Premium and VS2013 Ultimate installed)

with this command:

 

msbuild Solutions\NetduinoPlus2\dotnetmf.proj /T:rebuild /p:flavor=release;tcp_ip_stack=lwip /filelogger

 

it always fails with 1 warning and 114 errors

 

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



#10 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 02 March 2014 - 12:40 PM

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.

#11 Kip

Kip

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationItaly

Posted 02 March 2014 - 01:00 PM

Well, that's some great news :D Let me know if I can help in any way :)



#12 gismo

gismo

    Advanced Member

  • Members
  • PipPipPip
  • 110 posts

Posted 02 March 2014 - 02:20 PM

and we get deeper into the wormhole....


Anyone have any insight into the errors that I'm getting about VS Common Tools Folder?

Is it possible that any previously installed VS versions are causing some conflicts? Any possible registry artifacts?

I'm thinking about wiping out every vs and .net related item in the add/remove programs list and then installing vs2012 again.

 

Update: I've run the vs2010 uninstaller. It leaves some artifacts.

 

Then I've applied the modifications to the vsvars32.bat files in both VS10 and VS11 folders:

http://stackoverflow...-of-the-vs-comm

 

The error has seemed to go away, but when running the build again I get the same 1 Warning and 75 errors.

 

I've skimmed through the build log and can't much sense of it.

My Build Log

 

And this is the ms build command for N2:

msbuild c:\MicroFrameworkPK_v4_3 msbuild c:\MicroFrameworkPK_v4_3\Solutions\Netduino2\dotnetmf.proj /t:rebuild /p:flavor=release /filelogger


#13 gismo

gismo

    Advanced Member

  • Members
  • PipPipPip
  • 110 posts

Posted 02 March 2014 - 11:21 PM

 

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?



#14 yogotie

yogotie

    Member

  • Members
  • PipPip
  • 16 posts

Posted 04 March 2014 - 03:59 AM

The 'PORT' parameter is not used in NETMF 4.3, you should call setenv_gcc.cmd:

 

setenv_gcc.cmd 4.6.2 C:\Yagarto-4.6.2

 

The version number (4.6.2) must match the directory name in lib\gcc\arm-none-eabi.

 

I didn't pay attention to the fact that they changed the setenv commands.  Thanks for pointing that out.

 

Now I get the 114 errors like Kip got.



#15 Nicolas Besson

Nicolas Besson

    New Member

  • Members
  • Pip
  • 9 posts

Posted 04 March 2014 - 09:25 AM

Hi,

 

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



#16 gismo

gismo

    Advanced Member

  • Members
  • PipPipPip
  • 110 posts

Posted 04 March 2014 - 03:16 PM

Hi,

 

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.



#17 heyang1987

heyang1987

    New Member

  • Members
  • Pip
  • 1 posts

Posted 06 March 2014 - 07:54 PM

Hi folks,

 

Any update on this?

I have the exact same problem as the op. If I use the setenv_base command, I got 2 errors as well as 1 warning. setenv_gcc command brought 114 errors.



#18 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 17 March 2014 - 12:48 PM

Any update on this?

 

Please have a look at Netduino 2 Firmware v4.3.1 with GCC support







Also tagged with one or more of these keywords: firmware, gcc, yagarto

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.