The Speeduino firmware is the code that powers the hardware and must be installed onto your board prior to using the ECU. New firmware releases are made regularly (Approximately every 2 months) that bring new features, bug fixes and performance improvements so staying up to date is highly recommended.
With the goal of maximum simplicity in mind, the process of compiling and installing the firmware is reasonably straightforward. Most users will use the SpeedyLoader method for installing the firmware
The simplest (and recommended) method of installing the Speeduino firmware onto a standard Arduino Mega 2560 is with the SpeedyLoader utility. SpeedyLoader takes care of downloading the firmware and installing it onto an Arduino without the need to manually compile any of the code yourself. You can choose the newest firmware that has been released, or select from one of the older ones if preferred. SpeedyLoader will also download the INI file and optionally a base tune for the firmware you choose so it can be loaded into your TunerStudio project.
sudo apt-get install libusb-1.0-0 libusb-0.1-4:i386
sudo apt-get install libusb-1.0-0 libusb-0.1-4
Once the firmware is installed on the board, see Connecting to TunerStudio for more details on how to configure TunerStudio
Note that manually compiling the firmware is NOT required to install Speeduino, the easiest (and recommended for most users) method is using SpeedyLoader as described above.
If you want to compile the firmware yourself, or make any code changes, then the source of both the releases and the current development version is freely available.
There are two methods for obtaining the Speeduino firmware:
At this point you should have a compiled firmware! If you experienced a problem during the compile, see the Troubleshooting section below.
This video walks through the whole process of installing the firmware on your Arduino from scratch:
There is an option available for changing the compiler optimization level, which can improve . By default, the IDE uses the -Os compile option, which focuses on producing small binaries. As the size of the Speeduino code is not an issue but speed is a consideration, changing this to -O3 produces better results (Approximately 20% faster, with a 40% larger sketch size) To do this, you need to edit the platform.txt file:
Note: This is NOT required if using PlatformIO, the above optimisation is applied automatically there
Once you've successfully compiled the firmware, installation on the board is trivial.
Most official boards and many non-official versions use the ATMega16U2 or 8U2, whereas many of the Mega2560 clone boards utilize the CH340G IC. Both types work well. The serial chips can generally be identified by appearance:
If required, older firmware releases and details can be found at Firmware_History
The firmware is now loaded onto your board and you are now able to move onto Connecting to TunerStudio.
Optionally, you may perform a manual verification of the firmware by using the Arduino IDE's Serial Monitor. This can be started by selecting 'Serial Monitor' from the Tools menu.
In the window that appears, enter a capital "S" (no quotes) and press Enter. The Mega should respond with the year and month of the code version installed (xxxx.xx):
NOTE: Ensure the baud rate is set to 115200
You can also enter "?" for a list of queries from your Mega.
If you see the following (or similar) errors when trying to compile the firmware and the solutions:
scheduler.ino:317:7: error: ‘OCR4A’ was not declared in this scope scheduler.ino:323:8: error: ‘TIMSK5’ was not declared in this scope scheduler.ino:323:25: error: ‘OCIE4A’ was not declared in this scope
You may have the wrong kind of Arduino board selected. Set the board type by selecting Tools > Board > Arduino Mega 2560 or Mega ADK
The following can occur if you have only opened the speeduino.ino file rather than the whole project.
speeduino.ino:27:21: fatal error: globals.h: No such file or directory
Make sure all the files are contained within the same directory, then select File->Open and find the speeduino.ino file. If you have opened the project correctly, you should have multiple tabs along the top:
If you see only a single file or a small number of files then you haven't opened the entire project.