Coder Social home page Coder Social logo

valterfc / arduino-netboot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mharizanov/arduino-netboot

0.0 2.0 0.0 124 KB

A TFTP bootloader for the Arduino Ethernet

License: GNU General Public License v3.0

Makefile 5.22% C++ 57.51% Shell 0.64% C 35.53% Processing 1.10%

arduino-netboot's Introduction

arduino-netboot

About

This is a TFTP bootloader for the Arduino Ethernet, or Duemilanove or Uno with an Ethernet Shield.

It makes it possible to program your Arduino over ethernet.

When the Arduino is powered on this bootloader will use BOOTP to get its own IP address, the address of a TFTP server and the program to download. It then proceeds to download the file and program the internal flash memory of the chip before executing the program.

However, the bootloader only actually programs those flash pages which are different from the downloaded file. This means you can leave your program on the TFTP server and not worry that the internal flash is rewritten every time the Arduino is powered on. The bootloader will just download the file and verify that this is what's already stored on the chip.

Updating your program on the Arduino is very simple. Just update the file on the TFTP server and press the reset button on your Arduino. It is even possible to program the Arduino to reset itself, so the bootloader will be run again to reprogram the Arduino.

Usage

To use this bootloader you'll need 3 things:

  1. A BOOTP server configured to assign your Arduino an IP address and forward it to a TFTP server.

  2. A TFTP server.

  3. A way to program your Arduino with a new bootloader and configure its fuses for a 2k bootloader.

Most, if not all, DHCP servers also work as BOOTP servers since DHCP is in fact just an extension to the older BOOTP protocol. dnsmasq is a nifty program with many functions including a BOOTP/DHCP server and a TFTP server. By default the MAC address of the Arduino will be set to 00:08:DC:00:00:4F.

For the 3rd point you'll need an ISP programmer. In a pinch you can program one Arduino work as an ISP programmer to program another Arduino. A prebuilt Intex HEX file with the bootloader is available from the download section here. If you're not afraid the command line or Makefiles please read the next section for an easy way to flash your Arduino.

Hacking

Right now the files in this repo assume you're using Linux, OSX or some other *NIX variant, and have AVR GCC (and the rest of the AVR toolchain) in your path.

Use the following commands to check out the files from github

$ git clone git://github.com/esmil/arduino-netboot.git
$ cd arduino netboot
$ git submodule update --init

Now you should have a Makefile with a few targets described below.

$ make

This builds a debug version as a normal program. It'll print all it does to the serial port, but won't actually program any memory. It just says "Flashing page 0xXXXX" instead.

$ make bootloader

This builds the actual bootloader without debugging and places it at the right offset into the flash. You'll need to do make clean between building the debug version and this version.

$ make upload

Use avrdude to flash the Arduino with the last build version of the bootloader. By default it'll use the normal Arduino bootloader method, but you can do make PROG=avrispmkII upload to make it use AVR's ISP programmer.

$ make fuses

Set the fuses for a 2k bootloader. Again, you probably want to use make PROG=avrispmkII fuses (or fix the Makefile for whatever programmer you use).

$ make hello_world.bin

This builds a small hello world program and produces a file suitable for the bootloader. Basically it just gives "-O binary" instead of "-O ihex" to avr-objcopy.

$ sudo ./dnsmasq

Lastly this command runs a small script which just starts a dnsmasq instance with a lot of debugging output on eth0 and points the bootloader to download the hello_world.bin program. Don't worry. The bootloader is also tested on a a network with a FreeBSD server running isc-dhcpd and the standard tftp daemon, so it shouldn't be specific to dnsmasq.

License

arduino-netboot is free software. It is distributed under the terms of the GNU General Public License

Contact

Please send bug reports, patches, feature requests, praise and general gossip to me, Emil Renner Berthing [email protected].

arduino-netboot's People

Contributors

esmil avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.