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

[nrf fromtre] mcumgr/img_mgmt: CONFIG_MCUBOOT_BOOTLOADER_NO_DOWNGRADE fixes #1662

Merged

Conversation

de-nordic
Copy link
Contributor

@de-nordic de-nordic commented Apr 23, 2024

There are two fixes now.
Previously there has been one, but it required conflict resolution at cherry-pick as there has been previous change missing;
this time both changes are brought.

@@ -471,7 +471,7 @@ os_mgmt_bootloader_info(struct smp_streamer *ctxt)
zcbor_int32_put(zse, BOOTLOADER_MODE);
#if IS_ENABLED(MCUBOOT_BOOTLOADER_NO_DOWNGRADE)
ok = zcbor_tstr_put_lit(zse, "no-downgrade") &&
zcbor_bool_encode(zse, true);
zcbor_bool_encode(zse, &true);
Copy link
Contributor

Choose a reason for hiding this comment

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

strange - true is not a variable or so

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Compiler loads true on stack and gets pointer to stack, it works, although I can make this more clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

this throws a compiler error

@de-nordic de-nordic force-pushed the fix-zcbor-in-os_mgmt_bootloader_info branch from 1a55fbe to 7d5d68e Compare April 24, 2024 08:30
@de-nordic de-nordic requested a review from nvlsianpu April 24, 2024 15:26
Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

please update to [fromtree] and ensure the content is aligned.

@gmarull
Copy link
Member

gmarull commented Apr 25, 2024

@nvlsianpu ping

…GRADE

Usage of the Kconfig, in code, has been missing CONFIG_,
so selected or not it did nothing.

(cherry picked from commit 1ec7116)
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
…_info

There have been to problems with the code where zcbor_bool_encode
has been fed value instead of expected pointer and the result
of previous zcbor_encode operations has not been taken to evaluate
value of ok status.
The change also replaces usage of  #if IS_ENABLED with #ifdef, as
IS_ENABLED should not be used outside if().

(cherry picked from commit c007e71)
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
@de-nordic de-nordic force-pushed the fix-zcbor-in-os_mgmt_bootloader_info branch from 7d5d68e to 3e334e1 Compare April 25, 2024 10:39
@de-nordic de-nordic changed the title [nrf fromlist] mcumgr/img_mgmt: Fix passing bool where pointer is exp… [nrf fromlist] mcumgr/img_mgmt: CONFIG_MCUBOOT_BOOTLOADER_NO_DOWNGRADE fixes Apr 25, 2024
@de-nordic de-nordic changed the title [nrf fromlist] mcumgr/img_mgmt: CONFIG_MCUBOOT_BOOTLOADER_NO_DOWNGRADE fixes [nrf fromtre] mcumgr/img_mgmt: CONFIG_MCUBOOT_BOOTLOADER_NO_DOWNGRADE fixes Apr 25, 2024
@de-nordic de-nordic requested a review from tejlmand April 25, 2024 10:46
@gmarull gmarull merged commit 99187c8 into nrfconnect:main Apr 26, 2024
22 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.

6 participants