Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"node": ">=20.11.0"
},
"dependencies": {
"@commaai/qdl": "git+https://github.com/commaai/qdl.js.git#52021f0b1ace58673ebca1fae740f6900ebff707",
"@commaai/qdl": "git+https://github.com/commaai/qdl.js.git#9ef437bed19a70fe54f44421ae5fc9a057b4b563",
"@fontsource-variable/inter": "^5.2.5",
"@fontsource-variable/jetbrains-mono": "^5.2.5",
"react": "^18.3.1",
Expand Down
Binary file modified src/QDL/programmer.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion src/app/Flash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default function Flash() {
.then((res) => res.arrayBuffer())
.then((programmer) => {
// Create QDL manager with callbacks that update React state
qdlManager.current = new FlashManager(config.manifests.release, programmer, {
qdlManager.current = new FlashManager(programmer, {
onStepChange: setStep,
onMessageChange: setMessage,
onProgressChange: setProgress,
Expand Down
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const config = {
manifests: {
release: 'https://raw.githubusercontent.com/commaai/openpilot/927548621be1be0c2c9063868b93d1f5020904de/system/hardware/tici/all-partitions.json',
release_tizi: 'https://raw.githubusercontent.com/commaai/openpilot/927548621be1be0c2c9063868b93d1f5020904de/system/hardware/tici/all-partitions.json',
release_tici: 'https://raw.githubusercontent.com/commaai/openpilot/927548621be1be0c2c9063868b93d1f5020904de/system/hardware/tici/all-partitions.json',
master: 'https://raw.githubusercontent.com/commaai/openpilot/master/system/hardware/tici/all-partitions.json',
},
loader: {
Expand Down
49 changes: 32 additions & 17 deletions src/utils/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { qdlDevice } from '@commaai/qdl'
import { usbClass } from '@commaai/qdl/usblib'

import { getManifest } from './manifest'
import config from '../config'
import { createSteps, withProgress } from './progress'

export const StepCode = {
Expand Down Expand Up @@ -95,8 +96,8 @@ export class FlashManager {
* @param {ArrayBuffer} programmer
* @param {FlashManagerCallbacks} callbacks
*/
constructor(manifestUrl, programmer, callbacks = {}) {
this.manifestUrl = manifestUrl
constructor(programmer, callbacks = {}) {
this.manifestUrl = null
this.callbacks = callbacks
this.device = new qdlDevice(programmer)
/** @type {import('./image').ImageManager|null} */
Expand Down Expand Up @@ -189,21 +190,6 @@ export class FlashManager {
return
}

if (!this.manifest?.length) {
try {
this.manifest = await getManifest(this.manifestUrl)
if (this.manifest.length === 0) {
throw new Error('Manifest is empty')
}
} catch (err) {
console.error('[Flash] Failed to fetch manifest')
console.error(err)
this.#setError(ErrorCode.UNKNOWN)
return
}
console.info('[Flash] Loaded manifest', this.manifest)
}

this.#setStep(StepCode.READY)
}

Expand Down Expand Up @@ -233,6 +219,35 @@ export class FlashManager {
console.info('[Flash] Connected')
this.#setConnected(true)

try {
const deviceType = await this.device.getDeviceType()
if (deviceType == 32) {
this.manifestUrl = config.manifests.release_tici
} else {
this.manifestUrl = config.manifests.release_tizi
}

try {
this.manifest = await getManifest(this.manifestUrl)
if (this.manifest.length === 0) {
throw new Error('Manifest is empty')
}
} catch (err) {
console.error('[Flash] Failed to fetch manifest')
console.error(err)
this.#setConnected(false)
this.#setError(ErrorCode.UNKNOWN)
return
}
console.info('[Flash] Loaded manifest', this.manifest)

} catch (err) {
console.error('[Flash] Connection lost', err)
this.#setError(ErrorCode.LOST_CONNECTION)
this.#setConnected(false)
return
}

let storageInfo
try {
storageInfo = await this.device.getStorageInfo()
Expand Down