Documentation

/Requirements

/PartLists

/Construction

/Tests

/Flashing

/Initialization

Next Chapter

Installing the Firmware on the NG Hardware

Flashing the firmware on Linux/OS X

Getting the latest firmware release

You can download the files from the Download page.

You will get a folder called "firmware" containing, amoung others, the following files:

Flashing the LPC-H2148 firmware

There are several ways to flash the hex file for the LPC2148: Via its serial port (UART/ISP), through a JTAG adapter or through its USB port. The last option (USB port) is only possible after having installed a special firmware that supports this procedure - initially this won't be the case. Hence, when you flash the LPC for the first time, you have to use UART/ISP or JTAG.

Note: If you have a JTAG adapter, use it, because it's faster and easier than the UART/ISP technique.

Flashing via UART/ISP

The LPC has a serial bootloader embedded, listening on X-UART1 (UART0 on the LPC2148). To enter bootloader mode, the Jumper JP-ISP above the BOOT button has to be in the 2-3 position (1-2 for pre 0.21 HW). Then power off your NG, hold down the BOOT button (Reset on pre 0.21 HW) on the FC and power up the NG again. Now connect a RS232 to 3.3V CMOS converter (see SerCon) from your PC to the NG's X-UART1, RXD and TXD crossed. The converter can be supplied with 3.3V or 5V from the NG via Pin 4. You have to set the JP-U1 Jumper accordingly.

/!\ If your converter is self-supplied, don't connect Pin 4 or pull the Jumper JP-U1 next to X-UART1! Pin 1 of X-UART1 is located next to R26 on the FC PCB (top view).
The NGcon and the MK-SerCon need 5V (set JP-U1 to position 2-3). The NGusb is self-supplied via USB.

X-UART1 Pinout X-UART1 Closeup

Step-by-step flashing via UART/ISP

The serial flash tool can be found in your release package:

For convenience, you can copy it to /usr/local/bin. After you checked all connections and entered the bootloader mode, start the show with:

Replace the filename and serial port device if necessary. If it takes a long time to sync and you get errors, you might want to throttle the baud rate to 19200.

If everything is ok, you should see something like this:

You should have an operational FC by now, so just cycle power on your NG and have fun!

Automated flashing via UART/ISP

The serial flash executable can be found in your release package:

Download the file and start it. It will ask you for the serial device to use. After entering the device path, it will automatically start the inlcuded lpc21isp executable and start flashing the LPC using the serial device.

Flashing via JTAG

See JTAG

Flashing via USB/IAP

The code has to be built with --enable-usb-bootloader and --enable-usb-bootloader-switch The ngos-usb-bl.hex has to be flashed with one of the methods described above. After that has been done, all further flashes can (and must) be done via

This should take only about 6 seconds! :-)

To enter the USB bootloader, the jumper JP-ISP has to be in 1-2 position (2-3 for pre 0.21 HW) and the BOOT button has to be pressed while turning on the device. Alternatively, if the shell is already available, instead of pressing any buttons on the FC one might simply enter "flash usb" at the shell.

Verify the successful flashing of the LPC-H2148

After you have flashed the LPC, you can try connecting its USB port directly to your PC.

OSX: Use a tool to list the connected USB devices (OS X: System Profiler) to see if you find a device called "usbmodemDEADC0D1" or similar. That's the LPC with our firmware.

Linux: Use minicom or similar to connect to /dev/ttyACM0. You should get NGOS shell access.

For further tests, read Initialization

Flashing the Atmel 644p (RC-Controller) firmware

The ISP connector for the 644p needs to be soldered to the side of the FC board, as shown here:

FC-ISP.jpg

Pin 1 is on the bottom left in the picture.

(Fuse settings to enable: SPIEN, EESAVE, BOOTSZ0, BOOTSZ1, BOOTRST, BODLEVEL1)

First, set the fuse bits with avrdude (Note: Replace "avrisp2" with your programmer's name, e.g. "dragon_isp" for the AVR-Dragon and "ponyser" for one via SerCon):

/!\ If avrdude shows error messages, check the avrdude troubleshooting page.

To flash the hex file:

To figure out the fuse settings for other programmers, just input the above settings into the Engbedded AVR Fuse Calculator (http://www.engbedded.com/fusecalc). Remember that a 0 in the fuse bit registers means the fuse is enabled!

Flashing the Atmel 328p (SB-Controller) firmware

/!\ Attention: This Atmel is running at 3.3V! If you use a SerCon, you need one with a MAX3232 or a resistor-divider in order to access the shell on the SB-Controller! Also be aware that you need a ISP Programmer with level-shifter to be able to programm the Atmel 328P without destroying it (e.g. the AVR-Dragon).

/!\ TODO: Add pics for ISP-Connector, Pinout

(Fuse settings to enable: SPIEN, BOOTSZ0, BOOTSZ1, BOOTRST, BODLEVEL0) This should correspond to the following settings:

Using AVRStudio and AVRISP MKII this corresponds to the following fuses: LOW=0xFF HIGH=0xDE EXTENDED=0xFE, but this may vary among different combinations of programmers and software

To set the Fuses using avrdude:

To flash the hex file:

After successful flashing of the 328's firmware LED2 should turn on (see Signals Page for Details). If it doesn't, check all voltages and if the fuses are correct (BOOTZ0 correctly programmed? Do NOT disable ISPEN fuse)

/!\ Note to Linux Debian users: avrdude support for the Atmel mega 328p is rather new. It is not included in the avrdude version shipped with Debian release Lenny. Use avrdude from Debian Squeeze instead.

To figure out the fuse settings for other programmers, just input the above settings into the Engbedded AVR Fuse Calculator (http://www.engbedded.com/fusecalc). Remember that a 0 in the fuse bit registers means the fuse is enabled!

Flashing the firmware on Windows

Software needed for flashing

The Windows version of avrdude is included in WinAVR which is available at http://sourceforge.net/projects/winavr/. Be sure to get a recent version that supports the Atmel 328p.

If you use a programmer that uses a USB connection to the PC, such as the AVR Dragon, you need to make sure that you have the correct driver installed:

Now you are ready to use avrdude. To try it out, open the command shell (e.g. by choosing Start -> Run... and entering cmd), and then you can simply enter "avrdude" to see its options, just like on Linux and OS X.

Getting the latest NG firmware release

See above Linux/OS X

Flashing the LPC-H2148 firmware

Flashing via UART/ISP

The LPC has a serial bootloader embedded, listening on X-UART1 (UART0 on the LPC2148). To enter bootloader mode, the Jumper JP-ISP above the BOOT button has to be in the 2-3 position (1-2 for pre 0.21 HW). Then power off your NG, hold down the BOOT button (Reset on pre 0.21 HW) on the FC and power up the NG again. Now connect a RS232 to 3.3V CMOS converter (see SerCon) from your PC to the NG's X-UART1, RXD and TXD crossed. The converter can be supplied with 3.3V or 5V from the NG via Pin 4. You have to set the JP-U1 Jumper accordingly.

/!\ If your converter is self-supplied, don't connect Pin 4 or pull the Jumper JP-U1 next to X-UART1! Pin 1 of X-UART1 is located next to R26 on the FC PCB (top view).
The NGcon and the MK-SerCon need 5V (set JP-U1 to position 2-3). The NGusb is self-supplied via USB.

X-UART1 Pinout X-UART1 Closeup

Now you can use the binary installer supplied with your NG release package:

Flashing via JTAG

See JTAG

Flashing via USB/IAP

The code has to be built with --enable-usb-bootloader and --enable-usb-bootloader-switch The ngos-usb-bl.hex has to be flashed with one of the methods described above. After that has been done, all further flashes can (and must) be done via

This should take only about 6 seconds! :-)

To enter the USB bootloader, the jumper JP-ISP has to be in 1-2 position (2-3 for pre 0.21 HW) and the BOOT button has to be pressed while turning on the device. Alternatively, if the shell is already available, instead of pressing any buttons on the FC one might simply enter "flash usb" at the shell.

Flashing the Atmel 644p (RC-Controller) firmware

Using avrdude, the steps are the same as described in the Flashing on Linux section. (To enter the commands, open the command shell in Windows, e.g. by choosing Start -> Run... and entering cmd)

Flashing the Atmel 328p (SB-Controller) firmware

Using avrdude, the steps are the same as described in the Flashing on Linux section. (To enter the commands, open the command shell in Windows, e.g. by choosing Start -> Run... and entering cmd)

Documentation/Flashing (last edited 2011-01-31 19:19:41 by Jeroen)