Skip to content

Commit a0ea780

Browse files
jtguggedaljhn-nordic
authored andcommitted
modules: memfault: Read from offset when uploading modem traces
Use the nrf_modem_lib_trace_peek_at() API to read from the offset that Memfault requests. This should improve recovery when upload of a chunk fails for various reasons. Signed-off-by: Jan Tore Guggedal <[email protected]>
1 parent 9e33182 commit a0ea780

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/memfault-firmware-sdk/memfault_lte_coredump_modem_trace.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ static bool read_data_cb(uint32_t offset, void *buf, size_t buf_len)
124124
{
125125
ARG_UNUSED(offset);
126126

127-
int err = nrf_modem_lib_trace_read(buf, buf_len);
127+
int err = nrf_modem_lib_trace_peek_at(offset, buf, buf_len);
128128

129129
if (err == -ENODATA) {
130-
LOG_WRN("No more modem trace data to read");
130+
LOG_WRN("No more modem trace data to peek");
131+
131132
return false;
132133
} else if (err < 0) {
133-
LOG_ERR("Failed to read modem trace data: %d", err);
134+
LOG_ERR("Failed to peek modem trace data: %d", err);
135+
134136
return false;
135137
}
136138

0 commit comments

Comments
 (0)