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

Upload applications


  • Please log in to reply
20 replies to this topic

#1 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 13 February 2011 - 10:18 AM

Hi, Is it possible to upload application using TCP/IP or serial port into Netduino Plus without micro framework SDK? I'd like to give my customers a device which can be updated sometimes. For example, I send my compiled application and the customer upload the application by ethernet or serial port.

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 13 February 2011 - 10:35 AM

Hi there. I'll have the same problem, but I think would be important to keep the framework. I didn't tried anything about yet, but I think the solution could be as follows: - your device has the (previous) firmware running; - that firmware must include some functionality to receive (via TCP/IP and/or serial) bunch of data (e.g. the firmware); - that bunch of data should be treated as an ACID transaction (i.e. should be kept in a temporary cache until the running firmware will commit it); - once committed, the device should be reset; IMO, you should not avoid some remote-bootstrap manager, because it's important to keep the control of the MCU, even during a remote session. That bootstrap should be as much simple as bullet-proof. What if you upload a bugged firmware (for error), so that the device halts? Cheers Mario
Biggest fault of Netduino? It runs by electricity.

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 February 2011 - 10:54 AM

Hi,

Is it possible to upload application using TCP/IP or serial port into Netduino Plus without micro framework SDK? I'd like to give my customers a device which can be updated sometimes. For example, I send my compiled application and the customer upload the application by ethernet or serial port.


Hi madartsoft,

How big is your application? If it's small, perhaps you could store it as a set of assemblies on the SD card and load them via code? Then you could "replace" them through your app via TCP/serial and when you reset your Netduino Plus the new application would load?

Technically you might need to have two copies until the reboot (the old app and the new app), and then you could delete the old app after reboot...

Chris

#4 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 13 February 2011 - 11:01 AM

Chris, I'd like to take advantage to ask you an info about this argument. It could be possible to mount an "unit" within the flash of the MCU, so that avoiding the SD hardware (assuming the MCU's flash is small enough)? Thanks. Mario
Biggest fault of Netduino? It runs by electricity.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 February 2011 - 11:10 AM

Chris, I'd like to take advantage to ask you an info about this argument.
It could be possible to mount an "unit" within the flash of the MCU, so that avoiding the SD hardware (assuming the MCU's flash is small enough)?
Thanks.
Mario


If ExtendedWeakReferences were enabled in the firmware, you'd be able to store very small assemblies there. Also please be aware that EWRs may be stored redundantly taking more room. Enabling EWR would probably take a few hours to sort out, but it's doable. [We plan on making changes to the Netduino firmware to strip this out completely in a future update...but it could be added back in just as easily.]

It's also possible to create native code which overwrites the MCU's flash. You'd need to load that native code into RAM, but also very doable. Just not built-in :) [Although it would be an interesting thing to build in in the future too.]

Chris

#6 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 13 February 2011 - 11:14 AM

Chris, this is really a good idea but how I can load assemblies via the code? Unfortunately I'm not C# expert.

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 February 2011 - 11:26 AM

Chris, this is really a good idea but how I can load assemblies via the code? Unfortunately I'm not C# expert.


It is a more advanced feature of C#, but you can reuse the code over and over again...

Check out community member Fabien Royer's blog post about it:
http://fabienroyer.w...ith-a-netduino/

Chris

#8 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 13 February 2011 - 11:34 AM

Hmmm... I'd prefer to use an external memory at this point. Maybe an serial flash IC instead a microSD. It's much more reliable within heavy dusty environments. In any case, supposing that I'll deploy a library on that flash (i.e. the "dynamic" part of the application), then I may load the assembly via reflection (Assembly.Load). That's will load the assembly in ram? If not, that's imply an heavy data exchange via SPI...hmmm, no good! <_< Ciao
Biggest fault of Netduino? It runs by electricity.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 February 2011 - 12:18 PM

Hmmm...
I'd prefer to use an external memory at this point. Maybe an serial flash IC instead a microSD.
It's much more reliable within heavy dusty environments.

In any case, supposing that I'll deploy a library on that flash (i.e. the "dynamic" part of the application), then I may load the assembly via reflection (Assembly.Load). That's will load the assembly in ram?
If not, that's imply an heavy data exchange via SPI...hmmm, no good! <_<

Ciao


Yes, Assembly.Load(...) should load the assembly into RAM. Serial flash or EEPROM should work fine.

Chris

#10 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 13 February 2011 - 02:24 PM

Thank you, I'm able to run the application and load an assembly now but as suggested I'm going to use EEPROM or serial flash. So, next task is to connect EEPROM.

#11 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 18 February 2011 - 09:39 AM

Thank you, I'm able to run the application and load an assembly now but as suggested I'm going to use EEPROM or serial flash. So, next task is to connect EEPROM.


Unfortunately my app is too large and doesn't fit in RAM. I have an exception: OutOfMemory :(

What is minimum software requirments on the client side to upload compiled application?

#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 February 2011 - 09:55 AM

Unfortunately my app is too large and doesn't fit in RAM. I have an exception: OutOfMemory :(

What is minimum software requirments on the client side to upload compiled application?


madartsort,

You need Windows XP or newer to deploy applications through MFDeploy (or a custom app). Pretty much any computer with Windows XP or newer should work, but there's probably _technically_ a lower limit :)

Also, you can deploy the app from Mac/Linux using a custom C# app (or our MFDeploy port for Mono)...but that currently requires serial deployment.

One more thing: if you don't need the Ethernet feature of the Netduino Plus, you may want to try erasing the board and reflashing it with the upcoming v4.1.1 beta firmware. That will give you SD access still--but remove the ~32KB of RAM used by the networking feature.

Chris

#13 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 18 February 2011 - 10:50 AM

madartsort,

You need Windows XP or newer to deploy applications through MFDeploy (or a custom app). Pretty much any computer with Windows XP or newer should work, but there's probably _technically_ a lower limit :)

Also, you can deploy the app from Mac/Linux using a custom C# app (or our MFDeploy port for Mono)...but that currently requires serial deployment.

One more thing: if you don't need the Ethernet feature of the Netduino Plus, you may want to try erasing the board and reflashing it with the upcoming v4.1.1 beta firmware. That will give you SD access still--but remove the ~32KB of RAM used by the networking feature.

Chris


Definitly I prefer the first option. I'd like to give an opportunity for end user to upload my compiled application (not RAM) probably I will give end user not only MFDeploy but also some drivers. One more idea, is it possible to upload compiled application via serial port and MFDeploy? I tried to do that but with no results.

#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 February 2011 - 10:57 AM

Definitly I prefer the first option. I'd like to give an opportunity for end user to upload my compiled application (not RAM) probably I will give end user not only MFDeploy but also some drivers. One more idea, is it possible to upload compiled application via serial port and MFDeploy? I tried to do that but with no results.


Yes, but you need to switch the Netduino to "serial deploy/debug" instead of "USB deploy/debug" using our custom MFDeploy software. You can also switch over to serial deploy/debug using code on the Netduino :)

Chris

#15 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 18 February 2011 - 02:43 PM

I connected N+ using serial cable (RX, TX, GND) but nothing happen. The MFDeploy doesn't see my N+. I also changed the option from USB to serial (serial: 115200, 8, N, 1). I read thread about Netduino Mini and there is mentioned about DTR signal. Does it apply also for Netduino Plus? Is there any key combination like press key and switch on the N+ ??

#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 February 2011 - 03:02 PM

I connected N+ using serial cable (RX, TX, GND) but nothing happen. The MFDeploy doesn't see my N+. I also changed the option from USB to serial (serial: 115200, 8, N, 1). I read thread about Netduino Mini and there is mentioned about DTR signal. Does it apply also for Netduino Plus? Is there any key combination like press key and switch on the N+ ??


madartsoft,

Which version of MFDeploy are you using?

Also, you're using a 3.3V USB-TTL cable (or an RS232 cable with an RS232 shield) correct?

Crhis

#17 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 18 February 2011 - 03:23 PM

madartsoft,

Which version of MFDeploy are you using?

Also, you're using a 3.3V USB-TTL cable (or an RS232 cable with an RS232 shield) correct?

Crhis


I have to check which version MFDeploy I have. I'm using USB-TTL 3.3V cable.

#18 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 18 February 2011 - 06:21 PM

I'm using MFDeploy version 4.1.2821.0

#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 February 2011 - 12:15 AM

I'm using MFDeploy version 4.1.2821.0

Hi madartsoft,

Sorry, let me rephrase the question. Are you using our special build of MFDeploy (the one that lets you change debug transport from USB to RS232 and vice-versa)?

The regular MFDeploy that comes with .NET MF will let you deploy to either--but it won't let you change the device's config.

Chris

#20 madartsoft

madartsoft

    Member

  • Members
  • PipPip
  • 19 posts

Posted 19 February 2011 - 08:56 AM

Hi madartsoft,

Sorry, let me rephrase the question. Are you using our special build of MFDeploy (the one that lets you change debug transport from USB to RS232 and vice-versa)?

The regular MFDeploy that comes with .NET MF will let you deploy to either--but it won't let you change the device's config.

Chris


Chris, I'm using the standard MFDeploy that comes with .NET MF. Where I can get the special build of MFDeploy?




0 user(s) are reading this topic

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