diff --git a/Changelog.md b/Changelog.md index 9989af61..bfaf8fbd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +## Unreleased + +### Added + +- Write support for 91x + ## 4.5.0 - 2025-01-02 ### Changed diff --git a/doc/docs/index.md b/doc/docs/index.md index 88c0d1e2..62e99f15 100644 --- a/doc/docs/index.md +++ b/doc/docs/index.md @@ -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 | ??? | ?? | ??? | | 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. \ No newline at end of file +Feel free to fork the repository and clone it for secondary development or feature contributions. diff --git a/doc/docs/programming_dk.md b/doc/docs/programming_dk.md index ab2d0433..62c12508 100644 --- a/doc/docs/programming_dk.md +++ b/doc/docs/programming_dk.md @@ -11,6 +11,7 @@ The following devices have specific programming requirements or procedures: | Device | Description | |-----------------------------------|----------------------------------------------------------------------------------------------------------------------| +| Nordic Thingy:91 X | To program Nordic Thingy:91 X, see ???. | Nordic Thingy:91 | To program Nordic Thingy:91, see [Updating the Thingy:91 firmware using Programmer](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/device_guides/working_with_nrf/nrf91/thingy91.html#updating_the_thingy91_firmware_using_programmer). | nRF9160 DK | To program the nRF9160 DK, see [Updating the nRF9160 DK firmware using Programmer](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/device_guides/working_with_nrf/nrf91/nrf9160.html#updating_the_dk_firmware_using_programmer). | | Nordic Thingy:53 | To program Nordic Thingy:53, follow the steps from the [Programming Nordic Thingy:53](#programming-nordic-thingy53) section. | @@ -163,4 +164,4 @@ To program Nordic Thingy:53 using an external debug probe, complete the followin The HEX file appears in the **File memory layout** section. 1. Click **Erase & write** in the **DEVICE** section of the side panel. -The update is complete when the animation in the Programmer app's **Device memory layout** section ends. \ No newline at end of file +The update is complete when the animation in the Programmer app's **Device memory layout** section ends. diff --git a/package.json b/package.json index 06a82fb1..b804e204 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "nrfConnectForDesktop": { "nrfutil": { "device": [ - "2.6.4" + "2.8.6" ] }, "html": "dist/index.html" diff --git a/src/actions/mcubootTargetActions.ts b/src/actions/mcubootTargetActions.ts index 0afbedf5..61bded27 100644 --- a/src/actions/mcubootTargetActions.ts +++ b/src/actions/mcubootTargetActions.ts @@ -62,7 +62,8 @@ export const performUpdate = async ( dfuFilePath: string, onProgress: (progress: Progress) => void, abortController: AbortController, - netCoreUploadDelay?: number + netCoreUploadDelay?: number, + target?: string ) => { logger.info(`Writing ${dfuFilePath} to device ${device.serialNumber}`); @@ -75,6 +76,7 @@ export const performUpdate = async ( undefined, { netCoreUploadDelay, + target, }, abortController ); diff --git a/src/components/McuUpdateDialogView.tsx b/src/components/McuUpdateDialogView.tsx index e60d6017..bd030cf4 100644 --- a/src/components/McuUpdateDialogView.tsx +++ b/src/components/McuUpdateDialogView.tsx @@ -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(''); 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?`, 1 && + !chosenTarget && + !!mcubootFwPath) + } > Write @@ -243,6 +278,24 @@ Are you sure you want to continue?`, Firmware: {` ${mcubootFwPath || zipFilePath}`} + + {programmingOptions.length > 1 && !zipFilePath && ( +
+ Target: + { + setChosenTarget(item.value); + }} + selectedItem={getSelectedDropdownItem( + targetDropdownItems, + chosenTarget + )} + disabled={writingHasStarted} + /> +
+ )} + {writing && (