forked from commaai/flash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
529 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ jobs: | |
|
||
- run: bun install | ||
- run: bun lint | ||
- run: bun vitest | ||
- run: bun test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,206 @@ | |
content="Update your comma device to the latest software" | ||
/> | ||
<title>flash.comma.ai</title> | ||
<link href="https://cdn.jsdelivr.net/npm/@fontsource-variable/[email protected]/index.min.css" rel="stylesheet"> | ||
<link href="https://cdn.jsdelivr.net/npm/@fontsource-variable/[email protected]/index.min.css" rel="stylesheet"> | ||
<script src="https://cdn.tailwindcss.com?plugins=typography"></script> | ||
<script> | ||
tailwind.config = { | ||
theme: { | ||
extend: { | ||
backgroundImage: { | ||
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', | ||
'gradient-conic': | ||
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', | ||
}, | ||
fontFamily: { | ||
sans: ['Inter Variable', 'sans-serif'], | ||
monospace: ['JetBrains Mono Variable', 'monospace'], | ||
}, | ||
} | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
<div class="flex flex-col lg:flex-row flex-wrap"> | ||
<main class="p-12 md:p-16 lg:p-20 xl:p-24 w-screen max-w-none lg:max-w-prose lg:w-auto h-auto lg:h-screen lg:overflow-y-auto prose dark:prose-invert prose-green bg-white dark:bg-gray-900"> | ||
<section> | ||
<img src="src/assets/comma.svg" alt="comma" width="128" height="128" class="dark:invert" /> | ||
<h1>flash.comma.ai</h1> | ||
<p>This tool allows you to flash AGNOS onto your comma device.</p> | ||
<p> | ||
AGNOS is the Ubuntu-based operating system for your | ||
<a href="https://comma.ai/shop/comma-3x" target="_blank">comma 3/3X</a>. | ||
</p> | ||
</section> | ||
<hr /> | ||
|
||
<section> | ||
<h2>Requirements</h2> | ||
<ul> | ||
<li> | ||
A web browser which supports WebUSB (such as Google Chrome, Microsoft Edge, Opera), running on Windows, macOS, Linux, or Android. | ||
</li> | ||
<li> | ||
A USB-C cable to power your device outside the car. | ||
</li> | ||
<li> | ||
Another USB-C cable to connect the device to your computer. | ||
</li> | ||
</ul> | ||
<h3>USB Driver</h3> | ||
<p> | ||
You need additional driver software for Windows before you connect | ||
your device. | ||
</p> | ||
<ol> | ||
<li> | ||
Download and install <a href="https://zadig.akeo.ie/">Zadig</a>. | ||
</li> | ||
<li> | ||
Under <code>Device</code> in the menu bar, select <code>Create New Device</code>. | ||
<img | ||
src="src/assets/zadig_create_new_device.png" | ||
alt="Zadig Create New Device" | ||
width="575" | ||
height="254" | ||
/> | ||
</li> | ||
<li> | ||
Fill in three fields. The first field is just a description and | ||
you can fill in anything. The next two fields are very important. | ||
Fill them in with <code>05C6</code> and <code>9008</code> respectively. | ||
Press "Install Driver" and give it a few minutes to install. | ||
<img | ||
src="src/assets/zadig_form.png" | ||
alt="Zadig Form" | ||
width="575" | ||
height="254" | ||
/> | ||
</li> | ||
</ol> | ||
<p> | ||
No additional software is required for macOS or Linux. | ||
</p> | ||
</section> | ||
<hr /> | ||
|
||
<section> | ||
<h2>QDL Mode</h2> | ||
<p>Follow these steps to put your device into QDL mode:</p> | ||
<ol> | ||
<li>Power off the device and wait for the LEDs to switch off.</li> | ||
<li>Connect the device to your computer using the USB-C port <strong>(port 2)</strong>.</li> | ||
<li>Connect power to the OBD-C port <strong>(port 1)</strong>.</li> | ||
<li>The device then should be visible as an option when choosing the device to flash</li> | ||
</ol> | ||
<img | ||
src="src/assets/fastboot-ports.svg" | ||
alt="image showing comma three and two ports. the upper port is labeled 1. the lower port is labeled 2." | ||
width="450" | ||
height="300" | ||
/> | ||
</section> | ||
<hr /> | ||
|
||
<section> | ||
<h2>Flashing</h2> | ||
<p> | ||
After your device is in QDL mode, you can click the button to start flashing. A prompt may appear to | ||
select a device; choose the device starts with <code>QUSB_BULK</code>. | ||
</p> | ||
<p> | ||
The process can take 30+ minutes depending on your internet connection and system performance. Do not | ||
unplug the device until all steps are complete. | ||
</p> | ||
</section> | ||
<hr /> | ||
|
||
<section> | ||
<h2>Troubleshooting</h2> | ||
<h3>Too slow</h3> | ||
<p> | ||
It is recommended that you use a USB 3.0 cable when flashing since it will speed up the flashing time by a lot. | ||
</p> | ||
<h3>Cannot enter QDL</h3> | ||
<p> | ||
Try using a different USB cable or USB port. Sometimes USB 2.0 ports work better than USB 3.0 (blue) ports. | ||
If you're using a USB hub, try connecting the device directly to your computer, or alternatively use a | ||
USB hub between your computer and the device. | ||
</p> | ||
<h3>My device's screen is blank</h3> | ||
<p> | ||
The device screen will be blank in QDL mode, but you can verify that it is in QDL if the device shows up | ||
when you press the Flash icon. | ||
</p> | ||
<h3>After flashing, device says unable to mount data partition</h3> | ||
<p> | ||
This is expected after the filesystem is erased. Press confirm to finish resetting your device. | ||
</p> | ||
<h3>General Tips</h3> | ||
<ul> | ||
<li>Try another computer or OS</li> | ||
<li>Try different USB ports on your computer</li> | ||
<li>Try different USB-C cables, including the OBD-C cable that came with the device</li> | ||
</ul> | ||
<h3>Other questions</h3> | ||
<p> | ||
If you need help, join our <a href="https://discord.comma.ai" target="_blank">Discord server</a> and go to | ||
the <strong>#hw-three-3x</strong> channel. | ||
</p> | ||
</section> | ||
|
||
<div class="hidden lg:block"> | ||
<hr /> | ||
flash.comma.ai version: <code>dev</code> | ||
</div> | ||
</main> | ||
|
||
<div id="root" class="lg:flex-1 h-[700px] lg:h-screen bg-gray-100 dark:bg-gray-800"> | ||
<p class="text-black dark:text-white">Loading...</p> | ||
</div> | ||
|
||
<div class="w-screen max-w-none p-12 md:p-16 prose dark:prose-invert bg-white dark:bg-gray-900 lg:hidden"> | ||
flash.comma.ai version: <code>dev</code> | ||
</div> | ||
</div> | ||
|
||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"react": "https://cdn.jsdelivr.net/npm/[email protected]/+esm", | ||
"react-dom": "https://cdn.jsdelivr.net/npm/[email protected]/+esm", | ||
"comlink": "https://cdn.jsdelivr.net/npm/[email protected]/+esm", | ||
"crc-32": "https://cdn.jsdelivr.net/npm/[email protected]/+esm", | ||
"jssha": "https://cdn.jsdelivr.net/npm/[email protected]/+esm", | ||
"xz-decompress": "https://cdn.jsdelivr.net/npm/[email protected]/+esm" | ||
} | ||
} | ||
</script> | ||
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/[email protected]/+esm" /> | ||
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/[email protected]/+esm" /> | ||
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/[email protected]/+esm" /> | ||
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/[email protected]/+esm" /> | ||
<link rel="modulepreload" href="/src/app/Flash.js" /> | ||
<link rel="modulepreload" href="/src/config.js" /> | ||
<link rel="modulepreload" href="/src/QDL/utils.js" /> | ||
<link rel="modulepreload" href="/src/QDL/qdl.js" /> | ||
<link rel="modulepreload" href="/src/QDL/gpt.js" /> | ||
<link rel="modulepreload" href="/src/QDL/usblib.js" /> | ||
<link rel="modulepreload" href="/src/QDL/sahara.js" /> | ||
<link rel="modulepreload" href="/src/QDL/firehose.js" /> | ||
<link rel="modulepreload" href="/src/QDL/saharaDefs.js" /> | ||
<link rel="modulepreload" href="/src/QDL/xmlParser.js" /> | ||
<link rel="modulepreload" href="/src/QDL/sparse.js" /> | ||
<link rel="modulepreload" href="/src/utils/flash.js" /> | ||
<link rel="modulepreload" href="/src/utils/blob.js" /> | ||
<link rel="modulepreload" href="/src/utils/image.js" /> | ||
<link rel="modulepreload" href="/src/utils/manifest.js" /> | ||
<link rel="modulepreload" href="/src/utils/progress.js" /> | ||
<link rel="modulepreload" href="/src/workers/image.worker.js" /> | ||
|
||
<script type="module" src="/src/main.js"></script> | ||
<script | ||
defer | ||
data-domain="flash.comma.ai" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,22 @@ | ||
{ | ||
"name": "@commaai/flash", | ||
"version": "0.1.0", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"start": "vite preview", | ||
"lint": "eslint . --ext js,jsx --report-unused-disable-directives", | ||
"test": "vitest" | ||
"devDependencies": { | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-react": "^7.34.2", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-react-refresh": "^0.4.7" | ||
}, | ||
"engines": { | ||
"node": ">=20.11.0" | ||
}, | ||
"dependencies": { | ||
"@fontsource-variable/inter": "^5.0.18", | ||
"@fontsource-variable/jetbrains-mono": "^5.0.21", | ||
"comlink": "^4.4.1", | ||
"crc-32": "^1.2.2", | ||
"jssha": "^3.3.1", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"xz-decompress": "^0.2.1" | ||
"private": true, | ||
"scripts": { | ||
"dev": "python3 -m http.server 5173", | ||
"build": "echo \"Error: no build specified\" && exit 0", | ||
"start": "python3 -m http.server 5173", | ||
"lint": "echo \"Error: no lint confugured\" && exit 0", | ||
"test": "echo \"Error: no test confugured\" && exit 0" | ||
}, | ||
"devDependencies": { | ||
"@tailwindcss/typography": "^0.5.13", | ||
"@testing-library/jest-dom": "^6.4.5", | ||
"@testing-library/react": "^15.0.7", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@vitejs/plugin-react": "^4.3.0", | ||
"autoprefixer": "10.4.14", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-react": "^7.34.2", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-react-refresh": "^0.4.7", | ||
"jsdom": "^22.1.0", | ||
"postcss": "^8.4.38", | ||
"tailwindcss": "^3.4.3", | ||
"vite": "^5.2.12", | ||
"vite-svg-loader": "^5.1.0", | ||
"vitest": "^1.6.0" | ||
} | ||
"type": "module" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { structHelper_io } from "./utils" | ||
import { structHelper_io } from "./utils.js" | ||
|
||
|
||
export const cmd_t = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.