Skip to content
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

west.yml: Update zcbor to 0.8.0 #67418

Merged
merged 7 commits into from
Jan 25, 2024

Conversation

oyvindronningstad
Copy link
Collaborator

  • Add support for unordered maps
  • Performance improvements
  • Naming improvements for generated code
  • Bugfixes

@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 10, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
mcuboot zephyrproject-rtos/mcuboot@b994ba2 zephyrproject-rtos/mcuboot@f09e205 (main,upstream-sync) zephyrproject-rtos/[email protected]
uoscore-uedhoc zephyrproject-rtos/uoscore-uedhoc@5024d8c zephyrproject-rtos/uoscore-uedhoc@150f4eb (zephyr) zephyrproject-rtos/[email protected]
zcbor zephyrproject-rtos/zcbor@67fd8bb (main) zephyrproject-rtos/zcbor@dbe20af zephyrproject-rtos/[email protected]

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@@ -138,7 +138,8 @@ int os_mgmt_client_echo(struct os_mgmt_client *client, const char *echo_string)
zcbor_new_encode_state(zse, ARRAY_SIZE(zse), nb->data + nb->len, net_buf_tailroom(nb), 0);

ok = zcbor_map_start_encode(zse, 2) &&
zcbor_tstr_put_lit(zse, "d") && zcbor_tstr_put_term(zse, echo_string) &&
zcbor_tstr_put_lit(zse, "d") &&
zcbor_tstr_put_term(zse, echo_string, CONFIG_ZCBOR_MAX_STR_LEN) &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't actually changing behaviour but kind of seems a bit wrong that this is implying that the pointer is (by default) 4096 bytes long?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nordicjm I agree. I managed to limit it to only be used in tests, and I changed it to be 256 instead of 4096. And I added help text discouraging its use.

SeppoTakalo
SeppoTakalo previously approved these changes Jan 15, 2024
Copy link
Collaborator

@SeppoTakalo SeppoTakalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not check the code, but at least LwM2M interop tests against Leshan seem to pass. Verified that manually.

So I cannot see anything broken. OK from LwM2M point of view.

Comment on lines 224 to 226
if (strnlen(name, CONFIG_STATS_MAX_NAME_LEN) == CONFIG_STATS_MAX_NAME_LEN) {
return -ENAMETOOLONG;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure on this? Seems like an MCUmgr limitation, don't see why it should apply to stats as a whole

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a sensible check on its own I'd say, but if we don't want to make any changes there, I could make a config in stat_mgmt/Kconfig instead, just for use when encoding.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stats system has been in zephyr since version 1.11 so would prefer not to make possible breaking changes to it at this point unless they're fixes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, I think I found a good solution in stats_mgmt instead.

@@ -32,6 +32,14 @@ config MCUMGR_GRP_STAT_MAX_NAME_LEN
stat read commands. If a stat group's name exceeds this limit, it will
be impossible to retrieve its values with a stat show command.

config MCUMGR_STAT_MAX_NAME_LEN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must follow naming rule from top of file:

# Options defined in this file should be prefixed:
#  MCUMGR_GRP_STAT_ -- general group options;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to reuse the existing config.

west.yml Outdated
path: modules/lib/uoscore-uedhoc
- name: zcbor
revision: 67fd8bb88d3136738661fa8bb5f9989103f4599e
revision: 0.8.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to use a commit ID for this, not a tag

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@zephyrbot zephyrbot added the Release Notes To be mentioned in the release notes label Jan 25, 2024
@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Jan 25, 2024
Highlights of zcbor 0.8.0:
- Add support for unordered maps
- Performance improvements
- Naming improvements for generated code
- Bugfixes

Update MCUboot and uoscore-uedhoc to bring in changes related to
zcbor 0.8.0.

Signed-off-by: Øyvind Rønningstad <[email protected]>
If people are using the zcbor script for code generation, it needs to be
at the latest version

Signed-off-by: Øyvind Rønningstad <[email protected]>
For use with zcbor_tstr_put_term() which needs a maximum string
length.

Signed-off-by: Øyvind Rønningstad <[email protected]>
Regenerate from CDDL, update patch, fix references in code.

Signed-off-by: Øyvind Rønningstad <[email protected]>
zcbor_new_state and zcbor_tstr_put_term

Signed-off-by: Øyvind Rønningstad <[email protected]>
zcbor_new_state and zcbor_tstr_put_term

Signed-off-by: Øyvind Rønningstad <[email protected]>
@oyvindronningstad oyvindronningstad force-pushed the zcbor-0.8.0 branch 2 times, most recently from 6450676 to 1755c66 Compare January 25, 2024 08:30
nordicjm
nordicjm previously approved these changes Jan 25, 2024
de-nordic
de-nordic previously approved these changes Jan 25, 2024
Comment on lines 439 to 443
For example:
* Leading single underscores and all double underscores are largely gone,
* Names sometimes gain suffixes like ``_m`` or ``_l`` for disambiguation.
* All enum (choice) names have now gained a ``_c`` suffix, so the enum name no longer matches
the corresponding member name exactly (because this broke C++ namespace rules).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should be:

Suggested change
For example:
* Leading single underscores and all double underscores are largely gone,
* Names sometimes gain suffixes like ``_m`` or ``_l`` for disambiguation.
* All enum (choice) names have now gained a ``_c`` suffix, so the enum name no longer matches
the corresponding member name exactly (because this broke C++ namespace rules).
For example:
* Leading single underscores and all double underscores are largely gone,
* Names sometimes gain suffixes like ``_m`` or ``_l`` for disambiguation.
* All enum (choice) names have now gained a ``_c`` suffix, so the enum name no longer matches
the corresponding member name exactly (because this broke C++ namespace rules).

A short release note referring to the official release notes,
and a migration guide with the most likely changes that need to be made.

Signed-off-by: Øyvind Rønningstad <[email protected]>
@oyvindronningstad
Copy link
Collaborator Author

Thanks @de-nordic and @kartben, doc build fixed.

been overhauled, so the code using the generated code must likely be changed.
For example:

* Leading single underscores and all double underscores are largely gone,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(only if another change is requested) replace comma with full stop

@fabiobaltieri fabiobaltieri merged commit 0176a27 into zephyrproject-rtos:main Jan 25, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants