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

boot_serial: zephyr: allow to build when CONFIG_MULTITHREADING=n #1009

Merged

Conversation

nvlsianpu
Copy link
Collaborator

K_sleep() is not available when multithreading is disabled.
Let's use k_busy_wait() in that case.

Signed-off-by: Andrzej Puzdrowski andrzej.puzdrowski@nordicsemi.no

@nvlsianpu nvlsianpu requested a review from de-nordic May 14, 2021 10:00
@nvlsianpu
Copy link
Collaborator Author

cc @nordic-krch

For zephyr-rtos:
K_sleep() is not available when multithreading is disabled.
Let's use k_busy_wait() in that case.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
@de-nordic
Copy link
Collaborator

Can you help me with building this?
I do:

 west build -b nrf52840dk_nrf52840 -d voot bootloader/mcuboot/boot/zephyr/ -p -- -DCONFIG_MCUBOOT_SERIAL=y -DCONFIG_UART_CONSOLE=n

And get:

...
zephyrproject-clean/voot/zephyr/include/generated/syscalls/kernel.h:86: undefined reference to `z_impl_k_sleep'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

This is my top in mcuboot: 9f43588 , zephyr 41e885947e4f48aae0866df9e5fee657afb7c1cc

@nordic-krch
Copy link
Contributor

nordic-krch commented May 17, 2021

k_sleep is used in main.c as well.

k_sleep(K_MSEC(50));

K_sleep() is not available when multithreading is disabled.
Let's use k_busy_wait() in that case.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Copy link
Collaborator

@de-nordic de-nordic left a comment

Choose a reason for hiding this comment

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

Looks OK.

I have been able to build and test the change on nrf52840dk, works fine.

Thanks!

@nvlsianpu nvlsianpu merged commit 9b97456 into mcu-tools:main May 17, 2021
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.

4 participants