-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Flash shell migrate commands to new shell #10019
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
Flash shell migrate commands to new shell #10019
Conversation
468a4fe to
7baf079
Compare
7baf079 to
4018f0c
Compare
Codecov Report
@@ Coverage Diff @@
## master #10019 +/- ##
=======================================
Coverage 53.14% 53.14%
=======================================
Files 210 210
Lines 25747 25747
Branches 5673 5673
=======================================
Hits 13682 13682
Misses 9755 9755
Partials 2310 2310Continue to review full report at Codecov.
|
4018f0c to
5b49f57
Compare
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.
ret != 0 indicates error. this should be PR_ERROR. Message should be something like "flash_erase failed (err:%d)."
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.
here message is misleading, better would be "Failed to disable flash protection (err: %d)."
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.
"Failed to enable flash protection (err: %d)."
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.
here, also messages could be improved.
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.
PR_ERROR
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.
you can extend struct page_layout_data to have shell handler and use PR_SHELL() here. Even though it is called callback, it is executed in the context of shell command so no worries about using shell_fprintf.
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.
maybe that could be simple PR()
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.
PR_ERROR and improve message.
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.
done
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.
PR_ERROR and improve message
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.
PR_ERROR
|
Apart from review i have one suggestion. Why not move those commands out from sample to /drivers/flash folder and add kconfig option to enable shell commands for flash driver. Sample would just enable those. |
90c8d50 to
6526078
Compare
|
@nordic-krch : done |
Convert flash_shell example to use the new shell API. Signed-off-by: Jakub Rzeszutko <[email protected]>
6526078 to
31d0772
Compare
Migrating flash example to new shell.
Fixes #8883