-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Move mcumgr functionality as internal Zephyr service #36092
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
Move mcumgr functionality as internal Zephyr service #36092
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
@de-nordic thank you for the PR. |
Yes. This is first step. I want to bring code as it is, of course with filled in missing licenses, compliance and style fixes here and there, so that it would past tests. Then plan is to change structure of I want to keep the thing moving and I have decided to make changes in steps; as I have more priority task to complete and some of them collide, regarding the mcumgr changes, I need to structure work in a way that lets me keep the changes going in gradually while working on other items. |
838304c
to
ade2d28
Compare
b9cc16e
to
53d44d5
Compare
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
e808765
to
238e3af
Compare
142e791
to
0db5184
Compare
ff197d3
to
8646913
Compare
@@ -11,5 +11,4 @@ are described below: | |||
| `CONFIG_MCUMGR` | Enable the mcumgr management library. | n | | |||
| `CONFIG_MCUMGR_CMD_FS_MGMT` | Enable mcumgr handlers for file management | n | | |||
| `CONFIG_MCUMGR_CMD_IMG_MGMT` | Enable mcumgr handlers for image management | n | | |||
| `CONFIG_MCUMGR_CMD_LOG_MGMT` | Enable mcumgr handlers for log management | n | |
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.
Need to squash this commit yet or change the commit description?
Leaving this commit may make the changes more readable.
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.
Sorry, you need to be more verbose because I did not get that.
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.
The Commit description for the commit containing this change says it will be squashed. You should squash this commit or remove that message in the commit description.
I would be in favor of leaving this commit to have better tracking of the changes.
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.
Removed information on squashing from commit messages.
| `CONFIG_MCUMGR` | Enable the mcumgr management library. | n | | ||
| `CONFIG_MCUMGR_CMD_FS_MGMT` | Enable mcumgr handlers for file management | n | | ||
| `CONFIG_MCUMGR_CMD_IMG_MGMT` | Enable mcumgr handlers for image management | n | | ||
| `CONFIG_MCUMGR_CMD_OS_MGMT` | Enable mcumgr handlers for OS management | n | |
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.
Missing CONFIG_MCUMGR_GRP_ZEPHYR_BASIC and CONFIG_MCUMGR_CMD_STAT_MGMT
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
subsys/mgmt/mcumgr/lib/README.md
Outdated
|
||
To use mcumgr's image management support, your device must be running version | ||
1.1.0 or later of the [MCUboot boot | ||
loader](https://github.com/runtimeco/mcuboot). The other mcumgr features do |
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.
Link is now https://github.com/mcu-tools/mcuboot
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
subsys/mgmt/mcumgr/lib/README.md
Outdated
* Command handlers: | ||
* Image management (`img_mgmt`) | ||
* File system management (`fs_mgmt`) | ||
* Log management (`log_mgmt`) |
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.
Isn't log management empty and unimplemented?
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
subsys/mgmt/mcumgr/lib/README.md
Outdated
|
||
Developers welcome! | ||
|
||
* Our Slack channel: https://mynewt.slack.com/messages/C7Y3K0C2J |
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.
Can replace with zephyr discord link https://discord.com/invite/Ck7jw53nU2
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
struct cbor_out_attr_t { | ||
const char *attribute; /** The attribute name (key). */ | ||
struct cbor_out_val_t val; /** The attribute value. */ | ||
bool omit; /** Attribute ignored if true. */ |
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.
Comment spacing here is a bit much
case CborAttrUnsignedIntegerType: | ||
targetaddr = (char *)&cursor->addr.uinteger[offset]; | ||
break; | ||
#if FLOAT_SUPPORT |
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.
Would be good to use the zephyr float Kconfig name for this, or add a new Kconfig specifically for this
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
lptr = &arr->arr.uintegers.store[off]; | ||
err |= cbor_value_get_uint64(&elem, lptr); | ||
break; | ||
#if FLOAT_SUPPORT |
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.
As above
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
TEST_CASE_DECL(test_cborattr_decode_string_array); | ||
TEST_CASE_DECL(test_cborattr_decode_object_array); | ||
TEST_CASE_DECL(test_cborattr_decode_unnamed_array); | ||
TEST_CASE_DECL(test_cborattr_decode_substring_key); |
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.
Would be good addition for a future commit to add support for testing float and half float here also
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.
Yes we will have to do that.
#define IMG_MGMT_STATE_F_ACTIVE 0x04 | ||
#define IMG_MGMT_STATE_F_PERMANENT 0x08 | ||
|
||
#define IMG_MGMT_VER_MAX_STR_LEN 25 /* 255.255.65535.4294967295\0 */ | ||
|
||
/* | ||
* Swap Types for image management state machine | ||
*/ | ||
#define IMG_MGMT_SWAP_TYPE_NONE 0 | ||
#define IMG_MGMT_SWAP_TYPE_TEST 1 | ||
#define IMG_MGMT_SWAP_TYPE_PERM 2 | ||
#define IMG_MGMT_SWAP_TYPE_REVERT 3 | ||
|
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.
Spacing seems different throughout file
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.
Fixed
#endif | ||
|
||
/* MTU for newtmgr responses */ | ||
#define MGMT_MAX_MTU 1024 |
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.
Would be good to have this as a Kconfig in future
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.
Unfortunately right now this thing is not used anywhere.
### Mcumgr/Newtmgr SMP Client Over Serial | ||
|
||
`mcumgr` or `newtmgr` can be used over TTY serial with the following parameters |
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.
Does newtmgr still work with zephyr?
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.
Yes, mcumgr is just rename for newtmgr
The commit copies code of mcumgr, as a lib, under subsys/mgmt/mcumgr. Only source files relevant for Zephyr have been copied, and changes to source files have been limited only to path changes, where required. Samples have been left out as the only relevant sample, smp_svr, is already within Zephyr source tree. Signed-off-by: Dominik Ermel <[email protected]>
cf0240b
to
8fb0f8f
Compare
@lairdjm Can you ping me on discord so we could have brief talk on further plans for the mcumgr? |
8fb0f8f
to
affb8f9
Compare
Not implemented. Signed-off-by: Dominik Ermel <[email protected]>
The commit removes MYNEWT sepcific code and code that has been conditionally compiled with "ifndef _ZEPHYR_". Signed-off-by: Dominik Ermel <[email protected]>
References to Mynewt have been removed and README for Zephyr has been merged directly to the README. Signed-off-by: Dominik Ermel <[email protected]>
Commit fixes compliance issues. Signed-off-by: Dominik Ermel <[email protected]>
The commit changes licensing to SPDX tags. Signed-off-by: Dominik Ermel <[email protected]>
The option enables float numbers processing within CBOR attributes. Signed-off-by: Dominik Ermel <[email protected]>
The commit removes mcumgr library, as module, from west.yml manifest, as the mcumgr library source is now kept within Zephyr source code tree. Signed-off-by: Dominik Ermel <[email protected]>
The commit adds Kconfig options that enables "frugal status list"; when enabled, the status list will be sent with zero, empty and false values omitted, slightly reducing number of bytes sent as response from device. Signed-off-by: Dominik Ermel <[email protected]>
affb8f9
to
d8213cf
Compare
Remove mcumgr library, as module, from manifest, as the mcumgr library source is now kept within Zephyr since v3.0, see: zephyrproject-rtos/zephyr#36092 issues: #105 Signed-off-by: Stephan Linz <[email protected]>
NOTE: Most of PRs can be squashed, are kept for easier re-editing of the PR contents.
The PR consists of commits:
TODO:
Depends on: #39584Resolves: #36017