Main Site Documentation

Dynamically loaded assemblies in production?


#1

Hi,
Does anyone use dynamically loaded assemblies in commercial product as remote update solution? Is it really working?

I’m asking because I run with my product in near future and remote update is crucial. Unfortunately this is my one and only option for this.

Best regards
Darek


#2

I’m using dynamically loaded assemblies in my project. For now I doesn’t have any issues.


#3

Sorry, if I spammed. I’ll remove link.
The link shows project, where I use dynamic assembly load. It’s some kind of graphic programming language for Gadgeteer products…


#4

Are there no assembly Version issues when loading an assembly dynamically?
For linked assemblies it need to match exactly, which makes using multiple sub projects (solutions) more complicated.
@ andre.m: Do you have an sample for this?
I’m using dynamically loaded assemblies a lot on Windows, but didn’t know that it’s possible in NETMF. Even refelction is more complicated because of missing methods.


#5

As long as common assemblies (between main app an plugins) doesn’t change this works… The file that must be included is *.pe from le folder.


#6

I think I should browse the docs once in a while.
Thank you.


#7

Thanks everyone for response.
I will go with this solution. Thanks again. :slight_smile:

My plan is to create my own program aka. BootLoader which will be only responsible for checking/testing and running newest plugin from SD card.

Each plugin will responsible for downloading new version and will be implementing interface ITestable

interface ITestable
{
    bool Test();
}

Test method gives me opportunity to test new plugin against the hardware.
If test pass then new version will be current, if not then restart and run previous.

I (plugin) need to be sure that everything is working fine. Devices will be distributed across whole country and I will not have the possibility to connect the device locally.

If assembly will be wrong and device hangs then watchdog restarts CPU and loader use previous version.

That’s the plan. I hope it will work in practice. :slight_smile:

Regards


#8

I have same solution implemented, and it works ;D


#9

Thanks.

PS
I’m not native programmer but with good skills in .net c#.
I was wonder why community ports have no remote firmware update based on data read from attached sd card.

Tinybooter does this (but data is sent through serial port). There is source code but unfortunately I don’t understand most of it. What is difficult to make (if somebody knows c/cpp) something like this but with sd card?

Regards


#10

@ dariol - Dynamic loading assemblies does not need any C/C++ code.
Its pure C#, using the classes in the System.Reflection namespace.
Most of it in NETMF is a subset of the Windows .NET classes.


#11

I think what he ment with the last question is In-Field updates, from SD card


#12

Yeah. I know that. That was my off-topic thoughts about updating whole firmware (assemblies, .net framowork) like ghi did in premium products (https://www.ghielectronics.com/docs/147/in-field-update) :slight_smile:


#13

Exactly :slight_smile:

Missing ‘PS’ after ‘Thanks’ word. :wink:


#14

But InField update does also only need C# code. No matter which source it comes from, because you need to provide it as byte array which you can get with System.IO… from SD card.

p.s. I only use PremiumOffers, not sure if that’s true for OSHW


#15

Unfortunately only in Premium. Thats why I have my thoughts :slight_smile:

I think that for a good native programmer this should not be a very difficult task. :slight_smile:


#16

Yep. I expect this. :slight_smile:

I’m using STM32F407VGT6 and porting kit from Mountaineer but this microbooter does not work. Is microbooter from FEZCerberus will work? Or where I can find working solution for this cpu? (I can compile code my self)


#17

save yourself some time and check out Tom ( AKA Skewworks) Project Pyxis it does exactly what you are trying to do and more, and yes it is open source so you can peek at the code :slight_smile:

http://skewworks.com/products/Open%20Source

Cheers,
Jay


#18

This is true only for dynamically loading assemblies.


#19

I believe he covers both dynamic loading and application remote update… although his solution is targeted at 4.1…


#20

Yes but if You look closer will see that He use SystemUpdate which only works with GHI Premium Firmware.

Regards