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

How big is my program


  • Please log in to reply
21 replies to this topic

#1 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 October 2011 - 10:40 AM

Hi! I'm having some issues and I think they are related with deployment size. How can I see how big is my program and who is using my free bytes?

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!!!

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 03 October 2011 - 11:36 AM

I must confess that I also find it confusing. I'd prefer a simple and clear percentage, maybe even with details.
Anyway, just after the deployment, the size shown is only regarding the program itself. There's no any indication about the dynamic/static object allocations, stack, heap. That's because it's impossible to know it in advance.

However, you may try this trick:
http://forums.netdui...h__1#entry14285

Hope it helps.
Cheers
Biggest fault of Netduino? It runs by electricity.

#3 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 October 2011 - 12:00 PM

Checked. My program is around 96KB, but if it is bigger than 64KB compiler gives an error.

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!!!

#4 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 03 October 2011 - 12:02 PM

Are there any way to prevent using network and having all 128KB for my program???

You can turn your Netduino Plus into Netduino (without networking) by flashing Netduino firmware.

#5 Stefan W.

Stefan W.

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts

Posted 03 October 2011 - 12:06 PM

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.
I believe that no discovery of fact, however trivial, can be wholly useless to the race, and that no trumpeting of falsehood, however virtuous in intent, can be anything but vicious.
-- H.L. Mencken, "What I Believe"

#6 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 October 2011 - 02:20 PM

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.

May main problem is the free ROM space. Having more RAM only be useful if I load assemblies dynamically from an SD card...

#7 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 October 2011 - 04:13 PM

Are there any firmware that gives developer higher RAM amount?? I need networking, but after shrink my code it still is too big. Any idea??

#8 Stefan W.

Stefan W.

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts

Posted 03 October 2011 - 04:27 PM

Are you using a debug build or a release build?
I believe that no discovery of fact, however trivial, can be wholly useless to the race, and that no trumpeting of falsehood, however virtuous in intent, can be anything but vicious.
-- H.L. Mencken, "What I Believe"

#9 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 October 2011 - 04:36 PM

Are you using a debug build or a release build?

I don´t really know. How can I see this??

#10 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 03 October 2011 - 04:50 PM

I don´t really know. How can I see this??

There is 'Solution Configurations' combobox in the Visual Studio toolbar, which displays the selected configuration (i.e. Debug or Release). If you cannot see it (it is often hidden in Visual Studio Express editions), make sure "Show advanced build configurations" is selected in Options dialog box, Project and Solutions category, General page.

Also, you can select the build configuration in Configuration Manager dialog, Build menu.

#11 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 October 2011 - 05:03 PM

You are talking about this, doesn't it?
Posted Image

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

#12 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 03 October 2011 - 05:18 PM

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

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.

Attached Files



#13 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 03 October 2011 - 05:18 PM

The missing brick is actually the RAM, especially on Netduino Plus. But the Plus suffers also about the few ROM. Unfortunately there's no way to increment the available RAM. You may only follow the above suggestions, or/and try to write the code much like the "C++" way. Some tip: minimize the GC usage (favor the static readonly objects, instead creating/destroying); never use large types such as the double, DateTime, TimeSpan (try to use a surrogate); minimize the usage of strings; avoid the use of complex components such as the Xml or similar; try to write the code "as the microprocessor would expect to read it". Okay, just some tip to get the code more compact and fast. Cheers
Biggest fault of Netduino? It runs by electricity.

#14 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 04 October 2011 - 07:35 AM

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.

I think this is almost configured, but now I'm having some troubles:
Posted Image

Do you know why is this happening???

#15 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 04 October 2011 - 07:38 AM

Do you know why is this happening???

What are the errors?

#16 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 04 October 2011 - 07:55 AM

What are the errors?

Most of them are "namespace doesn't exist or can't be found..." (this doesn't happen if I select Debug).

#17 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 04 October 2011 - 07:59 AM

Most of them are "namespace doesn't exist or can't be found..." (this doesn't happen if I select Debug).

In the Solution Explorer, right click on your project name (ex. NetduinoApplication1) and select Add Reference...
Add the required references (most of the time they have the same name as the namespaces)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#18 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 04 October 2011 - 08:06 AM

After adding (again) the references, and build the solution...
Deploying assemblies for a total size of 120600 bytes
Error	1	An error has occurred.  Please check your hardware

Any other idea???

#19 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 04 October 2011 - 08:09 AM

After adding (again) the references, and build the solution...

Deploying assemblies for a total size of 120600 bytes
Error	1	An error has occurred.  Please check your hardware

Any other idea???

Could you give the full output please?

Does the Netduino firmware version matches the reference versions? Ex. they both need to be 4.1, or they both need to be 4.2. Don't mix them up.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#20 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 04 October 2011 - 08:14 AM

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




1 user(s) are reading this topic

0 members, 1 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.