Skip to content

Commit d5c963c

Browse files
committed
boot: zephyr: serial_adapter: Add error if main thread not preemptible
Adds a build failure if the main thread priority is not preemptible and USB CDC ACM serial recovery is used, this is because if this is the case, USB events will never be able to be processed and serial recovery cannot ever enumerate Signed-off-by: Jamie McCrae <[email protected]>
1 parent 822b6cb commit d5c963c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

boot/zephyr/serial_adapter.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
has not been redirected to other UART with DTS chosen zephyr,uart-mcumgr.
3636
#endif
3737

38+
#if defined(CONFIG_BOOT_SERIAL_CDC_ACM) && CONFIG_MAIN_THREAD_PRIORITY < 0
39+
#error CONFIG_MAIN_THREAD_PRIORITY must be preemptible to support USB CDC ACM \
40+
(0 or above)
41+
#endif
42+
3843
BOOT_LOG_MODULE_REGISTER(serial_adapter);
3944

4045
/** @brief Console input representation

0 commit comments

Comments
 (0)