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.

Szymon

Member Since 04 Aug 2010
Offline Last Active Jul 14 2011 01:08 PM
*****

Topics I've Started

Memory considerations

28 September 2010 - 06:16 PM

Hi,
I'm working on a larger project for Netduino Plus. I was hoping to use System.Http.dll but it turns out that I'm running out of memory when I try to deploy the whole project. So I started looking how the memory is allocated.

First here are the assemblies that are included wiht the Netduino Plus firmware:
mscorlib (4.1.2821.0) (3880 RAM - 33236 ROM - 19134 METADATA)
Microsoft.SPOT.Native (4.1.2821.0) (1144 RAM - 6516 ROM - 4479 METADATA)
Microsoft.SPOT.Hardware (4.1.2821.0) (1752 RAM - 11440 ROM - 7371 METADATA)
Microsoft.SPOT.Net (4.1.2821.0) (704 RAM - 5060 ROM - 2452 METADATA)
System (4.1.2821.0) (872 RAM - 5992 ROM - 3206 METADATA
Microsoft.SPOT.IO (4.1.2821.0) (740 RAM - 4620 ROM - 2522 METADATA)
System.IO (4.1.2821.0) (1548 RAM - 13292 ROM - 5862 METADATA)
Microsoft.SPOT.Hardware.SerialPort (4.1.2821.0) (508 RAM - 3440 ROM - 1527 METADATA)
Microsoft.SPOT.Hardware.Usb (4.1.2821.0) (580 RAM - 3740 ROM - 1844 METADATA)
SecretLabs.NETMF.Hardware (4.1.0.0) (256 RAM - 1108 ROM - 491 METADATA)
Total: (10320 RAM - 88444 ROM - 48888 METADATA)

As you can see in total it consumes about 88KB of RAM and I think most of these libraries are essential for any project. Well maybe apart from Microsoft.SPOT.Hardware.Usb - I guess most of network devices won't need ot connect as USB client. But it gains us only about 4KB.

When I add System.Http to blank project I can deploy it but it leaves very little ROM left. Here are the additional assemblies:
Microsoft.SPOT.Net.Security (4.1.2821.0) (264 RAM - 1220 ROM - 606 METADATA)
System.Net.Security (4.1.2821.0) (664 RAM - 4544 ROM - 1943 METADATA)
System.Http (4.1.2821.0) (2976 RAM - 38160 ROM - 12831 METADATA)

So in total it will add almost 44KB ROM. Of this about 6KB is used for the security assemblies. I guess this is requried to support HTTPS. I don't need it for my project at the moment so it would be cool to turn it off. (Again, I wish .NET MF had a post compile linker like MonoTouch to strip the code that is not executed in the project).

According to the tech spec Netduino Plus has only 48KB ROM left for our code. So with System.Http it leaves us with only about 4KB. It's really not enough for anything beyond a most basic project. For example for my project I estimate at least 15KB be needed.

So for now System.Http is no go, and I will try to implement basic HTTP functions on my own. But I hope there is a way to reduce the size of these libraries somehow so we get at least 15-20KB ROM more.

Using TimeService

28 September 2010 - 07:24 AM

Hi,
I'm trying to use the TimeService class (from Microsoft.SPOT.Time assembly) to synchronize time on Netduino with NTP server. Here is my code:

  var timeServer = "time.nist.org";
  IPHostEntry timeServerHostEntry = Dns.GetHostEntry(timeServer);

  var status = TimeService.UpdateNow(timeServerHostEntry.AddressList[0].GetAddressBytes(), 200);
  Debug.Print("Current time UTC"+status.CurrentTimeUTC);

But I get this exception when calling any method on TimeService:

    #### Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (1) ####
    #### Message: 
    #### Microsoft.SPOT.Time.TimeService::UpdateNow [IP: 000a] ####
    #### NetworkTest.Program::Main [IP: 0044] ####
A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.Time.dll
An unhandled exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.Time.dll

Is this function implemented in Netduino Plus firmware?

Colin Miller explains the Gadgeteer hardware system

26 September 2010 - 05:35 PM

Take a look here: http://blog.makezine..._gadgeteer.html Gadgeteer is very interesting project for rapid prototyping of embedded devices built by Microsoft Research team in Cambridge. Of course .NET MF is heart of a project. http://research.micr...er/default.aspx Not much information on the project page right now but I hope we can find out more soon. In particular it would be interesting to learn what board they use, and if it can be made compatible with Netduino (maybe via a dedicated component shield).

How to use the SD card and StreamWriter

24 September 2010 - 09:45 PM

I'm trying to get the SD card working but get an error when closing the StreamWriter.

Here is the code:
var fs = new FileStream(fileName, FileMode.Append, FileAccess.Write, FileShare.None, 512);
var sw = new StreamWriter(fs);
sw.WriteLine("Hello Netduino");
sw.Close();

and this is the error:

    #### Exception System.IO.IOException - CLR_E_FILE_IO (4) ####
    #### Message: 
    #### Microsoft.SPOT.IO.NativeFileStream::Write [IP: 0000] ####
    #### System.IO.FileStream::Write [IP: 002a] ####
    #### System.IO.StreamWriter::Flush [IP: 0021] ####
    #### System.IO.StreamWriter::Dispose [IP: 0016] ####
    #### System.IO.TextWriter::Dispose [IP: 0005] ####
    #### System.IO.StreamWriter::Close [IP: 0004] ####
    #### RoomMonitor.Application::DataLogUpdate [IP: 0090] ####
A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
    #### Exception System.IO.IOException - 0x00000000 (4) ####
    #### Message: StreamWriter Flush. 
    #### System.IO.StreamWriter::Flush [IP: 002b] ####
    #### System.IO.StreamWriter::Dispose [IP: 0016] ####
    #### System.IO.TextWriter::Dispose [IP: 0005] ####
    #### System.IO.StreamWriter::Close [IP: 0004] ####
    #### RoomMonitor.Application::DataLogUpdate [IP: 0090] ####
A first chance exception of type 'System.IO.IOException' occurred in System.IO.dll


UART 2 hardware flow control

08 September 2010 - 07:11 AM

Hi, In the tech specs the digital pins 7-8 are labeled as UART 2 RTS, and CTS. I'm thinking to use it with XBee since the RTS and CTS is nicely available on the header in adafruit's xbee adapter that I'm using. But I'm not sure how to enable the hardware flow control. I looked at the SerialPort class and don't see any options in the constructor or otherwise. Did I missed something here? Thanks, -Szymon

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.