I might have understood this all wrong so I’m hoping for some advice or clarification.
As far as I know there’s about 60KB of program space. The System.IO.pe file is 14KB and the GHI.Hardware.pe file is 39KB which leaves me with not a lot of space for my own code. So if I need both these libraries to access the SD card I’m left with no space for my code. I have read that using System.Reflection.Assembly I can load libraries from the SD card but surely that would cause me to run out of memory.
Firstly I’m asking if all of this is correct?
Secondly if there’s a cut down version of GHI.Hardware I could use just for SD access when I don’t need things like Audio, ControllerAreaNetwork, PulseFeedback, SoftwareI2CBus?
It seems my problem isn’t the size of the code, it just isn’t deploying System.IO when it’s referenced in a library. It’s somehow failing to find and deploying files even when they’re in right paths.
yeah, what you’re seeing is matching versions of the assemblies loaded in firmware and the parts used to reference that in your app. Show us the full output, and we’ll be able to show you what the fault is. And as Gus said, you’re doing well if you ever fill the memory
After realising it wasn’t failing to deploy because of the size. I removed, added, and moved some references and now it seems to be working fine and I can’t recreate the problem. Is there a way to clear assemblies already deployed to the device?
I would suggest you had an old application that had added references to versions of SDK that are not the same as you have installed now. It’s fundamental that you maintain the same firmware version on the device and the same SDK version on your development environment so you don’t run into this issue. You can also do as you did, rip and replace references from the project, if / when you upgrade SDKs and firmware.
The PE files that get deployed and the hex file you can create are in two different formats, so different sizes are expected. The PE files are the one you need to pay attention to. The sum of their size can’t exceed the deployment region. Keep in mind that in NETMF some assemblies are included in the main firmware image so do not get deployed (like mscorlib, Microsoft.SPOT.Native, and others). Loading assemblies at runtime won’t use deployment space, but it will use RAM.