Image for post
Image for post

Comma Pedal: Flashing the Firmware

jfrux
jfrux
May 10, 2018 · 4 min read

So you just received your Comma Pedal from MacroFab or manufactured it yourself, but have no idea what to do next… well the next step is to get this board in DFU Mode that allows us to flash it with firmware. It’s presently an empty computer with nothing on it. Think of this like installing software on a computer. Right now it doesn’t even have an “operating system” so to speak.

Requirements

  • A solid understanding of Terminal, Unix-based environments, Git / GitHub, compiling and installing dependencies, etc. is required for this article. If you don’t feel confident in these things, I’d find your closest computer programming nerd-friend to help.
  • This article assumes you’re running Ubuntu Linux, but most of these instructions should apply in other environments too if you‘re so inclined.
  • This article also assumes you already have Git installed. Please ensure those things before proceeding.

DISCLAIMER: This is not to be considered official documentation on the Comma Pedal. This is not an official work of Comma, Inc. and is unaffiliated with their company and platform. Proceed at your own risk. Comma, Inc. nor myself warrants this to any degree. Always keep your hands on the wheel and eyes on the road.

Getting Started

Cloning the Panda code repository & install dependencies

$ git clone https://github.com/commaai/panda.git
$ cd panda/board/
$ ./get_sdk.sh
$ cd ../
$ sudo pip install .
$ pip install pandacan
$ sudo apt-get install dfu-util

Entering DFU Mode on the Pedal Board

There are apparently two ways to enter DFU Mode on this board… one involves having a Panda Paw from https://shop.comma.ai/ and the other is applying voltage to the board itself until it enters the bootloader.
This article will be covering the voltage method.

Image for post
Image for post

Confirm that your Comma Pedal is connected to your computer by running

$ sudo dfu-util -l

Output of this command should look something like this:

dfu-util 0.8

0483:df11is the signature for the Comma Pedal so this is correct.

Moving on…

Transferring firmware to the board

Now that your board is in DFU Mode, and dependencies are installed, you SHOULD be able to transfer the firmware to the board.

$ cd panda/board/pedal
$ sudo make recover

The result of this command should look similar to below…

../../tests/pedal/enter_canloader.py --recover; sleep 0.5
Traceback (most recent call last):
File "../../tests/pedal/enter_canloader.py", line 55, in <module>
p = Panda()
File "/usr/local/lib/python2.7/dist-packages/panda/__init__.py", line 127, in __init__
self.connect(claim)
File "/usr/local/lib/python2.7/dist-packages/panda/__init__.py", line 171, in connect
assert(self._handle != None)
AssertionError
"dfu-util" -d 0483:df11 -a 0 -s 0x08004000 -D obj/comma.bin
dfu-util 0.8

I believe you can ignore the error in this as well as the Invalid DFU suffix signature warnings.

When you’re finished you should be seeing a flashing green LED if your board has this.

Image for post
Image for post
If Successful, the Pedal LED should be flashing Green.

You may now unplug the pedal from USB.

Enjoy!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store