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

mcuboot with enabled serial recovery does not compile #35048

Closed
de-nordic opened this issue May 10, 2021 · 6 comments · Fixed by #35393
Closed

mcuboot with enabled serial recovery does not compile #35048

de-nordic opened this issue May 10, 2021 · 6 comments · Fixed by #35393
Assignees
Labels
area: MCUBoot bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Milestone

Comments

@de-nordic
Copy link
Collaborator

de-nordic commented May 10, 2021

Describe the bug
The mcuboot, selected by west, does not compile since b852501 commit to Zephyr.

To Reproduce
0. Download overlay file and replace with the download dir

  1. Go to zephyr root
  2. west build -b nrf52840dk_nrf52840 --build-dir voot bootloader/mcuboot/boot/zephyr/ -t menuconfig -- -DOVERLAY_CONFIG=<dir_to>/serial-recovery.overlay.txt
  3. See linker error

Expected behavior
A clear and concise description of what you expected to happen.

Impact
Not able to compile mcuboot for serial recovery.

Environment (please complete the following information):

  • OS: Ubuntu 20
  • Toolchain zephyr sdk 0.12
  • Commit 5e9d6d6

serial-recovery.overlay.txt

@de-nordic de-nordic added bug The issue is a bug, or the PR is fixing a bug area: MCUBoot labels May 10, 2021
@de-nordic de-nordic changed the title mcuboot with serial update does not compile mcuboot with enabled serial recovery does not compile May 10, 2021
@de-nordic de-nordic added the priority: high High impact/importance bug label May 11, 2021
@nordic-krch
Copy link
Contributor

The issue is MULTITHREADING is off so kernel files for scheduling are not included but there are modules fetched that are using multithreading essentially making it multithreading app.

Is see 2 ways:

  • removed CONFIG_MULTITHREADING=n
  • fix module to not use multithreading stuff (k_sleep) by replacing it with no-multithreading friendly k_busy_wait.

@de-nordic
Copy link
Collaborator Author

Is see 2 ways:

* removed `CONFIG_MULTITHREADING=n`

* fix module to not use multithreading stuff (`k_sleep`) by replacing it with no-multithreading friendly `k_busy_wait`.

The removal significantly increase the binary size (4k)

The problem is with z_impl_k_sleep and z_pm_save_idle_exit and and one seems to be reported from zephyr/drivers/serial/libdrivers__serial.a(uart_nrfx_uarte.c.obj) and the other from zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a(isr_wrapper.S.obj)

@nordic-krch
Copy link
Contributor

I will make PR to fix it in uarte driver. As for z_pm_save_idle_exit can you check if CONFIG_PM=n helps? Power management is not supported when multithreading is off.

@nordic-krch
Copy link
Contributor

Actually, there is already a fix in uarte:


can you check if that is not working in this case?

@de-nordic de-nordic added priority: medium Medium impact/importance bug and removed priority: high High impact/importance bug labels May 11, 2021
@carlescufi carlescufi added this to the v2.6.0 milestone May 11, 2021
@nvlsianpu
Copy link
Collaborator

@nordic-krch

Actually, there is already a fix in uarte:
...

Yes, but it is compiled-out using complier, and now need to use preprocessor instead.
Easy to fix then :D

nvlsianpu added a commit to nvlsianpu/zephyr that referenced this issue May 14, 2021
Allow to compile when multithreadin is disabled.
Needed for fix zephyrproject-rtos#35048.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
@nvlsianpu
Copy link
Collaborator

MCUboot upstream fix: mcu-tools/mcuboot#1009

nvlsianpu added a commit to nvlsianpu/zephyr that referenced this issue May 18, 2021
* boot_serial: allow to build when CONFIG_MULTITHREADING=n
* allow to not provide scratch area definition if scratch
algorithm is not used.

fixes zephyrproject-rtos#35048

Signed-off-by: Andrzej Puzdrowski <[email protected]>
carlescufi pushed a commit that referenced this issue May 19, 2021
* boot_serial: allow to build when CONFIG_MULTITHREADING=n
* allow to not provide scratch area definition if scratch
algorithm is not used.

fixes #35048

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: MCUBoot bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
4 participants