Pages

Remote sketch upload to Nanode

Recently I made a presentation to the Nanode application development weekend to demonstrate how to send a new sketch to a Nanode. The idea is that the nanode is a network connected device and with a small addition to the ENC28J60 library it would be possible for it to act as a simple TFTP server and accept new code uploads or poll a remote server to check for updated sketches that can be downloaded.

The demonstration on the day conisisted of a Nanode with additional SRAM installed on the empty pads on the underside of the board. The nanode was also converted to run at 3.3V only as this is a requirement for the SRAM chip. The demonstration nanode had a modified bootloader that checked the SRAM for a magic number at the start and a code length. This then triggered the bootloader to reprogram the main flash. The compiled sketch in .hex format was transfered from a laptop to the nanode using a tftp client.

As detailed in the presentation, there are a number of options for delivering the updated code to the nanode, this was a simple proof-of-concept to demonstrate that once a sketch has been transfered to SRAM it is then possible to reprogram the flash with this new image. The actual delivery mechanism is likely to change in the future but the code in the bootloader should not need to change much.

There are still a number of issues to resolve, such as using an optimised bootloader to increase the available code space, add extra checks to make sure malicious code is not sent or recieved by the nanode.

The bootloader is still available from GitHub

More details and code to follow.иконииконописikoniсвети георги

Bookmark this post: bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

4 comments to Remote sketch upload to Nanode

  • […] Lindsay is working hard on the Nanode software: an updated TCP stack, an updated bootloader, remote code upload, a RESTduino Nanode port and blog post about RESTduino Nanode […]

  • amitverma

    hi there andy i came across your blog while searching for my problem. i am making a device which once deployed will not be in my reach to change the code. i was looking for solution for my problem. which is i am using an arduino uno + gsm/gprs shield and i need to upload the sketch remotely if any changes are required remotely. i found that your boot loader is build on arduino core. i was wandering if i upload this to my arduino uno will it work properly and who can i build my own server for teh same. i am totally novice in electronics and coding boot loader. my project requires arduino to connect to the server through gprs and look for any updates if there is any new updates then to download the new updates and run the new set of instructions. without needing it to be connected to the computer and upload the new sketch to it and reboot the system. please help me out on this one my email address is amit.angel.verma@gmail.com thanks looking forward to your answer.

  • Hi,

    the reason the upload process I’ve demonstrated works, is that the board I used had an external ram chip connected to the SPI bus as the download proces saves the image into prior to it being validated and programmed.

    Without this extra ram, its going to be a lot more difficult to implement this.

    Cheers

    Andy

  • amitverma

    thanks for replying so quickly, is it possible to download the sketch to the memory card attached to the arduino and then programmed.