Netduino home hardware projects downloads community

Jump to content


Photo

Setting up a Mono Toolchain for Netduino on Linux


  • Please log in to reply
8 replies to this topic

#1 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 19 February 2011 - 02:06 AM

Miguel de Icaza and Marek Safar of Mono got in touch with us to let us know that they've incorporated a bunch of improvements to Mono that will let it work with Netduino. Unfortunately, these changes will not be included in the upcoming 2.10 version of Mono. The good news is that it's not too hard to compile Mono yourself, especially if you are familiar with the shell. These instructions are based on Ubuntu 10.10.

Here's what you need to do first:

  • Install a bunch of dependencies including Mono. This is required because Mono needs an existing installation of Mono to compile itself. Run this command, all on one line:
    sudo apt-get install mono-mcs git build-essential autoconf automake libtool bison flex gettext
  • Follow the steps in MetaDataProcessor.exe WINE notes. This sets up the MetaDataProcessor, which prepares your compiled assembly to run on the NETMF.
Now you're ready to get started. Open a Terminal window (Terminal is in /Application/Utilities). Next:

  • Follow Mono's instructions to check out the latest version of the Mono source.
  • Compile Mono by following these steps (type these commands at the Terminal):

  • Change directory to the Mono source directory:
    cd mono
  • Configure the Mono source code (change /usr/local to wherever you want to install Mono but do not choose /usr):
    ./autogen.sh --prefix=/usr/local
  • Compile Mono:
    make
  • Install Mono (this uses the sudo command to run the command as the super user; you will need to be logged in as an administrative user and you will need to type your password when prompted):
    sudo make install
You now have two versions of Mono installed: one in /usr/bin (the version you installed with apt-get, and the version you just compiled). To use the Mono compiler that supports Netduino, invoke it as /usr/local/bin/mcs (change /usr/local to the prefix you used in step 2 from the last list of steps).

To try compiling a program, use the attached Makefile. This Makefile expects the following:

  • mscorlib.dll, Microsoft.SPOT.TinyCore.dll, Microsoft.SPOT.Native.dll, and MetaDataProcessor.exe must be in the same directory as the Makefile. Those three DLLs and MetaDataProcessor.exe were included with the zipfile you downloaded when you installed MetaDataProcessor in the prerequisites section of this post.
  • Your program must be named Program.cs, and your AssemblyInfo.cs file needs to be in the Properties/ subdirectory. You can find example programs in the Mono bootloader for Netduino (and sample apps) post, which also includes information on deploying the assemblies to the Netduino.
  • If you want to compile anything other than those sample programs, you will probably need to edit the Makefile.

Attached Files



#2 jefe

jefe

    New Member

  • Members
  • Pip
  • 6 posts

Posted 02 September 2011 - 05:29 PM

I had to use "gitk" as the package name for git, under Ubuntu 10.10.

#3 jefe

jefe

    New Member

  • Members
  • Pip
  • 6 posts

Posted 02 September 2011 - 11:51 PM

I found that SecretLabs.NETMF.Hardware.Netduino.dll and Microsoft.SPOT.Hardware.dll also had to be present in the development directory (i.e. the one that contains the Makefile).

#4 Convide

Convide

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationAustria

Posted 18 May 2012 - 11:48 AM

When i try to install wine for the MetaDataProcess, then Ubuntu says, that i have to delete gettext. What should we do here?

#5 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 19 May 2012 - 01:20 AM

When i try to install wine for the MetaDataProcess, then Ubuntu says, that i have to delete gettext. What should we do here?


That's a tough question. I'd suggest pasting the exact error message into Google (in quotes), and see if other users had this problem. You might also check the Wine project page and see if they have alternative installers.

#6 Convide

Convide

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationAustria

Posted 19 May 2012 - 02:20 PM

That's a tough question. I'd suggest pasting the exact error message into Google (in quotes), and see if other users had this problem. You might also check the Wine project page and see if they have alternative installers.


When i install it over terminal, there is no problem.

But another question. With Ubunutu 12.04 64bit i'm not able to install .Net 3.0 Framework, only the 2.0 version.
Does the whole thing work with the 2.0 version of the .Net Framework?

#7 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 23 May 2012 - 01:32 PM

When i install it over terminal, there is no problem.

But another question. With Ubunutu 12.04 64bit i'm not able to install .Net 3.0 Framework, only the 2.0 version.
Does the whole thing work with the 2.0 version of the .Net Framework?


I don't believe it will work with 2.0, but you could give it a try. I'd suggest checking the Wine forums to see if anyone has figured out how to get 3.0 to work on 64-bit Linux.

#8 hiddenpremise

hiddenpremise

    New Member

  • Members
  • Pip
  • 2 posts

Posted 18 June 2012 - 10:57 PM

I don't believe it will work with 2.0, but you could give it a try. I'd suggest checking the Wine forums to see if anyone has figured out how to get 3.0 to work on 64-bit Linux.

I found my issues were resolved with the resolution to this bug report: http://code.google.c...s/detail?id=205

#9 Dr Who

Dr Who

    Advanced Member

  • Members
  • PipPipPip
  • 148 posts
  • LocationNYC

Posted 15 October 2013 - 12:06 AM

Miguel de Icaza and Marek Safar of Mono got in touch with us to let us know that they've incorporated a bunch of improvements to Mono that will let it work with Netduino. Unfortunately, these changes will not be included in the upcoming 2.10 version of Mono. The good news is that it's not too hard to compile Mono yourself, especially if you are familiar with the shell. These instructions are based on Ubuntu 10.10.

Here's what you need to do first:
 


    [*]Install a bunch of dependencies including Mono. This is required because Mono needs an existing installation of Mono to compile itself. Run this command, all on one line:
    sudo apt-get install mono-mcs git build-essential autoconf automake libtool bison flex gettext
    [*]Follow the steps in MetaDataProcessor.exe WINE notes. This sets up the MetaDataProcessor, which prepares your compiled assembly to run on the NETMF.
    [/list]Now you're ready to get started. Open a Terminal window (Terminal is in /Application/Utilities). Next:


      [*]Follow Mono's instructions to check out the latest version of the Mono source.
      [*]Compile Mono by following these steps (type these commands at the Terminal):
       
      [*]Change directory to the Mono source directory:
      cd mono
      [*]Configure the Mono source code (change /usr/local to wherever you want to install Mono but do not choose /usr):
      ./autogen.sh --prefix=/usr/local
      [*]Compile Mono:
      make
      [*]Install Mono (this uses the sudo command to run the command as the super user; you will need to be logged in as an administrative user and you will need to type your password when prompted):
      sudo make install
      [/list]You now have two versions of Mono installed: one in /usr/bin (the version you installed with apt-get, and the version you just compiled). To use the Mono compiler that supports Netduino, invoke it as /usr/local/bin/mcs (change /usr/local to the prefix you used in step 2 from the last list of steps).

      To try compiling a program, use the attached Makefile. This Makefile expects the following:


        [*]mscorlib.dll, Microsoft.SPOT.TinyCore.dll, Microsoft.SPOT.Native.dll, and MetaDataProcessor.exe must be in the same directory as the Makefile. Those three DLLs and MetaDataProcessor.exe were included with the zipfile you downloaded when you installed MetaDataProcessor in the prerequisites section of this post.
        [*]Your program must be named Program.cs, and your AssemblyInfo.cs file needs to be in the Properties/ subdirectory. You can find example programs in the Mono bootloader for Netduino (and sample apps) post, which also includes information on deploying the assemblies to the Netduino.
        [*]If you want to compile anything other than those sample programs, you will probably need to edit the Makefile.
        [/list]

         

Hello!

And suppose that the destination for the Mono arrangement isn't a PC running Ubuntu? My Linux setup runs Slackware Linux. The 13.37 release. And I'm looking at having a Raspberry Pi also running Mono talk to a Netudino. An individual a while ago worked out how to have an Arduino make use of the RasPi as a shield for HDMI delivered video. His included a level shifter that translated the 5v of the device to the 3.3v the RasPi understood. See this one, http://forums.netdui...i-and-netduino/

 

In addition I have Slackware 14.0 running in a VM. It happens that there are more distributions out there then there are computers to run them.


Edited by Dr Who, 29 October 2013 - 03:12 AM.


Doctor Who
"This signature does not exist!"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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