Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/twister.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
CCACHE_DIR: /github/ccache
# `--specs` is ignored because ccache is unable to resolve the toolchain specs file path.
CCACHE_IGNOREOPTIONS: '--specs=*'
TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 '
# Ignore nrf54l09pdk until upgrading to Zephyr v4.2, v4.1 and HAL v3.12.0 are incompatible
TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 -P nrf54l09pdk'
DAILY_OPTIONS: ' -M --build-only --show-footprint'
VENDOR_FILTER: ' --vendor nordic --vendor zephyr --vendor embeint '
EXTRA_BOARDS: ' --platform qemu_cortex_m3 --platform qemu_cortex_m0 '
Expand Down
18 changes: 12 additions & 6 deletions include/infuse/reboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ enum infuse_reboot_reason {
INFUSE_REBOOT_DFU = 135,
/** Unknown reboot reason */
INFUSE_REBOOT_UNKNOWN = 255,
};
} __packed;

/** Type of @ref infuse_reboot_info data */
enum infuse_reboot_info_type {
Expand All @@ -70,7 +70,11 @@ enum infuse_reboot_info_type {
INFUSE_REBOOT_INFO_WATCHDOG,
} __packed;

/** Detailed information about the reboot location/cause */
/**
* Detailed information about the reboot location/cause
* RISCV platforms have 16 byte alignment requirements for @a arch_esf.
* Still use __packed so we can guarantee the compiler does not shift memory layout.
*/
union infuse_reboot_info {
/* Generic reboot information */
struct {
Expand All @@ -95,7 +99,7 @@ union infuse_reboot_info {
/** Watchdog info2 per @ref infuse_watchdog_thread_state_lookup */
uint32_t info2;
} watchdog;
} __packed;
} __packed __aligned(16);

/** Reboot state information */
struct infuse_reboot_state {
Expand All @@ -113,13 +117,15 @@ struct infuse_reboot_state {
enum infuse_reboot_reason reason;
/** Hardware reboot reason flags */
uint32_t hardware_reason;
/** Thread executing at reboot time */
char thread_name[REBOOT_STATE_THREAD_NAME_MAX];
/** Type of the information in @a info */
enum infuse_reboot_info_type info_type;
/** Pad the scructure out so that @a info is 16 byte aligned */
uint8_t _padding[5];
/** Reboot information */
union infuse_reboot_info info;
/** Thread executing at reboot time */
char thread_name[REBOOT_STATE_THREAD_NAME_MAX];
} __packed;
} __packed __aligned(16);

/** @cond INTERNAL_HIDDEN */
#define _NORETURN COND_CODE_1(CONFIG_INFUSE_REBOOT_RETURN, (), (FUNC_NORETURN))
Expand Down
8 changes: 7 additions & 1 deletion lib/common_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ static int secure_fault_info_read(void)

static void reboot_info_print(int query_rc)
{
char thread_null[REBOOT_STATE_THREAD_NAME_MAX + 1];

/* Ensure logged name is NULL terminated */
strncpy(thread_null, reboot_state.thread_name, REBOOT_STATE_THREAD_NAME_MAX);
thread_null[REBOOT_STATE_THREAD_NAME_MAX] = '\0';

LOG_INF("");
LOG_INF("Reboot Information");
LOG_INF("\tHardware: %08X", reboot_state.hardware_reason);
Expand All @@ -154,7 +160,7 @@ static void reboot_info_print(int query_rc)
}
LOG_INF("\t Cause: %d", reboot_state.reason);
LOG_INF("\t Uptime: %d", reboot_state.uptime);
LOG_INF("\t Thread: %s", reboot_state.thread_name);
LOG_INF("\t Thread: %s", thread_null);
switch (reboot_state.info_type) {
case INFUSE_REBOOT_INFO_GENERIC:
LOG_INF("\t Info 1: %08X", reboot_state.info.generic.info1);
Expand Down
8 changes: 6 additions & 2 deletions subsys/epacket/epacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,11 @@ static void epacket_processor(void *a, void *b, void *c)
k_poll_signal_init(&bt_adv_signal_send_next);
#endif

k_thread_name_set(NULL, "epacket_proc");
#ifdef CONFIG_EPACKET_PROCESS_THREAD_SPLIT
k_thread_name_set(NULL, "ep_tx_proc");
#else
k_thread_name_set(NULL, "ep_proc");
#endif
infuse_watchdog_thread_register(wdog_channel, _current);
while (true) {
rc = k_poll(events, ARRAY_SIZE(events), loop_period);
Expand Down Expand Up @@ -511,7 +515,7 @@ static void epacket_processor_rx(void *a, void *b, void *c)
struct net_buf *buf;
int rc;

k_thread_name_set(NULL, "epacket_proc_rx");
k_thread_name_set(NULL, "ep_rx_proc");
infuse_watchdog_thread_register(wdog_channel_rx, _current);
while (true) {
rc = k_poll(events, ARRAY_SIZE(events), loop_period_rx);
Expand Down