Skip to content

Flashing an Arduino bootloader on Totumduino (via ICSP)

Alessio Cavalieri edited this page Oct 15, 2018 · 37 revisions

Objective

This guide is focused to upgrading Totumduino v1 at FABlin firmware 1.1.0.2, after installing Colibri i was not able to communicate with the Totumduino and also i was not able to upgrade to a newer firmware, so i've decided to try to reinstall the Arduino bootloader using ICSP method.

Tested with Raspberry Pi 1 and 3, with success.

Disclaimer

If you connect something wrong, you can fry your Totumduino. The author of this wiki (Alessio Cavalieri) assumes no responsibility for any damage caused by the failure of the procedure, and consequent damages to things and persons, FLASH AT YOUR OWN RISK!

If you not disconnect the fans (as explained in steps 3 and 4) the flashing may fail because the PC must feed the Totumduino and also the fans.

If you not reconect the fans (as exaplained in steps 13 and 14) you risk to fry the Allegro A4988 stepper drivers due to overheat.

Double check all disconnections / reconnections.

Overview video

YouTube Video

Prerequisites

Hardware:

  • USBASP programmer (official web site: http://www.fischl.de/usbasp/ ), on Linux and Mac it works out of the box, in Windows require a driver, refer to the offical web site for installation - it cost 1 to 5€
  • ATMEL ICSP adapter from 10 to 6 pin (called also USBASP 10 to 6 Pin Adapter ISP 51 for ATMEL AVR USB Programmer for Arduino) - it cost 1 to 3€, generally in bundle with an USBASP it's cheap

Software:

  • avrdude installed on your PC (official web site: http://www.nongnu.org/avrdude/ ) - in this guide i use it on Ubuntu 16.04 operating system, you can easily install avrdude on Ubuntu via command line with
# sudo apt-get install avrdude

Other:

  • an internet connection for downloading the bootloader from Arduino official Github repository

Process

  1. Poweroff the FABtotum via FABui
  2. Turn off the power switch and disconnect the mains cable
  3. Remove the Raspberry Pi, disconnect the Raspi connector from Totumduino connector
  4. Disconnect the Totumduino cooling fan (big fan)
  5. Disconnect the electronic vane fan (small fan)
  6. Connect the USBASP ICSP programmer to the ICSP port on the Totumduino !!! WARNING RESPECT DIRECTION !!! the pin 1 of the programmer must correspond to pin 1 of the totumduino (click to on image to get larger version)

Connnect USBASP to Totumduino, 1

Connnect USBASP to Totumduino, 2

Connnect USBASP to Totumduino, 3

  1. connect the USBASP to a USB port of a PC, the Totumduino will beep, it will be powered via USBASP
  2. make a backup of the actual firmware of the Totumduino
# mkdir flash_totumduino
# cd flash_totumduino
# sudo avrdude -p m1280 -cusbasp -v -U flash:r:original_flash.hex:i

This commands make a copy of the flash of the Totumduino in the file original_flash.hex

  1. download from Arduino's Github official repository the official Arduino bootloader for the Atmel atMega1280 microcontroller
# wget https://raw.githubusercontent.com/arduino/Arduino/master/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega1280.hex
  1. flash the original bootloader on the Totumduino
# sudo avrdude -c usbasp -p m1280 -U flash:w:ATmegaBOOT_168_atmega1280.hex
  1. If all goes ok, a green led on the Totumduino will flash (this is the standard Arduino blink sketch behaviour)
  2. Disconnect the USBASP from the USB port of a PC
  3. Disconnect the USBASP ICSP programmer from the ICSP port on the Totumduino
  4. Reconnect the electronic vane fan (small fan)
  5. !!! VERY IMPORTANT!!! reconnect the Totumduino cooling fan (big fan) !!! This fan cool the Allegro A4988 stepper motor drivers !!!
  6. Reconnect the Raspberry Pi
  7. Power on the Fabtotum
  8. Wait 2 minutes, no ambilight are powered on (alone in the dark) and no beeps because there is no firmware on Totumduino.
  9. Connect to the FABui web interface
  10. Go on Maintenance -> Firmware -> Firmware 1.1.0.2 (Download) -> click on Flash Firmware blue button
  11. If all goes right, you can enjoy the latest software upgrades on a V0 FABtotum

P.s.: The USBASP programmer is a my old friend :) https://itink.it/wiki/doku.php?id=en:tinkering:microcontrollers:miniusbdiggerjoystick

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.