Skip to content

[nrf noup] boot: zephyr: Add bm firmware loader code #451

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nordicjm
Copy link
Contributor

Adds firmware loader code for use in baremetal mode

bool firmware_loader_image_valid = false;
bool app_installer_is_installer_image = false;

liteinstalls_init();
Copy link
Contributor

Choose a reason for hiding this comment

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

liteinstalls_init(); What is tis?

Copy link
Contributor

Choose a reason for hiding this comment

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

bm_installs...

}

invalid_softdevice:
#ifdef CONFIG_BOOT_FIRMWARE_LOADER
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't that code purposed for CONFIG_BOOT_FIRMWARE_LOADER=y only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now yes, but can be reused in future to allow for single slot mode (not firmware loader mode) with serial recovery for application and softdevice

BOOT_LOG_DBG("Booting installer");
rsp->br_image_off = flash_area_get_off(&fa_app_installer);
rsp->br_hdr = &hdr_app_installer;
} else if (boot_firmware_loader == true && softdevice_image_valid == true &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I fully understand that when valid app_installer_image was detected then triggering the loader by the app must have been spurious. For entering by pin/pin reset
Doesn't assignment to boot app_installer_image open possibility for bricking or hanging the device by installer which has a bug which caused that it might hangs?
I would move firmware_loader_image boot assignment ahead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the installer image runs and deletes itself (well, the header) so it should not brick itself. Once the installer image runs, the integrity of the firmware loader is invalid, because it will be replacing it and the softdevice, and both must be present for the firmware loader image to be usable

Adds firmware loader code for use in baremetal mode

Signed-off-by: Jamie McCrae <[email protected]>
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

#include <assert.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/drivers/flash.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

some includes are unneded: flash.h, usb_device.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants