-
Notifications
You must be signed in to change notification settings - Fork 29
Feat/add write support for 91x #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a648911
d7fefa3
a718638
fb90771
c0c858b
a4c03eb
1fb399b
a669889
b051eeb
512cf6b
639d62f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| ## Unreleased | ||
|
|
||
| ### Added | ||
|
|
||
| - Write support for 91x | ||
|
|
||
| ## 4.5.0 - 2025-01-02 | ||
|
|
||
| ### Changed | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ The following table lists the hardware platforms that you can program with the { | |
| |---------------------|----------|------------|--------------------------|-------------------------------------|--------------------------| | ||
| | nRF9161 DK | nRF9161 | PCA10153 | Yes | No | No | | ||
| | nRF9160 DK | nRF9160 | PCA10090 | Yes | No | No | | ||
| | Nordic Thingy:91 X | nRF9151 | PCA20065 | ??? | ?? | ??? | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you need to rebase... There's an entry for Thingy X since long. |
||
| | Nordic Thingy:91 | nRF9160 | PCA20035 | Yes | No | Yes | | ||
| | nRF9151 DK | nRF9131 | PCA10171 | Yes | No | No | | ||
| | nRF9131 DK | nRF9131 | PCA10147 | Yes | No | No | | ||
|
|
@@ -50,4 +51,4 @@ The following hardware platforms cannot be programmed with the {{app_name}} anym | |
| ## Application source code | ||
|
|
||
| The code of the application is open source and [available on GitHub](https://github.com/NordicSemiconductor/pc-nrfconnect-programmer). | ||
| Feel free to fork the repository and clone it for secondary development or feature contributions. | ||
| Feel free to fork the repository and clone it for secondary development or feature contributions. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
| "nrfConnectForDesktop": { | ||
| "nrfutil": { | ||
| "device": [ | ||
| "2.6.4" | ||
| "2.8.6" | ||
| ] | ||
| }, | ||
| "html": "dist/index.html" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,13 +13,18 @@ import { | |
| classNames, | ||
| clearConfirmBeforeClose, | ||
| clearWaitForDevice, | ||
| convertToDropDownItems, | ||
| DialogButton, | ||
| Dropdown, | ||
| DropdownItem, | ||
| GenericDialog, | ||
| getPersistentStore, | ||
| getSelectedDropdownItem, | ||
| logger, | ||
| NumberInlineInput, | ||
| Overlay, | ||
| selectedDevice, | ||
| selectedDeviceInfo, | ||
| setWaitForDevice, | ||
| Slider, | ||
| Toggle, | ||
|
|
@@ -53,8 +58,19 @@ const McuUpdateDialogView = () => { | |
| const isVisible = useSelector(getShowMcuBootProgrammingDialog); | ||
| const mcubootFwPath = useSelector(getMcubootFilePath); | ||
| const zipFilePath = useSelector(getZipFilePath); | ||
| const deviceInfo = useSelector(selectedDeviceInfo); | ||
|
|
||
| const programmingOptions = | ||
| deviceInfo?.mcuStateOptions?.filter(s => s.type === 'Programming') ?? | ||
| []; | ||
|
|
||
| const targetDropdownItems = convertToDropDownItems( | ||
| programmingOptions.map(s => s.arguments?.target), | ||
| false | ||
| ); | ||
|
|
||
| const fwPath = mcubootFwPath || zipFilePath; | ||
| const [chosenTarget, setChosenTarget] = useState<string>(''); | ||
|
|
||
| const writingHasStarted = writing || writingFail || writingSucceed; | ||
|
|
||
|
|
@@ -108,6 +124,12 @@ const McuUpdateDialogView = () => { | |
| } | ||
| }, [device, showDelayTimeout]); | ||
|
|
||
| useEffect(() => { | ||
| if (targetDropdownItems.length > 0 && !chosenTarget) { | ||
| setChosenTarget(targetDropdownItems[0].value); | ||
| } | ||
| }, [chosenTarget, targetDropdownItems]); | ||
|
|
||
| const onCancel = () => { | ||
| dispatch(clearWaitForDevice()); | ||
| dispatch(setShowMcuBootProgrammingDialog(false)); | ||
|
|
@@ -129,6 +151,11 @@ const McuUpdateDialogView = () => { | |
| return; | ||
| } | ||
|
|
||
| if (programmingOptions.length > 1 && !zipFilePath && !chosenTarget) { | ||
| logger.error('No target selected'); | ||
| return; | ||
| } | ||
|
|
||
| abortController.current = new AbortController(); | ||
|
|
||
| setWriting(true); | ||
|
|
@@ -172,7 +199,8 @@ Are you sure you want to continue?`, | |
| setProgress(updatedProgress); | ||
| }, | ||
| abortController.current, | ||
| showDelayTimeout ? uploadDelay : undefined | ||
| showDelayTimeout ? uploadDelay : undefined, | ||
| mcubootFwPath ? chosenTarget : undefined | ||
| ) | ||
| .then(() => { | ||
| setWritingSucceed(true); | ||
|
|
@@ -228,7 +256,14 @@ Are you sure you want to continue?`, | |
| <DialogButton | ||
| variant="primary" | ||
| onClick={onWriteStart} | ||
| disabled={writing || writingSucceed || writingFail} | ||
| disabled={ | ||
| writing || | ||
| writingSucceed || | ||
| writingFail || | ||
| (programmingOptions.length > 1 && | ||
| !chosenTarget && | ||
| !!mcubootFwPath) | ||
|
Comment on lines
+263
to
+265
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks a bit complex, how this one should be tested? looks like it does overlap with existing mcuboot programming? |
||
| } | ||
| > | ||
| Write | ||
| </DialogButton> | ||
|
|
@@ -243,6 +278,24 @@ Are you sure you want to continue?`, | |
| <strong>Firmware:</strong> | ||
| <span>{` ${mcubootFwPath || zipFilePath}`}</span> | ||
| </div> | ||
|
|
||
| {programmingOptions.length > 1 && !zipFilePath && ( | ||
| <div className="tw-flex tw-flex-col tw-gap-2"> | ||
| <strong>Target:</strong> | ||
| <Dropdown | ||
| items={targetDropdownItems} | ||
| onSelect={(item: DropdownItem) => { | ||
| setChosenTarget(item.value); | ||
| }} | ||
| selectedItem={getSelectedDropdownItem( | ||
| targetDropdownItems, | ||
| chosenTarget | ||
| )} | ||
| disabled={writingHasStarted} | ||
| /> | ||
| </div> | ||
| )} | ||
|
|
||
| {writing && ( | ||
| <div className="tw-flex tw-flex-col tw-gap-2"> | ||
| <div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Greg: