The Glitch
 All Files Pages
Loading Firmware



Loading Firmware


Firmware can be uploaded to The Glitch using the Glitch Loader command line utility. Glitch Loader can be found in the HostLoaderApp folder of the Resource Files.

In order for The Glitch bootloader to accept new firmware, the hardware must first be Reset. To reset it, plug in The Glitch while holding down the Reset Button or at any point while plugged into the computer. The Glitch will also be Reset whenever the RST pin is grounded. Resetting The Glitch will switch it from running any flashed firmware to a bootloader ready to accept loading new firmware.

Run Glitch Loader utility once The Glitch has been reset to upload the specified firmware. Follow the guide for running on Windows or Linux.

Note:
The glitch_loader must be executed with Root/Administrative privilages.

Glitch Loader

The Glitch Loader is a command line application which uploaded new firmware to The Glitch. It is based on the hid_bootloader_cli from the LUFA project. The application is portable and does not require "installation".

When The Glitch is Reset, the bootloader is placed in a state where it is ready to accept new firmware. The Glitch Loader looks for the bootloader in the state over USB and supplies the user defined firmware.

Parameters:
glitch_loader – Application to upload sketch
m [model] – Specify the model (glitch)
v – Verbose
w – Wait for device to be attached
[FILENAME].cpp.hex – Compiled sketch file


Linux

The Glitch Loader is run from the command line. Change directories to the extracted Glitch files.

Note:
The Glitch Loader must be executed with Root privilages from the command line.
# sudo ./glitch_loader -m glitch -v -w [FILENAME].cpp.hex
The Glitch Loader, Command Line, Version 2.0
Read "[FILENAME].cpp.hex": 31960 bytes, 24.4% usage
Found HalfKay Bootloader
Programming.............................................................................................................................
Booting


Windows

The Glitch Loader runs from the Command Prompt.

Go to

Start -> Run

Type

cmd

Hit ENTER.

Change directories to where The Glitch resources have been extracted.

cd "C:\PATH\TO\GLITCH\FILES\HostLoaderApp\windows\"

Now flash the firmware.

Note:
The Glitch Loader must be executed with Administrative privilages in a DOS prompt.
C:\PATH\TO\GLITCH\FILES\HostLoaderApp\windows> glitch_loader.exe -m glitch -v -w [FILENAME].cpp.hex



Upload Script

You can also use the upload.bat script to flash new firmware. This script allows you to skip a few steps.

Double click on upload.bat in the HostLoaderApp/Windows folder. Specify the full path to the firmware, or place firmware in same folder to make things simpler.

Model name (ex: glitch): glitch
New firmware (HEX file): Firmware.cpp.hex
...
Note:
Replace 'Firmware.cpp.hex' with the firmware file name.

Loading Errors

Some issues may occur with the your host operating system's handling of loading device drivers. This occurs most often when attempting to frequently reflash The Glitch in a short amount of time. If you experience errors, try the following:

The Glitch Loader, Command Line, Version 2.0
Read "KeyMe.cpp.hex": 31960 bytes, 24.4% usage
Found HalfKay Bootloader
Programming..........................error writing to The Glitch


1) Wait a few seconds for the upload process to begin.

It may take some time for the drivers to load and the hardware be recognized by the operating system.

2) Change user permission

Some operating systems require administrative/root level access.

3) Press the Reset button before running the upload software.

This prevents the firmware on The Glitch from running.

4) Unplug The Glitch and plug it back in while holding the Reset button.

This is the equivalent to 'turn it off, and turn it on again'

5) Unmount/Safely Remove the hardware before plugging it in again.

This will allows the operating system to load the drivers again

6) Wait a minute between uploading firmware.

Some operating systems take a little time to load and unload device drivers. This will allows the operating system to load the drivers again

7) Attempt using a different USB port.

Some operating systems have issues with unloading device drivers from a USB port. Trying a different port or restarting the operating system often fixes this issue.