Addendums to C3 C3X Flashing - commaai/openpilot GitHub Wiki

This is a document of addenums to https://flash.comma.ai and https://github.com/commaai/agnos, which are tools to reflash C3s and C3Xs that have weird issues or can't start the screen.

This post is currently being developed in Discord in this thread: https://discord.com/channels/469524606043160576/1138960979384881212 . If something here doesn't work, hit up that thread.

These additional instructions are very much a work in progress. They may eventually be merged into the documentations of the web flasher and the repository. The addendums are here because people are running into this situation, need help now, and might not be able to wait.

Open Pull requests: https://github.com/commaai/flash/pulls

What a can't start screen C3/C3X looks like

https://github.com/commaai/openpilot/assets/5363/597e960a-bb42-4c53-aec2-4fca496ab34b

Courtesy of marsh#0820 on Discord.

If you see half a comma before it goes black, this is it. If you don't see anything at all on the screen, and the status LED is blinking blue this is also it. This particular failure is usually caused by installing an old fork with an old OS on the last generations of C3 and the C3X.

If you're going through this process to repair a screen bricked C3/C3X, make note of the Misc Notes

Visual Demonstration of plugging in the cables in the right order and how fast you should do It

The instructions in the web flasher and the repository say to "plug it in fast", but what does that mean or look like? Here's a video demonstration of what that means.

https://youtu.be/gNnRmEyVSVQ?t=200

Obviously, if your screen is busted, you can't confirm it on the device. The instructions below provide some hints on what it looks like on the attached workstation if you got this action done right.

Video Notes

The video is a bit old and some of it can be outdated.

  • The full video was produced before the web flasher's availability; use it for guidance on cable plug-in order.
  • You cannot cheat and have port 2 plugged in before power to port 1. It must be plugged in after port 1 quickly.
  • If your battery/charger/cable/setup powers up your C3 on port 1, you're good. A USB-A to USB-C setup has a higher chance to work than a USB-C to USB-C setup but if you have a working USB-C to USB-C setup working anyway on port 1 powering, you're good. Port 2 can be C to C as well.
  • The video does not go into the scenario where fastboot doesn't show up on the screen as that scenario had not yet been encountered.
    • It does not include the step to unplug power and plug back in power after flashing a screen bricked C3/C3X.

I only see one port on my C3/C3X!

Flashing requires two cables and ports. Port 1 is power. Port 2 is data.

Port 2 is underneath a rubber stopper below Port 1. Pull it out. Your fingers may be unsuitable for the task so you might need a tweezer.

IMG_6282

Flashing Choices and Recommendations

The quick summary is that the instructions above put your device in "fastboot" mode. If you have a problem with the OS, or even if the screen is not working, you can still flash it.

The web flasher is great as it's easy to use and works on all platforms. However, it is inherently a more opaque tech stack, can error out and need multiple attempts, and may not work in all situations. The non-web flasher or AGNOS repository option is a quite a bit more involved for setup and installation has a longer track record, but is quite down the list for the painful setup and installation issue; also, the AGNOS flasher's historical track record is quickly being overtaken by the web flasher's record.

Workstation/Platform recommendations are in order of ease of use, setup, and observed reliability with the best being on top:

Cable Choices

Use the comma's provided right angle harness USB-C/OBD-C cable between your workstation/platform and the comma device's port 2. Use your cable just for power to the comma device to port 1.

Comma's cable is known to have all wires/pins necessary for trouble-free flashing. Your cable from "somewhere" might not but it'll usually at least provide power.

Web flasher

Use Chrome, Edge, or any other Chromium-based browser.

Choose the following platforms in order of ease of use and setup:

  • Mac
    • It just works. There are usually no driver or permissions issues.
    • Well, not exactly. If your Mac asks if you want to let the accessory connect or not in a notification, make sure to permit it.
    • If the screen on the C3X is dead, you can confirm if it's plugged in correctly by opening "System Information" and looking at USB. You should see a device similar to the screenshot below.
  • Android
    • Make sure you set the display timeout to 30 minutes and have enough battery on the Android phone or wireless charging to keep it going.
    • Select "Android" as the device when picking a device to flash at the flasher. This isn't the device you're flashing from, the C3/C3X itself is calling itself "Android".
    • Androids can come in many shapes and sizes unfortunately and their tendency for budget might be an issue. Known good and known bad:
      • Pixel 5, 8GB RAM
      • Pixel 6, 8GB RAM
      • Pixel 6A, 6GB RAM - needs two tries, may need a page refresh as it crashes from RAM exhaustion? Just try again and don't open other apps.
      • Galaxy Z Fold 3, 12GB RAM
      • Galaxy Z Fold 4, 12GB RAM
      • Galaxy Z Fold 5, 12GB RAM
      • Galaxy Z Flip5 5G, 8GB RAM
      • Pixel 7, 8GB RAM
      • Asus Zenfone 9 - Unknown RAM
      • Asus Zenfone 9 - 8GB+
      • Galaxy S10 - Unknown RAM, 6GB+
      • Galaxy S22 - 8GB RAM - A user with a heavy number of apps running had crashing issues on the flasher's unpacking step. Killing apps and setting processor performance to maximum allowed completion.
      • Galaxy S23u - 8GB RAM
      • OnePlus 8 - 8GB RAM
      • Failed with "samsung budget tab" - who knows, probably low ram amount
      • Failed with "samsung galaxy a32 5g" - this thing only has 4GB of RAM
    • Some Android devices even with 6GB or 8GB of RAM may still fail to flash. Symptoms of this can include Chrome crashing at the unpacking step. In this situation, try quitting/force quitting other apps/services, setting processor performance to maximum, increasing virtual memory, or any other adjustments on your Android device you can make to free up RAM.
  • ChromeOS
    • Unknown on how to confirm if plugged in correctly. TODO: Some about://chrome pages?
  • Windows
    • You will need to install Zadig to install the driver for the "fastboot" mode of the device. It is important to "pre-install" the driver before you plug anything in so it can boot and stay in "fastboot" mode once you plug it in like in the video above.
      • Run Zadig.
      • Under Device in the menu bar, select "Create New Device"
        • image
      • Fill in three fields. The first field is just a description and you can fill in anything. In the example image, I've put in "C3 Fastboot". The next two fields are very important. Fill them in with 18D1 and D00D respectively. Press "Install Driver" and give it a few minutes to install.
        • image2
      • Once you plug your device in following the demonstration video and instructions above, you should see this in device manager:
        • image
        • This is one way to visually confirm it is plugged in correctly if the screen is broken.
  • Linux
    • There may be permission issues. It's extremely hard to describe universal and necessary steps to fix this. You may want to try running your web browser as root to get around this. If you want something more surgical, look at the product and device IDs above and google WebUSB Chrome Linux. If you are not familiar with Linux, you may want to try the repository option instead.
    • You can confirm fastboot by running lsusb and seeing if it has similar product and vendor IDs to the above.

Once you have the workstation setup, simply visit the web flasher and follow the instructions. Sometimes it may fail, and you may need to try again. Try to not disturb your C3/C3X and workstation while this is all happening.

AGNOS Repository

This option requires running commands in a terminal. It is more involved, but it is a good alternative if the web flasher doesn't work. It also has existed longer than the web flasher.

The requirement for your computer to see the device in "fastboot" mode is still present. See the Web Flasher instructions above as a reference on how to make sure that is the case.

You are to copy all of the files of the repository down to a folder. Here's a link to make it simple:

https://github.com/commaai/agnos/archive/refs/heads/master.zip

Python does not come pre-installed on any of the platforms. You will need to install it. Install any of the offerings from https://python.org for your platform. If Linux, install it from your package manager.

For all platforms, running python download.py is a usable instruction to run the script.

You can run the shell scripts with ./flash.sh on Linux and Mac. On Windows, you can do .\flash.ps1 in PowerShell (You may have an error saying you can't run unsigned scripts; Google that and fix it).

Misc Notes

  • When after a successful flash to try to resolve a screen bricked c3x, the screen will still be black. Unplug everything, let it drain, and then provide power again.
    • PXL_20230812_000600254
    • PXL_20230812_000759374
  • Comma says there is a known bug with USB 3 to kick something to fastboot and stay in fastboot. If you use a USB 2.0 cable, or put a USB 2.0 hub in between to make it USB 2.0, you may have a better chance of success.
  • Flashing using Chrome on Android device - what may happen: "Comma device shows up as android, I click connect. It says connect to Chrome, I click OK. Then I'm back at the green flash button. I click it, then it brings up the device list again, but now it says no compatible devices."
    • In this case try swapping cables. Use Comma's cable for flashing and the unofficial or worse cable for the power.
  • If you can't get into Fastboot, try to also make Port 1 USB-A to C with a high amperage charger.