refactor(core): remove circular deps between rtl and sys
What changed, and why it matters
This commit is a routine internal code cleanup. It moves the logging header file from one directory to another and splits out a system-exit declaration to remove circular dependencies between two low-level software layers. No security vulnerability is introduced or fixed; the functionality of the code remains the same.
No security action required. Treat as normal refactoring; verify the build still compiles and existing tests pass.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change refactors the Trezor Core embedded firmware build: core/embed/rtl/inc/rtl/logging.h is deleted and recreated as core/embed/sys/inc/sys/logging.h, with all #include <rtl/logging.h> directives updated to #include <sys/logging.h>. A new core/embed/rtl/inc/rtl/sysexit.h is introduced to declare system_exit_error and system_exit_fatal in the rtl layer while their implementations stay in sys/task, breaking a circular include dependency. Build paths and documentation are updated accordingly. The macros, types, and conditional behavior are identical before and after.
Changed components
core/embed/rtl/logging.h (removed)core/embed/sys/inc/sys/logging.h (added/moved)core/embed/rtl/inc/rtl/sysexit.h (added)core/embed/rtl/error_handling.ccore/embed/rtl/inc/rtl/error_handling.hcore/embed/sys/task/inc/sys/system.hcore/embed/sys/dbg/syslog.ccore/embed/rust/build.rscore/site_scons/models/stm32f4_common.pycore/site_scons/models/stm32u5_common.pycore/site_scons/models/unix_common.pydocs/core/misc/logging.mdInspect captured patch +193 / −135
diff --git a/core/embed/io/ble/unix/ble.c b/core/embed/io/ble/unix/ble.c
index 371f4cf9..abb54738 100644
--- a/core/embed/io/ble/unix/ble.c
+++ b/core/embed/io/ble/unix/ble.c
@@ -21,7 +21,7 @@
#include <io/ble.h>
#include <io/unix/sock.h>
-#include <rtl/logging.h>
+#include <sys/logging.h>
#include <sys/sysevent_source.h>
#include <arpa/inet.h>
diff --git a/core/embed/io/display/unix/display_driver.c b/core/embed/io/display/unix/display_driver.c
index 809f4e8e..8693de4e 100644
--- a/core/embed/io/display/unix/display_driver.c
+++ b/core/embed/io/display/unix/display_driver.c
@@ -29,7 +29,7 @@
#include <io/display.h>
#include <io/unix/sdl_display.h>
-#include <rtl/logging.h>
+#include <sys/logging.h>
#include <SDL.h>
#include <SDL_image.h>
diff --git a/core/embed/io/haptic/drv262x/drv262x.c b/core/embed/io/haptic/drv262x/drv262x.c
index 075a2cee..3ed494e2 100644
--- a/core/embed/io/haptic/drv262x/drv262x.c
+++ b/core/embed/io/haptic/drv262x/drv262x.c
@@ -23,7 +23,7 @@
#include <io/haptic.h>
#include <io/i2c_bus.h>
-#include <rtl/logging.h>
+#include <sys/logging.h>
#include <sys/systick.h>
#include "drv262x.h"
diff --git a/core/embed/io/touch/ft3168/ft3168.c b/core/embed/io/touch/ft3168/ft3168.c
index dcb067dc..8e81f602 100644
--- a/core/embed/io/touch/ft3168/ft3168.c
+++ b/core/embed/io/touch/ft3168/ft3168.c
@@ -24,7 +24,7 @@
#include <io/i2c_bus.h>
#include <io/touch.h>
-#include <rtl/logging.h>
+#include <sys/logging.h>
#include <sys/systick.h>
#include "ft3168.h"
diff --git a/core/embed/io/touch/ft6x36/ft6x36.c b/core/embed/io/touch/ft6x36/ft6x36.c
index d44df2b5..bb80c3dd 100644
--- a/core/embed/io/touch/ft6x36/ft6x36.c
+++ b/core/embed/io/touch/ft6x36/ft6x36.c
@@ -24,7 +24,7 @@
#include <io/i2c_bus.h>
#include <io/touch.h>
-#include <rtl/logging.h>
+#include <sys/logging.h>
#include <sys/systick.h>
#include "ft6x36.h"
diff --git a/core/embed/io/touch/touch_poll.c b/core/embed/io/touch/touch_poll.c
index 528edce1..68c1bb83 100644
--- a/core/embed/io/touch/touch_poll.c
+++ b/core/embed/io/touch/touch_poll.c
@@ -22,7 +22,7 @@
#include <trezor_rtl.h>
#include <io/touch.h>
-#include <rtl/logging.h>
+#include <sys/logging.h>
#include <sys/sysevent_source.h>
#include <sys/systask.h>
#include <sys/systick.h>
diff --git a/core/embed/projects/bootloader/emulator.c b/core/embed/projects/bootloader/emulator.c
index ba6252fa..d9de1d3c 100644
--- a/core/embed/projects/bootloader/emulator.c
+++ b/core/embed/projects/bootloader/emulator.c
@@ -6,9 +6,9 @@
#include <SDL.h>
#include <io/display.h>
-#include <rtl/logging.h>
#include <sys/bootargs.h>
#include <sys/bootutils.h>
+#include <sys/logging.h>
#include <util/flash.h>
#include <util/flash_otp.h>
#include "bootui.h"
diff --git a/core/embed/projects/firmware/main.c b/core/embed/projects/firmware/main.c
index dd1ad922..293c3dee 100644
--- a/core/embed/projects/firmware/main.c
+++ b/core/embed/projects/firmware/main.c
@@ -34,8 +34,8 @@
#include "ports/stm32/pendsv.h"
#include <io/display.h>
-#include <rtl/logging.h>
#include <sys/linker_utils.h>
+#include <sys/logging.h>
#include <sys/notify.h>
#include <sys/systask.h>
#include <sys/system.h>
diff --git a/core/embed/rtl/error_handling.c b/core/embed/rtl/error_handling.c
index 90d928f3..5d62fa19 100644
--- a/core/embed/rtl/error_handling.c
+++ b/core/embed/rtl/error_handling.c
@@ -19,9 +19,6 @@
#include <trezor_rtl.h>
-#include <sys/bootutils.h>
-#include <sys/system.h>
-
#ifndef TREZOR_EMULATOR
// Stack check guard value set in startup code.
// This is used if stack protection is enabled.
diff --git a/core/embed/rtl/inc/rtl/error_handling.h b/core/embed/rtl/inc/rtl/error_handling.h
index 1cc8a1c6..a23a53c1 100644
--- a/core/embed/rtl/inc/rtl/error_handling.h
+++ b/core/embed/rtl/inc/rtl/error_handling.h
@@ -21,6 +21,8 @@
#include <errno.h>
+#include "sysexit.h"
+
// Suppresses the intellisense error in VSCode
#ifndef __FILE_NAME__
#define __FILE_NAME__ __FILE__
diff --git a/core/embed/rtl/inc/rtl/logging.h b/core/embed/rtl/inc/rtl/logging.h
deleted file mode 100644
index d048e35d..00000000
--- a/core/embed/rtl/inc/rtl/logging.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of the Trezor project, https://trezor.io/
- *
- * Copyright (c) SatoshiLabs
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-
-typedef enum {
- LOG_LEVEL_OFF = 0,
- LOG_LEVEL_ERR = 1,
- LOG_LEVEL_WARN = 2,
- LOG_LEVEL_INF = 3,
- LOG_LEVEL_DBG = 4,
-} log_level_t;
-
-/** Information about a source module */
-typedef struct {
- /** Source module name shown in the logs */
- const char* name;
- /** Length of the module name in characters */
- size_t name_len;
-} log_source_t;
-
-#ifdef USE_DBG_CONSOLE
-
-#include <sys/syslog.h>
-
-#define LOG_DECLARE(source_name) SYSLOG_LOG_DECLARE(source_name)
-
-#define LOG_MODULE_MAX_LEVEL (SYSLOG_MODULE_MAX_LEVEL)
-
-#define LOG_ERR(fmt, ...) SYSLOG_LOG_ERR(fmt, ##__VA_ARGS__)
-#define LOG_WARN(fmt, ...) SYSLOG_LOG_WARN(fmt, ##__VA_ARGS__)
-#define LOG_INF(fmt, ...) SYSLOG_LOG_INF(fmt, ##__VA_ARGS__)
-#define LOG_DBG(fmt, ...) SYSLOG_LOG_DBG(fmt, ##__VA_ARGS__)
-
-#define LOG_HEXDUMP_DBG(prefix, data, data_size) \
- SYSLOG_LOG_HEXDUMP_DBG(prefix, data, data_size)
-
-#else
-
-#define LOG_DECLARE(source_name)
-
-#define LOG_MODULE_MAX_LEVEL (LOG_LEVEL_OFF)
-
-#define LOG_ERR(fmt, ...)
-#define LOG_WARN(fmt, ...)
-#define LOG_INF(fmt, ...)
-#define LOG_DBG(fmt, ...)
-
-#define LOG_HEXDUMP_DBG(prefix, data, data_size)
-
-#endif // USE_DBG_CONSOLE
diff --git a/core/embed/rtl/inc/rtl/sysexit.h b/core/embed/rtl/inc/rtl/sysexit.h
new file mode 100644
index 00000000..7fb2bb7f
--- /dev/null
+++ b/core/embed/rtl/inc/rtl/sysexit.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the Trezor project, https://trezor.io/
+ *
+ * Copyright (c) SatoshiLabs
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+/**
+ * @brief Terminates the current task with an error message.
+ *
+ * To avoid circular dependencies, this function is declared here
+ * in rtl but implemented in sys/task.
+ *
+ * See the notes for `system_exit` regarding the behavior of the error handler
+ *
+ * @param title Title of the error message
+ * @param message Main error message
+ * @param footer Footer of the error message
+ */
+void system_exit_error(const char *title, const char *message,
+ const char *footer);
+
+/**
+ * @brief Terminates the current task with a fatal error message.
+ *
+ * To avoid circular dependencies, this function is declared here
+ * in rtl but implemented in sys/task.
+ *
+ * See the notes for `system_exit` regarding the behavior of the error handler
+ *
+ * @param message Fatal error message
+ * @param file Source file name where the fatal error occurred
+ * @param line Line number in the source file where the fatal error occurred
+ */
+void system_exit_fatal(const char *message, const char *file, int line);
diff --git a/core/embed/rust/build.rs b/core/embed/rust/build.rs
index d4ffd477..788a4b76 100644
--- a/core/embed/rust/build.rs
+++ b/core/embed/rust/build.rs
@@ -47,6 +47,7 @@ const DEFAULT_BINDGEN_MACROS_COMMON: &[&str] = &[
"-I../io/usb/inc",
"-I../sec/storage/inc",
"-I../sys/dbg/inc",
+ "-I../sys/inc",
"-I../sys/time/inc",
"-I../sys/task/inc",
"-I../sys/power_manager/inc",
diff --git a/core/embed/rust/trezorhal.h b/core/embed/rust/trezorhal.h
index 7605232f..6f52357a 100644
--- a/core/embed/rust/trezorhal.h
+++ b/core/embed/rust/trezorhal.h
@@ -6,9 +6,9 @@
#include <io/display.h>
#include <io/display_utils.h>
#include <io/usb.h>
-#include <rtl/logging.h>
#include <rtl/secbool.h>
#include <sys/irq.h>
+#include <sys/logging.h>
#include <sys/sysevent.h>
#include <sys/systick.h>
#include <util/flash.h>
diff --git a/core/embed/sec/optiga/optiga_commands.c b/core/embed/sec/optiga/optiga_commands.c
index eab97400..15d32c15 100644
--- a/core/embed/sec/optiga/optiga_commands.c
+++ b/core/embed/sec/optiga/optiga_commands.c
@@ -27,9 +27,9 @@
#include <trezor_rtl.h>
-#include <rtl/logging.h>
#include <sec/optiga_commands.h>
#include <sec/optiga_transport.h>
+#include <sys/logging.h>
#include "der.h"
#include "ecdsa.h"
#include "hmac.h"
diff --git a/core/embed/sec/optiga/optiga_transport.c b/core/embed/sec/optiga/optiga_transport.c
index f046c081..3f0aa7da 100644
--- a/core/embed/sec/optiga/optiga_transport.c
+++ b/core/embed/sec/optiga/optiga_transport.c
@@ -28,10 +28,10 @@
#include <trezor_rtl.h>
#include <io/i2c_bus.h>
-#include <rtl/logging.h>
#include <rtl/strutils.h>
#include <sec/optiga_hal.h>
#include <sec/optiga_transport.h>
+#include <sys/logging.h>
#include <sys/systick.h>
#include "aes/aesccm.h"
#include "memzero.h"
diff --git a/core/embed/sys/dbg/syslog.c b/core/embed/sys/dbg/syslog.c
index e91189e8..6990964e 100644
--- a/core/embed/sys/dbg/syslog.c
+++ b/core/embed/sys/dbg/syslog.c
@@ -19,10 +19,10 @@
#include <trezor_rtl.h>
-#include <rtl/logging.h>
#include <rtl/printf.h>
#include <rtl/strutils.h>
#include <sys/dbg_console.h>
+#include <sys/logging.h>
#include <sys/systick.h>
#ifndef TREZOR_EMULATOR
diff --git a/core/embed/sys/inc/sys/logging.h b/core/embed/sys/inc/sys/logging.h
new file mode 100644
index 00000000..d048e35d
--- /dev/null
+++ b/core/embed/sys/inc/sys/logging.h
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the Trezor project, https://trezor.io/
+ *
+ * Copyright (c) SatoshiLabs
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+typedef enum {
+ LOG_LEVEL_OFF = 0,
+ LOG_LEVEL_ERR = 1,
+ LOG_LEVEL_WARN = 2,
+ LOG_LEVEL_INF = 3,
+ LOG_LEVEL_DBG = 4,
+} log_level_t;
+
+/** Information about a source module */
+typedef struct {
+ /** Source module name shown in the logs */
+ const char* name;
+ /** Length of the module name in characters */
+ size_t name_len;
+} log_source_t;
+
+#ifdef USE_DBG_CONSOLE
+
+#include <sys/syslog.h>
+
+#define LOG_DECLARE(source_name) SYSLOG_LOG_DECLARE(source_name)
+
+#define LOG_MODULE_MAX_LEVEL (SYSLOG_MODULE_MAX_LEVEL)
+
+#define LOG_ERR(fmt, ...) SYSLOG_LOG_ERR(fmt, ##__VA_ARGS__)
+#define LOG_WARN(fmt, ...) SYSLOG_LOG_WARN(fmt, ##__VA_ARGS__)
+#define LOG_INF(fmt, ...) SYSLOG_LOG_INF(fmt, ##__VA_ARGS__)
+#define LOG_DBG(fmt, ...) SYSLOG_LOG_DBG(fmt, ##__VA_ARGS__)
+
+#define LOG_HEXDUMP_DBG(prefix, data, data_size) \
+ SYSLOG_LOG_HEXDUMP_DBG(prefix, data, data_size)
+
+#else
+
+#define LOG_DECLARE(source_name)
+
+#define LOG_MODULE_MAX_LEVEL (LOG_LEVEL_OFF)
+
+#define LOG_ERR(fmt, ...)
+#define LOG_WARN(fmt, ...)
+#define LOG_INF(fmt, ...)
+#define LOG_DBG(fmt, ...)
+
+#define LOG_HEXDUMP_DBG(prefix, data, data_size)
+
+#endif // USE_DBG_CONSOLE
diff --git a/core/embed/sys/startup/unix/bootutils.c b/core/embed/sys/startup/unix/bootutils.c
index 12b83ba8..f9020b3d 100644
--- a/core/embed/sys/startup/unix/bootutils.c
+++ b/core/embed/sys/startup/unix/bootutils.c
@@ -21,9 +21,9 @@
#include <stdlib.h>
-#include <rtl/logging.h>
#include <sys/bootargs.h>
#include <sys/bootutils.h>
+#include <sys/logging.h>
#include <sys/systick.h>
#include <util/rsod_special.h>
diff --git a/core/embed/sys/syscall/stm32/syscall_stubs.c b/core/embed/sys/syscall/stm32/syscall_stubs.c
index 6d595304..6b8bcf92 100644
--- a/core/embed/sys/syscall/stm32/syscall_stubs.c
+++ b/core/embed/sys/syscall/stm32/syscall_stubs.c
@@ -120,7 +120,7 @@ ssize_t dbg_console_write(const void *data, size_t data_size) {
#ifdef USE_DBG_CONSOLE
-#include <rtl/logging.h>
+#include <sys/logging.h>
bool syslog_start_record(const log_source_t *source, log_level_t level) {
return (bool)syscall_invoke2((uint32_t)source, level,
diff --git a/core/embed/sys/syscall/stm32/syscall_verifiers.h b/core/embed/sys/syscall/stm32/syscall_verifiers.h
index b4e5528f..d007e9c3 100644
--- a/core/embed/sys/syscall/stm32/syscall_verifiers.h
+++ b/core/embed/sys/syscall/stm32/syscall_verifiers.h
@@ -59,7 +59,7 @@ ssize_t dbg_console_write__verified(const void *data, size_t data_size);
// ---------------------------------------------------------------------
#ifdef USE_DBG_CONSOLE
-#include <rtl/logging.h>
+#include <sys/logging.h>
bool syslog_start_record__verified(const log_source_t *source,
log_level_t level);
diff --git a/core/embed/sys/task/inc/sys/system.h b/core/embed/sys/task/inc/sys/system.h
index f8921f0b..4e83c783 100644
--- a/core/embed/sys/task/inc/sys/system.h
+++ b/core/embed/sys/task/inc/sys/system.h
@@ -17,74 +17,81 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef TREZORHAL_SYSTEM_H
-#define TREZORHAL_SYSTEM_H
+#pragma once
#include <sys/systask.h>
#ifdef KERNEL_MODE
-// Initializes the fundamental system services
-// (MPU, SysTick, systimer and task scheduler).
-//
-// `error_handler` is a callback that is called when a kernel task terminates
-// with an error
+/**
+ * @brief Initializes fundamental system services (MPU, SysTick, systimer
+ * and task scheduler)
+ *
+ * @param error_handler Callback that is called when a kernel task
+ * terminates with an error
+ */
void system_init(systask_error_handler_t error_handler);
-// Deinitializes the system services before handover
-// to next booting stage.
+/**
+ * Deinitializes the system services before handover to next booting stage.
+ */
void system_deinit(void);
-// Calls the error handler in the emergency mode.
-//
-// This function is called when the system encounters a critical error
-// and needs to perform a useful action (such as displaying an error message)
-// before it is reset or shut down.
-//
-// The function may be called from any context, including interrupt context.
-// It completely resets stack pointers, clears the .bss segment, reinitializes
-// the .data segment, and calls the `error_handler` callback.
-//
-// The system will be in a state similar to a reset when `main()` is called
-// (but with some hardware peripherals still initialized and running).
-//
-// If `error_handler` is NULL the system will be reset immediately after
-// clearing the memory. If `USE_BOOTARGS_RSOD` is defined, the system will
-// leave the postmortem information in the bootargs allowing the bootloader
-// to display the RSOD.
+/**
+ * @brief Calls the error handler in the emergency mode.
+ *
+ * This function is called when the system encounters a critical error
+ * and needs to perform a useful action (such as displaying an error message)
+ * before it is reset or shut down.
+ *
+ * The function may be called from any context, including interrupt context.
+ * It completely resets stack pointers, clears the .bss segment, reinitializes
+ * the .data segment, and calls the `error_handler` callback.
+ *
+ * The system will be in a state similar to a reset when `main()` is called
+ * (but with some hardware peripherals still initialized and running).
+ *
+ * If `error_handler` is NULL the system will be reset immediately after
+ * clearing the memory. If `USE_BOOTARGS_RSOD` is defined, the system will
+ * leave the postmortem information in the bootargs allowing the bootloader
+ * to display the RSOD.
+ *
+ * @param error_handler Callback that is called in the emergency mode
+ * @param pminfo Postmortem information about the error
+ */
__attribute__((noreturn)) void system_emergency_rescue(
systask_error_handler_t error_handler, const systask_postmortem_t* pminfo);
#endif // KERNEL_MODE
-// Terminates the current task normally with the given exit code.
-//
-// If the current task is the kernel task, the error handler is called with the
-// postmortem information. If the task is not the kernel task, the task is
-// terminated immediately and the kernel task is scheduled.
+/**
+ * @brief Terminates the current task normally with the given exit code.
+ *
+ * If the current task is the kernel task, the error handler is called with the
+ * postmortem information. If the task is not the kernel task, the task is
+ * terminated immediately and the kernel task is scheduled.
+ *
+ * @param exitcode Exit code passed to the error handler
+ */
void system_exit(int exitcode);
-// Terminates the current task with an error message.
-//
-// See the notes for `system_exit` regarding the behavior of the error handler
-void system_exit_error(const char* title, const char* message,
- const char* footer);
-
-// Like `system_exit_error`, but with explicit lengths for the strings.
+/**
+ * @brief Like `system_exit_error`, but with explicit lengths for the strings.
+ */
void system_exit_error_ex(const char* title, size_t title_len,
const char* message, size_t message_len,
const char* footer, size_t footer_len);
-// Terminates the current task with a fatal error message.
-//
-// See the notes for `system_exit` regarding the behavior of the error handler
-void system_exit_fatal(const char* message, const char* file, int line);
-
-// Like `system_exit_fatal`, but with explicit lengths for the strings.
+/**
+ * @brief Like `system_exit_fatal`, but with explicit lengths for the strings.
+ */
void system_exit_fatal_ex(const char* message, size_t message_len,
const char* file, size_t file_len, int line);
-// Returns string representation of the system fault.
+/**
+ * Returns string representation of the system fault.
+ *
+ * @param fault Pointer to the system fault information
+ * @return String representation of the fault
+ */
const char* system_fault_message(const system_fault_t* fault);
-
-#endif // TREZORHAL_SYSTEM_H
diff --git a/core/embed/upymod/modtrezorutils/modtrezorutils.c b/core/embed/upymod/modtrezorutils/modtrezorutils.c
index 5dc0b79d..d91f31c0 100644
--- a/core/embed/upymod/modtrezorutils/modtrezorutils.c
+++ b/core/embed/upymod/modtrezorutils/modtrezorutils.c
@@ -35,7 +35,7 @@
#include "embed/upymod/trezorobj.h"
#include <io/usb.h>
-#include <rtl/logging.h>
+#include <sys/logging.h>
#include <sec/secret_keys.h>
#include <sys/bootutils.h>
diff --git a/core/site_scons/models/stm32f4_common.py b/core/site_scons/models/stm32f4_common.py
index 5520a3e4..3e7b8d77 100644
--- a/core/site_scons/models/stm32f4_common.py
+++ b/core/site_scons/models/stm32f4_common.py
@@ -17,6 +17,7 @@ def stm32f4_common_files(env, features_wanted, defines, sources, paths):
"embed/sec/secure_aes/inc",
"embed/sec/time_estimate/inc",
"embed/sys/bsp/stm32f4",
+ "embed/sys/inc",
"embed/sys/irq/inc",
"embed/sys/linker/inc",
"embed/sys/mpu/inc",
diff --git a/core/site_scons/models/stm32u5_common.py b/core/site_scons/models/stm32u5_common.py
index 6f5ca33e..c8248274 100644
--- a/core/site_scons/models/stm32u5_common.py
+++ b/core/site_scons/models/stm32u5_common.py
@@ -19,6 +19,7 @@ def stm32u5_common_files(env, features_wanted, defines, sources, paths):
"embed/sec/secure_aes/inc",
"embed/sec/time_estimate/inc",
"embed/sys/bsp/stm32u5",
+ "embed/sys/inc",
"embed/sys/irq/inc",
"embed/sys/linker/inc",
"embed/sys/mpu/inc",
diff --git a/core/site_scons/models/unix_common.py b/core/site_scons/models/unix_common.py
index bdb14f53..75fc5278 100644
--- a/core/site_scons/models/unix_common.py
+++ b/core/site_scons/models/unix_common.py
@@ -14,7 +14,7 @@ def unix_common_files(env, features_wanted, defines, sources, paths):
"embed/sec/random_delays/inc",
"embed/sec/time_estimate/inc",
"embed/sys/bsp/inc",
- "embed/sys/dbg/inc",
+ "embed/sys/inc",
"embed/sec/rng/inc",
"embed/sec/monoctr/inc",
"embed/sec/secret/inc",
diff --git a/docs/core/misc/logging.md b/docs/core/misc/logging.md
index de233930..39848be9 100644
--- a/docs/core/misc/logging.md
+++ b/docs/core/misc/logging.md
@@ -58,7 +58,7 @@ To enable logging from C code, the `.c` file must:
Example in `my_module.c`:
```c
-#include <rtl/logging.h>
+#include <sys/logging.h>
LOG_DECLARE(my_module)
```
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.