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

mgmt: updatehub: Fix json arrays #72036

Merged

Conversation

nandojve
Copy link
Member

After the changes introduced by #50816 the UpdateHub could not decode anymore the JSON object. This introduce missing parsing definitions to allow JSON parser undertood the correct UpdateHub probe object.

Fixes #69297

Before evaluate it is recommended take a look at UpdateHub zephyr guide and make sure your device have a network connection. Remember that by default UpdateHub sample get IP automatically.

Steps to Evaluate:

Run updatehub-ce docker

sudo docker run -it -p 8080:8080 -p 5683:5683/udp --rm updatehub/updatehub-ce:latest

Build SoC bootloader and flash

west build -b frdm_k64f -d build/mcuboot-frdm_k64f bootloader/mcuboot/boot/zephyr
west flash -d build/mcuboot-frdm_k64f

Build UpdateHub sample, sign and flash

west build -b frdm_k64f -d build/app zephyr/samples/subsys/mgmt/updatehub -- -DOVERLAY_CONFIG=overlay-prj.conf
west sign -t imgtool -d build/app -- --version 1.0.0 --pad --key bootloader/mcuboot/root-rsa-2048.pem
west flash -d build/app --hex-file build/app/zephyr/zephyr.signed.hex

Sign and package using uhu

west sign --no-hex --bin -B build/zephyr-2.0.0.bin -t imgtool -d build/app -- --version 2.0.0 --key bootloader/mcuboot/root-rsa-2048.pem
uhu package archive --output build/zephyr-2.0.0.pkg

On the UpdateHub-CE UI go to packages and upload the zephyr-2.0.0.pkg
On the UpdateHub-CE UI go to rollouts and create the rollout

CC: @otavio

Note

The below error is on investigation and seems to be unrelated to UpdateHub since it is an internal API provided by dfu subsystem.

I: Firmware download complete
E: Could not mark partition to upgrade

@nandojve nandojve requested a review from nordicjm April 27, 2024 12:37
@nandojve nandojve added the area: UpdateHub UpdateHub label Apr 27, 2024
@nandojve nandojve added this to the v3.7.0 milestone Apr 27, 2024
@nandojve nandojve marked this pull request as ready for review April 27, 2024 16:25
subsys/mgmt/updatehub/updatehub.c Outdated Show resolved Hide resolved
subsys/mgmt/updatehub/updatehub.c Outdated Show resolved Hide resolved
After the changes introduced by zephyrproject-rtos#50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes zephyrproject-rtos#69297

Signed-off-by: Gerson Fernando Budke <[email protected]>
@carlescufi carlescufi merged commit 5fb62ca into zephyrproject-rtos:main May 2, 2024
21 checks passed
@nandojve nandojve deleted the updatehub/fix_json_arrays branch May 3, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zephyr UpdateHub sample issues
4 participants