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

[v2.7] application booted from v3.x mcuboot uptime resets #56604

Closed
nordicjm opened this issue Apr 6, 2023 · 9 comments · Fixed by #59154
Closed

[v2.7] application booted from v3.x mcuboot uptime resets #56604

nordicjm opened this issue Apr 6, 2023 · 9 comments · Fixed by #59154
Assignees
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@nordicjm
Copy link
Collaborator

nordicjm commented Apr 6, 2023

Describe the bug
It seems that with #56528 applied to mcuboot, a 2.7-built application which uses uptime will ungracefully seem to lose it's uptime value after about 8.5 minutes, that is, the device will continue functioning but e.g. using kernel uptime from the shell will wrongly output an uptime value of seconds rather than 10 minutes which is wrong.

To Reproduce

  • Build mcuboot with above PR for nrf52840dk_nrf52840 and flash to board
  • Checkout v2.7-branch, west update, then build samples/subsys/shell/shell_module with mcuboot enabled and flash
  • Check kernel uptime and kernel threads output every minute, after the 8.5 minute mark, seemingly the uptime has set to 0.

Expected behavior
Uptime to continue incrementing

Impact
Showstopper, applications seemingly are unaware of the true uptime. Note that this only happens when older images e.g. 2.7 are booted from new versions of mcuboot e.g. from zephyr 3.x onwards

Environment (please complete the following information):

  • Commit SHA or Version used: main with above PR for mcuboot and v2.7-branch for application
@nordicjm nordicjm added the bug The issue is a bug, or the PR is fixing a bug label Apr 6, 2023
@cfriedt
Copy link
Member

cfriedt commented Apr 11, 2023

@nordicjm - any chance you could provide a fix?

@jgl-meta jgl-meta added the priority: low Low impact/importance bug label Apr 11, 2023
@nordicjm
Copy link
Collaborator Author

@nordicjm - any chance you could provide a fix?

Not likely, can't determine cause

@nordicjm
Copy link
Collaborator Author

@anangl is there a PR that needs to be ported?

@anangl
Copy link
Member

anangl commented Apr 12, 2023

@anangl is there a PR that needs to be ported?

I have no idea, to be honest. I don't know what could cause such behavior.

@nordicjm nordicjm assigned nordic-krch and anangl and unassigned nordicjm Apr 12, 2023
@nordicjm
Copy link
Collaborator Author

Assigning to @anangl and @nordic-krch it seems to be something wrong with drivers/timer/nrf_rtc_timer.c and that file has been vastly changed in 3.x, if I add debug out then it seems to prevent the issue (albeit I get a continuous stream of output) so maybe something is not being handled properly like an overflow or next count or something.

@github-actions
Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Jun 12, 2023
@nordicjm nordicjm removed the Stale label Jun 12, 2023
@nordicjm
Copy link
Collaborator Author

Ping on @anangl and @nordic-krch

@anangl
Copy link
Member

anangl commented Jun 12, 2023

The issue is not actually related to mcuboot. It can be also observed in samples/subsys/shell/shell_module built with v2.7-branch without using mcuboot. The behavior is caused by specific construction of the application. Details in #59154.

@anangl
Copy link
Member

anangl commented Jun 13, 2023

Fixed by #59154.

@anangl anangl closed this as completed Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants