File tree Expand file tree Collapse file tree 4 files changed +40
-2
lines changed
Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: MIT
2+ // Copyright (c) 2025-2026 The Pybricks Authors
3+
4+ import { Intent } from '@blueprintjs/core' ;
5+ import { Error } from '@blueprintjs/icons' ;
6+ import React from 'react' ;
7+ import type { CreateToast } from '../../toasterTypes' ;
8+ import { useI18n } from './i18n' ;
9+
10+ const UnsupportedDfuHub : React . FunctionComponent = ( ) => {
11+ const i18n = useI18n ( ) ;
12+ return (
13+ < >
14+ < p > { i18n . translate ( 'unsupportedDfuHub.message' ) } </ p >
15+ </ >
16+ ) ;
17+ } ;
18+
19+ export const unsupportedDfuHub : CreateToast = ( onAction ) => ( {
20+ message : < UnsupportedDfuHub /> ,
21+ icon : < Error /> ,
22+ intent : Intent . DANGER ,
23+ onDismiss : ( ) => onAction ( 'dismiss' ) ,
24+ } ) ;
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT
2- // Copyright (c) 2022-2025 The Pybricks Authors
2+ // Copyright (c) 2022-2026 The Pybricks Authors
33
44import { dfuError } from './DfuError' ;
55import { flashProgress } from './FlashProgress' ;
@@ -8,6 +8,7 @@ import { noDfuInterface } from './NoDfuInterface';
88import { noWebHid } from './NoWebHid' ;
99import { noWebUsb } from './NoWebUsb' ;
1010import { releaseButton } from './ReleaseButton' ;
11+ import { unsupportedDfuHub } from './UnsupportedDfuHub' ;
1112
1213export default {
1314 dfuError,
@@ -17,4 +18,5 @@ export default {
1718 noWebHid,
1819 noWebUsb,
1920 releaseButton,
21+ unsupportedDfuHub,
2022} ;
Original file line number Diff line number Diff line change 2222 "installUsbDriverButton" : " Install USB Driver" ,
2323 "configureUdevRulesButton" : " Configure udev rules"
2424 },
25+ "unsupportedDfuHub" : {
26+ "message" : " This hub has different internal electronics and requires a different firmware. Pybricks does not support this yet. We are working on it!"
27+ },
2528 "noDfuInterface" : {
2629 "message" : " This is very unusual. The USB device did not contain the expected interface."
2730 },
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT
2- // Copyright (c) 2020-2025 The Pybricks Authors
2+ // Copyright (c) 2020-2026 The Pybricks Authors
33
44import {
55 FirmwareReader ,
@@ -754,6 +754,15 @@ function* handleFlashUsbDfu(action: ReturnType<typeof firmwareFlashUsbDfu>): Gen
754754 return ;
755755 }
756756
757+ if (
758+ device . productId === LegoUsbProductId . SpikePrimeBootloader &&
759+ device . deviceVersionMajor !== 1
760+ ) {
761+ yield * put ( alertsShowAlert ( 'firmware' , 'unsupportedDfuHub' ) ) ;
762+ yield * put ( firmwareDidFailToFlashUsbDfu ( ) ) ;
763+ return ;
764+ }
765+
757766 const dfu = new WebDFU (
758767 device ,
759768 // forceInterfacesName is needed to get the flash layout map
You can’t perform that action at this time.
0 commit comments