-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
subsys/mgmt/hawkbit & sample: Bugs/improvements #37225
Comments
@ceolin @gmarull @Navin-Sankar Any clue/comments? |
Updated, please read again. |
@ycsin I agree point 1 & 2. It's good to get the correct flash device from the devicetree storage partition node. |
@sylvioalves - is this related to the PR you had just made? Just wondering if there is some commonality. |
No, it is not related. |
Updated |
@ycsin - would you be open to making a PR for your fix? |
@cfriedt already opened 4 PRs for different issue but @Navin-Sankar requested them to be made into 1 PR instead here. I will do it if its really necessary after I finish my other work. |
Describe the bug
Found something in the
hawkbit
that might be improved while I'm debugging why thehawkbit
sample isn't working for me:TheFixedhawkbit_init
function is assuming the "storage" label to be withDT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL
(usuallyflash0
?) whereas it can can be with the external serial flash so this should follows where the "storage" is defined instead of a constant.Same goes for theFixednvs_init(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL)
There's an extra space before the "not" here that should be removed.FixedFor some reason it marked the image as OK here, but the image still isn't OK. Which led to a reboot here whenExpected behavior from mcuboothawkbit_autohandler();
is invoked.hawkbit
subsys is expecting confirmed image, but theMCUboot
is designed to not confirm the primary image that's flashed.FixedLOG_MODULE_REGISTER(hawkbit);
is wrong, its verbosity can't be configured.LOG_ERR("only part 'bApp' is supported; got %s", chunk->part);
missinglog_strdup
, throwing error in log.To Reproduce
Build
hawkbit
sample with "storage" in external flash.Expected behavior
hawkbit
sample working.Impact
Can't get
hawkbit
sample to work.Environment (please complete the following information):
Logs
It manage to print the logs here because I
k_sleep()
before reboot function call. Or else the last message would be:before it repeats the bootloader process, and there's no way for anyone to immediately know what caused the reset.
Suggested fix
1 & 2: Refer to the
nvs
sample, determine the location of "storage" partition directly from devicetree: #372753: Remove the space: #37278
4:
Perform additional check if the image is actually "OK"?Expected behavior from mcuboot5: Do
k_sleep()
inhawkbit
before the reboot command is called so that the log subsys has time to print the logshawkbit
's scope) Implement function in the log subsys which can be called to flush all the logshawkbit
's scope) Dok_sleep()
in the shutdown/reboot function so that the log subsys has time to print the logs6: I recommend this needs to be mentioned in the
hawkbit
subsys's README & update thehawkbit
sample's README such that the user should flash the confirmed image built withCONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE=y
instead of the typical one. Or elsehawkbit
will always reboot the system whenautohandler()
is invoked. (Thanks to @nvlsianpu for the enlightenment). This is especially useful for users that are new to this.7: Should be
LOG_MODULE_REGISTER(hawkbit, CONFIG_HAWKBIT_LOG_LEVEL);
instead. #372778: Should be
LOG_ERR("only part 'bApp' is supported; got %s", log_strdup(chunk->part));
instead #37276The text was updated successfully, but these errors were encountered: