What are my options for increasing memory and deploying updates
#1
Posted 30 August 2011 - 01:55 AM
#2
Posted 30 August 2011 - 05:44 AM
#3
Posted 08 September 2011 - 02:18 PM
#4
Posted 08 September 2011 - 02:32 PM
Thanks for the reply. Not sure what the GHI item you mention is does it use C# as well? I'm a software guy not a hardware guy but my worry is the more functionality (code) I add to my project the closer I could get to running out of RAM with no way to increase it.
Does the netduino not support the ability to add additional Card Slots for more storage or possible a USB port to support a thumb drive and or a usb hard drive?
I'll check the framework looks like RC2 came out so I hope it provides an easy way to make software updates.
All .Net MF devices use C#, and it looks like as of 4.2 you will be able to use VB.
GHI makes a .Net MF device called EMX or ChipWorks X that both have lots of additional RAM and Flash, I think up to 16 megs.
I have one of their Embedded Master dev kits (with touch LCD) I would be willing to sell pretty cheaply if you are interested in toying with their offerings without shelling out ~ $350 for the complete dev kit. The modules are about $90 each.
Adding USB storage is not as straight forward as it is on a PC, you still have to have drivers that can communicate with it; now the framework has a lot of capabilities to talk to USB devices with very RAW methods, but you have to know a lot about the internal workings of USB to make it all work. I have not looked into the NetDuino assemblies yet to know what all it offers in that area, Chris would be better to answer that one.
- MrSmoofy likes this
#5
Posted 08 September 2011 - 03:11 PM
Does the netduino not support the ability to add additional Card Slots for more storage or possible a USB port to support a thumb drive and or a usb hard drive?
You can use an SD card for additional storage of resources, but not code space. That has to stay within the limits.
Code carefully, we're spoilt with normal PC dev, we think performance - not size. In this world size is the more important of the two.
#6
Posted 08 September 2011 - 04:40 PM
GOT to be a story behind that name!
I know I had a lot of the same concerns before I actually got a Netduino Plus... especially since it has even less room due to its support of the networking and SD card. But I’ve been surprised at how small the C# code I write is compiled down to before installing on the Netduino.
You can use an SD card for additional storage of resources, but not code space. That has to stay within the limits.
Colin, I’m not sure that is correct. AND, I’m not 100% sure I’m right either… AND IT’S A REAL PAIN IN THE ASS… but,
In the old days (aka Stone Age, IBM PC running a whopping 4.77 MHz) you had to segment out your code into sections. When you needed certain functionality, you dynamically loaded that off the
Now… if you are needing all your code in the 28K memory at once, OR can’t live with the delayed loading, then basically… I’d have to agree with ColinR… you’re basically SOL.
If anyone is interested, I’d be glad to try and do that loading/unloading thing and see how large a program I can get into OFMME (Old Fart Memory Management Engine).
Would anyone happen to have a large C# code base they want tried?
- MrSmoofy likes this
If my message helped you... how 'bout giving me a
www.MessingWithReality.com
#7
Posted 08 September 2011 - 04:44 PM
I played around with the Application.Load() method
I forgot about that, sorry!
#8
Posted 08 September 2011 - 04:47 PM
MrSmoofy,
GOT to be a story behind that name!
I know I had a lot of the same concerns before I actually got a Netduino Plus... especially since it has even less room due to its support of the networking and SD card. But I’ve been surprised at how small the C# code I write is compiled down to before installing on the Netduino.
Colin, I’m not sure that is correct. AND, I’m not 100% sure I’m right either… AND IT’S A REAL PAIN IN THE ASS… but,
In the old days (aka Stone Age, IBM PC running a whopping 4.77 MHz) you had to segment out your code into sections. When you needed certain functionality, you dynamically loaded that off thehard diskfloppy disk and ran it. Once done, you chucked the code and loaded some other over it and continued on. I played around with the Application.Load() method and got it working to do the loading and running side. The part I may be way off… I didn’t try unloading it. Being Managed code, I would assume, killing the reference will unload it, but I don’t know that.
Now… if you are needing all your code in the 28K memory at once, OR can’t live with the delayed loading, then basically… I’d have to agree with ColinR… you’re basically SOL.
If anyone is interested, I’d be glad to try and do that loading/unloading thing and see how large a program I can get into OFMME (Old Fart Memory Management Engine).
Would anyone happen to have a large C# code base they want tried?
Thanks for the reply. This sounds promising. What is the largest SD card the netduino plus can support? I can see myself having the main application on the main memory and loading and unloading dll's from the SD as needed.
#9
Posted 08 September 2011 - 05:50 PM
Thanks for the reply. This sounds promising. What is the largest SD card the netduino plus can support? I can see myself having the main application on the main memory and loading and unloading dll's from the SD as needed.
You got it. I know the current framework (4.1) limit is 2GB. Which is what I have. But I read that the 4.2 it tackling that one and various people have used at least 4GB. I haven't heard yet what the upper limit is going to be.
NOTE: Oh, also, I was looking at this method to handle the code updates for customers you mentioned. Its a whole lot easier (for the customer, not the developer) to just upload through the Internet via the Network connector and on down to the SD card, have the Netduino reboot and they get an upgraded application. Also, I noted that once the Application.Load() has finished loading, it doesn't lock the file... like the desktop does. So you can upload a new program even while the old program is running! Way cool! Just got to make sure the resident program stub is bullet proof! Good luck. Take the plunge.
- MrSmoofy likes this
If my message helped you... how 'bout giving me a
www.MessingWithReality.com
#10
Posted 08 September 2011 - 05:59 PM
If my message helped you... how 'bout giving me a
www.MessingWithReality.com
#11
Posted 08 September 2011 - 07:53 PM
FYI, from 4.1.1 BETA 1 firmware thread: "KodeDaemon (David Stetz) who contributed SD card enhancements to support 4GB SDHC cards (8GB+ cards may work...but not tested)".You got it. I know the current framework (4.1) limit is 2GB.
#12
Posted 08 September 2011 - 08:10 PM
MrSmoofy,
GOT to be a story behind that name!
I know I had a lot of the same concerns before I actually got a Netduino Plus... especially since it has even less room due to its support of the networking and SD card. But I’ve been surprised at how small the C# code I write is compiled down to before installing on the Netduino.
Colin, I’m not sure that is correct. AND, I’m not 100% sure I’m right either… AND IT’S A REAL PAIN IN THE ASS… but,
In the old days (aka Stone Age, IBM PC running a whopping 4.77 MHz) you had to segment out your code into sections. When you needed certain functionality, you dynamically loaded that off thehard diskfloppy disk and ran it. Once done, you chucked the code and loaded some other over it and continued on. I played around with the Application.Load() method and got it working to do the loading and running side. The part I may be way off… I didn’t try unloading it. Being Managed code, I would assume, killing the reference will unload it, but I don’t know that.
Now… if you are needing all your code in the 28K memory at once, OR can’t live with the delayed loading, then basically… I’d have to agree with ColinR… you’re basically SOL.
If anyone is interested, I’d be glad to try and do that loading/unloading thing and see how large a program I can get into OFMME (Old Fart Memory Management Engine).
Would anyone happen to have a large C# code base they want tried?
I am not for sure about MF, because I do not know what it uses to resolve assemblies; I know that on desktop once Fusion loads an assembly into an app domain it is stuck there. You have to unload the entire app domain to unload the assembly.
#13
Posted 08 September 2011 - 08:28 PM
Thanks for the reply. This sounds promising. What is the largest SD card the netduino plus can support? I can see myself having the main application on the main memory and loading and unloading dll's from the SD as needed.
Chris, Stefan, Mario, etc, correct me if I'm wrong.
You can't unload an assembly after it has been loaded. In the regular framework world, the way you handle that is creating a separate AppDomain and unload the entire AppDomain. I don't know if something like that is possible with NETMF though.
-dan
#14
Posted 09 September 2011 - 04:00 AM
#15
Posted 09 September 2011 - 05:58 AM
There is support for AppDomains (CreateDomain(), Unload() etc.) in .NET MF, the question is if it really works - in Launching an application from an SD card fails... thread the final solution uses current domain, but it just could be the goal.... creating a separate AppDomain and unload the entire AppDomain. I don't know if something like that is possible with NETMF though.
#16
Posted 09 September 2011 - 11:45 AM
#17
Posted 09 September 2011 - 02:27 PM
Is reflection supported? If so what about using Assembly.Load and then .CreateInstance
Some reflection is supported. I was going great guns on a project, until...
You can find methods on an object, but you can't query for parameters.
Type typ = GetType(); MethodInfo[] methods = typ.GetMethods(); ParameterInfo[] prms = methods[0].GetParameters(); // <==== This doesn't exist.
If my message helped you... how 'bout giving me a
www.MessingWithReality.com
#18
Posted 09 September 2011 - 02:51 PM
Some reflection is supported. I was going great guns on a project, until...
You can find methods on an object, but you can't query for parameters.
Type typ = GetType(); MethodInfo[] methods = typ.GetMethods(); ParameterInfo[] prms = methods[0].GetParameters(); // <==== This doesn't exist.
I shouldn't need to use GetMethods or GetParameters since I'm writing the code myself I will already know the Methods and Parameters for them.
#19
Posted 09 September 2011 - 02:51 PM
Is reflection supported? If so what about using Assembly.Load and then .CreateInstance
Sorry, didn't answer the second part... This works.
using System; using Microsoft.SPOT; using System.IO; using System.Reflection; namespace Sandbox { public class Instantiate { private Assembly _ass; private object _obj; private Type _type; private MethodInfo _mi; private MethodInfo _ma; public Instantiate() { try { FileStream fs = new FileStream(@"\SD\bin\OutsideLE.pe", FileMode.Open); byte[] image = new byte[(int)fs.Length]; fs.Read(image, 0, (int)fs.Length); fs.Close(); _ass = Assembly.Load(image); _obj = AppDomain.CurrentDomain.CreateInstanceAndUnwrap( "Outside", "ASSM.TestClass"); _type = _ass.GetType("ASSM.TestClass"); _mi = _type.GetMethod("Print"); _ma = _type.GetMethod("DoSomeMath"); _mi.Invoke(_obj, null); } catch (Exception ex) { Debug.Print(ex.Message); } } public long DoSomeMathExternal(params object[] args) { return (long)_ma.Invoke(_obj, args); } } }
The object in the SD binary file
using System; using Microsoft.SPOT; namespace ASSM { public class TestClass { public TestClass() { Debug.Print("TestClass Instantiated"); } public void Print() { Debug.Print("Hello there"); } public long DoSomeMath(int a, int B) { return a * b + b; } } }
If my message helped you... how 'bout giving me a
www.MessingWithReality.com
#20
Posted 09 September 2011 - 03:03 PM
If my message helped you... how 'bout giving me a
www.MessingWithReality.com
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users