- Netduino Forums
- → magarcan's Content
magarcan's Content
There have been 42 items by magarcan (Search limited from 19-April 23)
#22863 Binary files
Posted by magarcan on 17 January 2012 - 09:07 AM in Netduino Plus 2 (and Netduino Plus 1)
#22695 See current method.
Posted by magarcan on 11 January 2012 - 09:48 AM in Netduino Plus 2 (and Netduino Plus 1)
3)
using System.Diagnostics; // get call stack StackTrace stackTrace = new StackTrace(); // get calling method name Console.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);
#22662 See current method.
Posted by magarcan on 10 January 2012 - 05:16 PM in Netduino Plus 2 (and Netduino Plus 1)
I know this two options, but they are for Framework:
1)
MethodBase method = (new StackTrace(true)).GetFrame(0).GetMethod(); string methodname = method.DeclaringType.FullName + "." + method.Name;
2)
MethodBase method = MethodInfo.GetCurrentMethod(); string methodname = method.DeclaringType.FullName + "." + method.Name;Any idea about how to do it in Micro Framework?
#19410 Serial port in emulator
Posted by magarcan on 19 October 2011 - 02:41 PM in General Discussion
#19005 Netduino Plus Firmware v4.2.0 RC1
Posted by magarcan on 10 October 2011 - 04:47 PM in Beta Firmware and Drivers
#18996 Loading assemblies dynamically
Posted by magarcan on 10 October 2011 - 11:13 AM in General Discussion
I'm working over this code:
using System; using System.IO; using System.Reflection; using System.Threading; using Microsoft.SPOT; //using SecretLabs.NETMF.IO; namespace MonoNetduinoBootloader { public class Program { public static void Main() { FileStream assemblyStream; Assembly assembly; object netduinoAppClassInstance; MethodInfo startupMethod; // for Netduino and Netduino Mini: mount the SD card try { // uncomment for netduino //StorageDevice.MountSD("SD", Microsoft.SPOT.Hardware.SPI.SPI_module.SPI1, (Microsoft.SPOT.Hardware.Cpu.Pin)54); // uncomment for netduino mini //StorageDevice.MountSD("SD", Microsoft.SPOT.Hardware.SPI.SPI_module.SPI1, (Microsoft.SPOT.Hardware.Cpu.Pin)12); // netduino plus will auto-mount SD card } catch { Debug.Print("SD card could not be mounted. Please verify that SD card is inserted."); return; } // make sure the assembly exists try { // open the netduino app assembly, built using Mono. assemblyStream = new FileStream(@"\SD\MonoNetduinoApp.pe", FileMode.Open, FileAccess.Read, FileShare.None); } catch { Debug.Print("Netduino app not found. Please copy MonoNetduinoApp.pe to root folder of SD card."); return; } // attempt to load the assembly into RAM try { // read the assembly into RAM byte[] assemblyData = new byte[assemblyStream.Length]; assemblyStream.Read(assemblyData, 0, assemblyData.Length); // load the assembly assembly = Assembly.Load(assemblyData); } catch { Debug.Print("Netduino app corrupted. Please check MetaDataProcessor settings."); return; } finally { assemblyStream.Dispose(); } // using reflection: get the type of the MonoNetduinoApp's startup class; get the statup class's type; using the startup class's, get a reference to the type's Main method. try { netduinoAppClassInstance = AppDomain.CurrentDomain.CreateInstanceAndUnwrap("MonoNetduinoApp, Version=1.0.0.0", "MonoNetduinoApp.Program"); Type netduinoAppClassType = assembly.GetType("MonoNetduinoApp.Program"); startupMethod = netduinoAppClassType.GetMethod("Main"); } catch { Debug.Print("Netduino app invalid. Please verify that class name is MonoNetduinoApp and startup method is Main."); return; } // run the MonoNetduinoApp's startup routine (MonoNetduinoApp.Program's Main method)...starting our app. startupMethod.Invoke(netduinoAppClassInstance, new string[] { }); } } }As you can see, this is the code of Mono Bootloader. My idea is load some assemblies like:
- using Microsoft.SPOT.Native
- using Microsoft.SPOT.Hardware
- System.IO
The problem comes with this:
netduinoAppClassInstance = AppDomain.CurrentDomain.CreateInstanceAndUnwrap("MonoNetduinoApp, Version=1.0.0.0", "MonoNetduinoApp.Program"); Type netduinoAppClassType = assembly.GetType("MonoNetduinoApp.Program"); startupMethod = netduinoAppClassType.GetMethod("Main");
Can I add more than one assembly?? If I want to load an entire class, what have I to write in netduinoAppClassType.GetMethod??
Thanks!!!
#18984 Netduino Plus Firmware v4.2.0 RC1
Posted by magarcan on 10 October 2011 - 07:24 AM in Beta Firmware and Drivers
I think this is the big problem with Netduino. If you test the sample codes, for example all code in Getting Started with the Internet of Things, but when you begin making some bigger you will realise that you can't flash your firmware because it is bigger than the amount flash available.Not much, I actually ended up taking regex out because the referenced assemblies were 30k just but themselves
#18761 Netduino Plus Firmware v4.2.0 RC1
Posted by magarcan on 04 October 2011 - 11:22 AM in Beta Firmware and Drivers
#18758 MetaDataProcessor.exe WINE notes
Posted by magarcan on 04 October 2011 - 11:13 AM in Mono
jae@newton:~/Desktop/netmfbins$ wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse MicroHTTP.dll -minimize -endian le -compile cosa.pe fixme:heap:HeapSetInformation (nil) 1 (nil) 0 Cannot open 'MicroHTTP.dll'! MMP: error MMP0000: 0x80070002
jae@newton:~/Desktop/netmfbins$ wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse MicroIO.dll -minimize -endian le -compile cosa.pe fixme:heap:HeapSetInformation (nil) 1 (nil) 0 MMP: error MMP0000: Cannot locate file for assembly 'System.IO' MMP: error MMP0000: CLR_E_ENTRY_NOT_FOUND
jae@newton:~/Desktop/netmfbins$ wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse MicroXBee.dll -minimize -endian le -compile cosa.pe fixme:heap:HeapSetInformation (nil) 1 (nil) 0 Cannot open 'MicroXBee.dll'! MMP: error MMP0000: 0x80070002I think I've installed everything properly.
#18755 How big is my program
Posted by magarcan on 04 October 2011 - 10:50 AM in General Discussion
Error 1 An error has occurred. Please check your hardwareI've read that this error is showed when you try to write a bigger assembly than allowed...
It's about 117KB when maximum allowed is 64KB.
#18748 How big is my program
Posted by magarcan on 04 October 2011 - 08:14 AM in General Discussion
TinyCLR (Build 4.1.2821.0) Starting... Found debugger! Create TS. Loading start at 14d324, end 162e8c Attaching file. Assembly: mscorlib (4.1.2821.0) (3880 RAM - 33236 ROM - 19134 METADATA) Attaching file. Assembly: Microsoft.SPOT.Native (4.1.2821.0) (1144 RAM - 6516 ROM - 4479 METADATA) Attaching file. Assembly: Microsoft.SPOT.Hardware (4.1.2821.0) (1752 RAM - 11440 ROM - 7371 METADATA) Attaching file. Assembly: Microsoft.SPOT.Net (4.1.2821.0) (704 RAM - 5060 ROM - 2452 METADATA) Attaching file. Assembly: System (4.1.2821.0) (872 RAM - 5992 ROM - 3206 METADATA) Attaching file. Assembly: Microsoft.SPOT.IO (4.1.2821.0) (740 RAM - 4620 ROM - 2522 METADATA) Attaching file. Assembly: System.IO (4.1.2821.0) (1548 RAM - 13292 ROM - 5862 METADATA) Attaching file. Assembly: Microsoft.SPOT.Hardware.SerialPort (4.1.2821.0) (512 RAM - 3488 ROM - 1543 METADATA) Attaching file. Assembly: Microsoft.SPOT.Hardware.Usb (4.1.2821.0) (580 RAM - 3740 ROM - 1844 METADATA) Attaching file. Assembly: SecretLabs.NETMF.Hardware (4.1.0.0) (256 RAM - 1108 ROM - 491 METADATA) Attaching file. Assembly: SecretLabs.NETMF.Diagnostics (4.1.0.0) (180 RAM - 440 ROM - 166 METADATA) Loading Deployment Assemblies. Attaching deployed file. Assembly: SecretLabs.NETMF.Hardware.Netduino (4.1.0.0) (268 RAM - 796 ROM - 423 METADATA) Attaching deployed file. Assembly: MonoNetduinoApp (1.0.0.0) (196 RAM - 384 ROM - 175 METADATA) Resolving. Total: (10952 RAM - 90112 ROM - 49668 METADATA) Total: (10952 RAM - 90112 ROM - 49668 METADATA) The debugging target runtime is loading the application assemblies and starting execution. Ready.I'm working with Micro Framework 4.1 (computer and netduino+'s firmware).
#18746 How big is my program
Posted by magarcan on 04 October 2011 - 08:06 AM in General Discussion
Deploying assemblies for a total size of 120600 bytes
Error 1 An error has occurred. Please check your hardware
Any other idea???
#18744 How big is my program
Posted by magarcan on 04 October 2011 - 07:55 AM in General Discussion
Most of them are "namespace doesn't exist or can't be found..." (this doesn't happen if I select Debug).What are the errors?
#18741 How big is my program
Posted by magarcan on 04 October 2011 - 07:35 AM in General Discussion
I think this is almost configured, but now I'm having some troubles:Well, almost - you'd need to change the active configuration in the combobox in the toolbar from "Debug" to "Release".
The project settings tab you've shown allows you to specify various configuration options, independent of what is selected as active (in the combobox). After you select "Release" in the combobox, you will be actually building it, and you will have "Configuracion: Active (Release)" in the tab (now you have "Active (Debug)").
Edit: Attached picture.
Do you know why is this happening???
#18721 How big is my program
Posted by magarcan on 03 October 2011 - 05:03 PM in General Discussion
I've tried with Release, Debug and Debug (Active) and I'm always having the same problem. I've also chosen "Optimize code" inside "Generate".
#18718 How big is my program
Posted by magarcan on 03 October 2011 - 04:36 PM in General Discussion
I don´t really know. How can I see this??Are you using a debug build or a release build?
#18716 How big is my program
Posted by magarcan on 03 October 2011 - 04:13 PM in General Discussion
#18714 How big is my program
Posted by magarcan on 03 October 2011 - 02:20 PM in General Discussion
May main problem is the free ROM space. Having more RAM only be useful if I load assemblies dynamically from an SD card...In addition to what CW2 said, you can try the firmware in http://forums.netdui...te-50-more-ram/ to see if that suffices for you.
#18713 Netduino Plus update: 50% more RAM
Posted by magarcan on 03 October 2011 - 02:18 PM in Beta Firmware and Drivers
#18709 How big is my program
Posted by magarcan on 03 October 2011 - 12:00 PM in General Discussion
What exactly means this???
● Code Storage: 64 KB
without networking: 128 KB
Are there any way to prevent using network and having all 128KB for my program???
Thanks!!!
#18705 How big is my program
Posted by magarcan on 03 October 2011 - 10:40 AM in General Discussion
I'm using lots of references, are there any way to see how big is each one??
After compiling I can see something like this:
Deploying assemblies for a total size of 1080 bytes Assembly: mscorlib (4.1.2821.0) (3880 RAM - 33236 ROM - 19134 METADATA) Assembly: Microsoft.SPOT.Native (4.1.2821.0) (1144 RAM - 6516 ROM - 4479 METADATA) Assembly: Microsoft.SPOT.Hardware (4.1.2821.0) (1752 RAM - 11440 ROM - 7371 METADATA) Assembly: Microsoft.SPOT.Net (4.1.2821.0) (704 RAM - 5060 ROM - 2452 METADATA) Assembly: System (4.1.2821.0) (872 RAM - 5992 ROM - 3206 METADATA) Assembly: Microsoft.SPOT.IO (4.1.2821.0) (740 RAM - 4620 ROM - 2522 METADATA) Assembly: System.IO (4.1.2821.0) (1548 RAM - 13292 ROM - 5862 METADATA) Assembly: Microsoft.SPOT.Hardware.SerialPort (4.1.2821.0) (512 RAM - 3488 ROM - 1543 METADATA) Assembly: Microsoft.SPOT.Hardware.Usb (4.1.2821.0) (580 RAM - 3740 ROM - 1844 METADATA) Assembly: SecretLabs.NETMF.Hardware (4.1.0.0) (256 RAM - 1108 ROM - 491 METADATA) Assembly: SecretLabs.NETMF.Diagnostics (4.1.0.0) (180 RAM - 440 ROM - 166 METADATA) Assembly: NetduinoPlusApplication1 (1.0.0.0) (164 RAM - 264 ROM - 90 METADATA) Assembly: SecretLabs.NETMF.Hardware.NetduinoPlus (4.1.0.0) (268 RAM - 816 ROM - 423 METADATA) Total: (10920 RAM - 90012 ROM - 49583 METADATA)What does RAM and METADATA mean?? What is the ROM amount available in my Netduino Plus?? I seen in specifications it is 64 KB and 128KB without networking. What does it mean?
Thanks!!!
#18692 .NET Micro Framework 4.2 RC2 released
Posted by magarcan on 03 October 2011 - 07:22 AM in General Discussion
#18546 Conversion types
Posted by magarcan on 28 September 2011 - 02:50 PM in General Discussion
One of the instructions I've is this:
_devic = Convert.ToByte(ByteUtil.GetString(aux), 16);What I need to do is convert an string that is in base 16 to a number. Then convert it into a byte.
The main problem is that I can't convert from base 10 to base 16...
After looking some info, I've seen that MicroFramework Convert.ToByte method has only one argument so I can't choose what the base is needed. Do you have any idea about how to solve this???
I've the same problem using Convert.ToUInt64, Convert.ToSByte...
Thanks!!!
#18534 Where could I buy Netduino Plus in Spain?
Posted by magarcan on 28 September 2011 - 08:00 AM in Netduino Plus 2 (and Netduino Plus 1)
Today, neither to meDoesn't look very plus to me
In 2010?Thank you for te information!
Yeah I want the PLUS model so Bricogeek option is not possible but I've contacted with them and they hope to have the Netduino Plus in 2010 October. I'm waiting for seeing final price and if it's affordable I'll get it there
I supose I'll be back soon!
#18506 Where could I buy Netduino Plus in Spain?
Posted by magarcan on 27 September 2011 - 05:06 PM in Netduino Plus 2 (and Netduino Plus 1)
- Netduino Forums
- → magarcan's Content
- Privacy Policy