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?
Have you written code and checked your assembly file size? You are going to need to write thousands of lines of code to run out of space.
On TinyCLR, we are looking into breaking things up so you only load what you need, for NETMF, it is not possible unfortunately.
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.
I’m getting output like this:
Assembly: SID (18.104.22.168) needs assembly ‘Thermotor.VAS’ (22.214.171.124)
Assembly: Thermotor.VAS (126.96.36.199) needs assembly ‘Microsoft.SPOT.IO’ (188.8.131.52)
Assembly: Thermotor.VAS (184.108.40.206) needs assembly ‘System.IO’ (220.127.116.11)
Thermotor.VAS references 4 other Microsoft.X libraries that are all in the same installed location as the two it can’t seem to find.
Are you sure that the firmware on your device matches the SDK version selected in your project?
please show all the output from the compilation and deployment.
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?
You probably recovered all GHI assemblies. Make sure to update the firmware and you assume be fine.
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.
Every time I deploy VS tells me that my file size is ~88kB. The .HEX files I then create are ~250 kB.
I’ve never been afraid of running out of room but I’m confused about how this is working if the space is only 60 kB.
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.