Skip to content

Commit 9e671ad

Browse files
authored
[nrfconnect] Fix configuration of pigweed logger (project-chip#36745)
This commit adjusts the Pigweed logger configuration to prevent the use of mutexes within ISR. Additionally, it increases the Bluetooth RX stack size when the Pigweed logger is enabled. Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
1 parent 609926a commit 9e671ad

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

examples/chef/nrfconnect/rpc.overlay

+4
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ CONFIG_LOG_OUTPUT=y
4848

4949
# Increase zephyr tty rx buffer
5050
CONFIG_CONSOLE_GETCHAR_BUFSIZE=128
51+
52+
# Increase BLE thread stack size
53+
CONFIG_BT_RX_STACK_SIZE=2048
54+

examples/lighting-app/nrfconnect/rpc.overlay

+4
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ CONFIG_LOG_OUTPUT=y
4545

4646
# Increase zephyr tty rx buffer
4747
CONFIG_CONSOLE_GETCHAR_BUFSIZE=128
48+
49+
# Increase BLE thread stack size
50+
CONFIG_BT_RX_STACK_SIZE=2048
51+

examples/platform/nrfconnect/util/PigweedLogger.cpp

+7-12
Original file line numberDiff line numberDiff line change
@@ -100,29 +100,24 @@ void init(const log_backend *)
100100

101101
void processMessage(const struct log_backend * const backend, union log_msg_generic * msg)
102102
{
103+
if (sIsPanicMode || k_is_in_isr())
104+
{
105+
return;
106+
}
107+
103108
int ret = k_sem_take(&sLoggerLock, K_FOREVER);
104109
assert(ret == 0);
105110

106-
if (!sIsPanicMode)
107-
{
108-
log_format_func_t outputFunc = log_format_func_t_get(LOG_OUTPUT_TEXT);
111+
log_format_func_t outputFunc = log_format_func_t_get(LOG_OUTPUT_TEXT);
109112

110-
outputFunc(&pigweedLogOutput, &msg->log, log_backend_std_get_flags());
111-
}
113+
outputFunc(&pigweedLogOutput, &msg->log, log_backend_std_get_flags());
112114

113115
k_sem_give(&sLoggerLock);
114116
}
115117

116118
void panic(const log_backend *)
117119
{
118-
int ret = k_sem_take(&sLoggerLock, K_FOREVER);
119-
assert(ret == 0);
120-
121-
log_backend_std_panic(&pigweedLogOutput);
122-
flush();
123120
sIsPanicMode = true;
124-
125-
k_sem_give(&sLoggerLock);
126121
}
127122

128123
const log_backend_api pigweedLogApi = {

0 commit comments

Comments
 (0)