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.
I have quite a few Netduino devices (2 and +2) deployed in the field. For reasons specific to the installation, I don't have direct access to any of the ports on the devices (usb or serial) and yet I need to perform a remote update of my application.
Through the protocol implemented to communicate with the devices, I have the ability to download just about any content to those devices. That content could be whatever's needed to upgrade the application.
So is there a way to make the application self-updating. The operations that would be required are :
1. Get the update code from the server
2. Do whatever's needed to perform the update
3. Reboot into the new application
Is there a way of performing step 2 above ? If so, how ? Would you have any pointers to a similar implementation ?
Thanks,
Pyt.
PS : not sure this is the best forum to post this, but I had to pick one...
I'm new to netdunio so I don't have all your answers but I have thought about this myself. I also read about running your program from the SD card on these forums.
I'm not sure if there would be a way to update the netdunio's memory where you typically publish your program to while it's running however a thought I had was if what was on the netduino's memory was just code that allowed itself to download program updates and run the program and then the program itself was on an SD card then that would be easier to have the netduino download updates and stop and start the running program.
Your still stuck if you need to update the main program that is doing the launching of the program on the SD card and getting the updates but figured I'd pass along my idea.
Again I'm new I've not tried this but based on what I've read it should work.
I agree with MrSmoofy: The only way I'm aware to change code without reprograming the Netduino is to use a program loaded off an SD card. It should be possible to have the Netduino connect to a server, download the new code file, reboot itself, and then launch the new code. You would probably want to unload the code from memory first before updating.
The downside is that I believe the code is loaded entirely in RAM (though I may be wrong), which would drastically reduce the amount of free RAM you have available, so any RAM intensive programs may be problematic. Your program would have to be small, or split up into multiple code files that could be loaded as needed.
For more information on loading programs from the SD card, please see this post:
There may be other solutions out there that I'm not aware of, and as MrSmoofy said, you couldn't update the program on the Netduino that loads the other programs using this method, so it would be best to make that part as simple and robust as possible.
I'd love to hear about any solutions you implement, and best of luck!
That sounds intriguing, but I'm not sure about the [font="calibri, sans-serif;"]feasibility[/font]. As I understand it (and I'm by no means an expert), the app on the Netduino flash creates the assembly and method objects when loading a program from the SD card, so they are part of the flash application's RAM. So if the flash application exited (which is probably necessary to write to the flash memory), it would dispose of the assembly and method objects as well. I'm also not sure if the firmware would allow for direct access to the flash memory from managed code, though it may be possible to modify the firmware to allow this.
All that is purely speculative on my part, and the only way to know for sure is to try. I look forward to hearing about your results!
That sounds intriguing, but I'm not sure about the [font="calibri, sans-serif;"]feasibility[/font]. As I understand it (and I'm by no means an expert), the app on the Netduino flash creates the assembly and method objects when loading a program from the SD card, so they are part of the flash application's RAM. So if the flash application exited (which is probably necessary to write to the flash memory), it would dispose of the assembly and method objects as well. I'm also not sure if the firmware would allow for direct access to the flash memory from managed code, though it may be possible to modify the firmware to allow this.
The point is that the flash application wouldn't need to exit. The loader would just hard reboot the system. And the loader might have to be partially unmanaged.
Any body has any idea what the flash layout is, where to put the application assemblies and how to burn the thing ? or should I reverse engineer the firmware and/or bootloader ?
Pyt,
It's certainly possible to create custom firmware which can store your new app in spare flash, reboot, write that custom firmware into the main app flash and then reboot again to run it.
We do something like that on AGENT...although with dual-bank flash and two micros.
Chris
where can I find the information about the flash, its layout, how it is programmed, the format of the file used to program it, etc... Would you have any sample code ?
Hi Pyt,
The best resource for information about the MCU, its flash, programming the flash, etc. can be found in:
Datasheet (from our Downloads page)
STM32F405RG Design Resources (more docs, code, etc.)
Chris