Skip to content

RTT: LOG_PANIC unable to be called in ISR's #79403

@JordanYates

Description

@JordanYates

Describe the bug

Calling LOG_PANIC() in an exception handler when RTT is the logging backend will deadlock due to triggering its own assertion. This is due to SEGGER_RTT_LOCK not being suitable for use in IRQ's:

void zephyr_rtt_mutex_lock(void)
{
k_mutex_lock(&rtt_term_mutex, K_FOREVER);
}

While mutex locking is explicitly not permitted in ISRs:

* Mutexes may not be locked in ISRs.

Expected behavior

LOG_PANIC should never deadlock.

Impact

System lockup on exception unless a hardware watchdog that automatically reboots is enabled.

Logs and console output

image

Metadata

Metadata

Assignees

Labels

area: Segger RTTSEGGER RTT (Real Time Transfer)bugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions