-
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
Open
tsvetelinpetrov
wants to merge
11
commits into
main
Choose a base branch
from
feat/add-write-support-for-91x
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a648911
Add select target in write dialog
tsvetelinpetrov d7fefa3
Add check if target is selected
tsvetelinpetrov a718638
Use Dropdown from shared and disable target choose on zip file
tsvetelinpetrov fb90771
Extract dataConstructors in shared
tsvetelinpetrov c0c858b
Change to tooltip from shared
tsvetelinpetrov a4c03eb
Merge branch 'main' into feat/add-write-support-for-91x
tsvetelinpetrov 1fb399b
Update changelog
tsvetelinpetrov a669889
Merge branch 'main' into feat/add-write-support-for-91x
tsvetelinpetrov b051eeb
Fix a problem choosing target; Update nrfutil device
tsvetelinpetrov 512cf6b
Update docs
KievDevel 639d62f
Update programming_dk.md
KievDevel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 +1,9 @@ | ||
| ## Unreleased | ||
|
|
||
| ### Added | ||
|
|
||
| - Write support for 91x | ||
|
|
||
| ## 4.5.0 - 2024-12-17 | ||
|
|
||
| ### Changed | ||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -17,12 +17,18 @@ import { | |
| classNames, | ||
| clearConfirmBeforeClose, | ||
| clearWaitForDevice, | ||
| convertToDropDownItems, | ||
| DialogButton, | ||
| Dropdown, | ||
| DropdownItem, | ||
| GenericDialog, | ||
| getPersistentStore, | ||
| getSelectedDropdownItem, | ||
| logger, | ||
| NumberInlineInput, | ||
| Overlay, | ||
| selectedDevice, | ||
| selectedDeviceInfo, | ||
| setWaitForDevice, | ||
| Slider, | ||
| Toggle, | ||
|
|
@@ -40,6 +46,8 @@ import { WithRequired } from '../util/types'; | |
|
|
||
| const TOOLTIP_TEXT = | ||
| 'Delay duration to allow successful image swap from RAM NET to NET core after image upload. Recommended default timeout is 40s. Should be increased for the older Thingy:53 devices'; | ||
| const TOOLTIP_TEXT_MULTIPLE_TARGETS = | ||
| 'Your device has multiple targets. Please select the target you want to program.'; | ||
|
|
||
| const NET_CORE_UPLOAD_DELAY = 120; | ||
|
|
||
|
|
@@ -56,8 +64,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; | ||
|
|
||
|
|
@@ -111,6 +130,12 @@ const McuUpdateDialogView = () => { | |
| } | ||
| }, [device, showDelayTimeout]); | ||
|
|
||
| useEffect(() => { | ||
| if (targetDropdownItems.length > 0) { | ||
| setChosenTarget(targetDropdownItems[0].value); | ||
| } | ||
| }, [targetDropdownItems]); | ||
|
|
||
| const onCancel = () => { | ||
| dispatch(clearWaitForDevice()); | ||
| dispatch(setShowMcuBootProgrammingDialog(false)); | ||
|
|
@@ -175,7 +200,8 @@ Are you sure you want to continue?`, | |
| setProgress(updatedProgress); | ||
| }, | ||
| abortController.current, | ||
| showDelayTimeout ? uploadDelay : undefined | ||
| showDelayTimeout ? uploadDelay : undefined, | ||
| mcubootFwPath ? chosenTarget : undefined | ||
| ) | ||
| .then(() => { | ||
| setWritingSucceed(true); | ||
|
|
@@ -231,7 +257,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> | ||
|
|
@@ -247,6 +280,38 @@ Are you sure you want to continue?`, | |
| <span>{` ${mcubootFwPath || zipFilePath}`}</span> | ||
| </Form.Label> | ||
| </Form.Group> | ||
|
|
||
| {programmingOptions.length > 1 && !zipFilePath && ( | ||
| <Form.Group> | ||
| <Form.Label | ||
| style={{ display: 'inline-flex', alignItems: 'center' }} | ||
| > | ||
| <strong>Target:</strong> | ||
| <Overlay | ||
| tooltipChildren={ | ||
| <span>{TOOLTIP_TEXT_MULTIPLE_TARGETS}</span> | ||
| } | ||
| keepShowingOnHoverTooltip | ||
| tooltipId="test" | ||
| placement="right" | ||
| > | ||
| <span className="mdi mdi-information-outline info-icon ml-1" /> | ||
| </Overlay> | ||
| </Form.Label> | ||
| <Dropdown | ||
| items={targetDropdownItems} | ||
| onSelect={(item: DropdownItem) => { | ||
| setChosenTarget(item.value); | ||
| }} | ||
| selectedItem={getSelectedDropdownItem( | ||
| targetDropdownItems, | ||
| chosenTarget | ||
| )} | ||
| disabled={writingHasStarted} | ||
| /> | ||
| </Form.Group> | ||
| )} | ||
|
|
||
| {writing && ( | ||
| <Form.Group> | ||
| <Form.Label> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: