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

load_fw: The firmware loading loop terminates prematurely #556

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

UmairKhanUET
Copy link
Contributor

The remoteproc_load_noblock() is a non-blocking API designed to load the remote firmware in streaming mode. The application has to continue supplying the firmware data blocks until the complete firmware is loaded. The load_fw example does this and checks the nlen variable (returned by the remoteproc_load_noblock() API) for zero to determine if the firmware loading is complete. However, nlen (contains the filesize of the next program header) alone can't be taken as the sufficient condition to mark the completion of firmware loading as 0 is a valid value for filesize for sections that don't require loading to the target memory such as the .bss section. This patch proposes checking filesize as well as memsize as a better metric to mark completion of the firmware loading loop.

The remoteproc_load_noblock() is a non-blocking API designed to load
the remote firmware in streaming mode. The application has to continue
supplying the firmware data blocks until the complete firmware is
loaded. The load_fw example does this and checks the `nlen` variable
(returned by the remoteproc_load_noblock() API) for zero to determine
if the firmware loading is complete. However, `nlen` (contains the
filesize of the next program header) alone can't be taken as the
sufficient condition to mark the completion of firmware loading as
0 is a valid value for filesize for sections that don't require
loading to the target memory such as the .bss section. This patch
proposes checking filesize as well as memsize as a better metric to
mark completion of the firmware loading loop.

Signed-off-by: Umair Khan <[email protected]>
Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@tnmysh tnmysh left a comment

Choose a reason for hiding this comment

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

LGTM.

@arnopo arnopo merged commit f94dde5 into OpenAMP:main Feb 22, 2024
5 checks passed
@UmairKhanUET UmairKhanUET deleted the openamp-556 branch February 28, 2024 12:45
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