Skip to content

Commit 6652e81

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.14.0 (Build 10647)
1 parent 3b0fd7c commit 6652e81

File tree

5 files changed

+49
-12
lines changed

5 files changed

+49
-12
lines changed

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [1.14.0] - 2024-10-09
10+
11+
### 📈 Added
12+
13+
- ESP-IDF:
14+
15+
- The Memfault port will now disable the `IWDT` (Interrupt Watchdog Timer)
16+
before starting coredump saving, to prevent interrupting the coredump
17+
process. The ESP-IDF fault handler enables the `WDT_RWDT` hardware watchdog
18+
when a fault occurs, so there is still protection if the fault handling
19+
hangs.
20+
921
## [1.13.0] - 2024-10-07
1022

1123
### 📈 Added
@@ -18,6 +30,7 @@ and this project adheres to
1830
`memfault_platform_config.h`. This setting is disabled by default.
1931

2032
- ESP-IDF:
33+
2134
- Added a Kconfig, `CONFIG_MEMFAULT_FREERTOS_RUNTIME_STATS_MULTI_CORE_SPLIT`,
2235
to control `MEMFAULT_FREERTOS_RUNTIME_STATS_MULTI_CORE_SPLIT`. This Kconfig
2336
is enabled by default for multi-core devices.
@@ -46,14 +59,14 @@ and this project adheres to
4659
### 🚩 Deprecated
4760

4861
Support for the following vendor platform versions is deprecated in this
49-
release, and will be removed in the following release:
62+
release, and will be removed in a future release:
5063

5164
- ESP-IDF < `v4.4` (Jan 26, 2022)
5265
- Zephyr < `v2.7.0` (Oct 16, 2021)
5366
- nRF-Connect SDK < `v1.9.2` (Jul 14, 2022)
5467

55-
Please [contact us]([email protected]) if you need support for earlier
56-
versions!
68+
Please [contact us](https://mflt.io/contact-support) if you need support for
69+
earlier versions!
5770

5871
## [1.12.0] - 2024-09-25
5972

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 10617
2-
GIT COMMIT: edc2beda42
3-
VERSION: 1.13.0
1+
BUILD ID: 10647
2+
GIT COMMIT: 8448e7acf8
3+
VERSION: 1.14.0

components/include/memfault/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ typedef struct {
2020
} sMfltSdkVersion;
2121

2222
#define MEMFAULT_SDK_VERSION \
23-
{ .major = 1, .minor = 13, .patch = 0 }
24-
#define MEMFAULT_SDK_VERSION_STR "1.13.0"
23+
{ .major = 1, .minor = 14, .patch = 0 }
24+
#define MEMFAULT_SDK_VERSION_STR "1.14.0"
2525

2626
#ifdef __cplusplus
2727
}

examples/esp32/apps/memfault_demo_app/main/button.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@
1111
#include "esp_attr.h"
1212
#include "esp_log.h"
1313
#include "esp_system.h"
14+
#include "freertos/FreeRTOS.h"
1415

1516
static const char *TAG = "button";
17+
static portMUX_TYPE s_button_spinlock = portMUX_INITIALIZER_UNLOCKED;
1618

1719
static void IRAM_ATTR prv_gpio_isr_handler(void *arg) {
18-
uint32_t gpio_num = (uint32_t)arg;
20+
// Make volatile to prevent compiler optimization in while loop
21+
volatile uint32_t gpio_num = (uint32_t)arg;
1922

20-
// dereference a null point to trigger a crash
21-
volatile uint32_t *ptr = NULL;
22-
*ptr = gpio_num;
23+
// Grab a spinlock to ensure this ISR does not get interrupted
24+
portENTER_CRITICAL_ISR(&s_button_spinlock);
25+
// Hang the interrupt to trigger a fault from the interrupt watchdog
26+
while (true) {
27+
gpio_num++;
28+
}
2329
}
2430

2531
// The flex glitch filter is only available on 5.1. Skip it for earlier SDKs.

ports/esp_idf/memfault/common/memfault_platform_coredump.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <stdint.h>
1515
#include <string.h>
1616

17+
#include "esp_intr_alloc.h"
1718
#include "esp_partition.h"
1819
#include "memfault/esp_port/version.h"
1920

@@ -365,6 +366,23 @@ bool memfault_platform_coredump_save_begin(void) {
365366
// Update task watchdog bookkeeping, if it's enabled
366367
memfault_task_watchdog_bookkeep();
367368

369+
// Disable the interrupt watchdog (IWDT) if it's enabled, to avoid contention
370+
// with the IWDT interrupt when the fault handler is executing. This is safe
371+
// to do when we're in the panic handler, because ESP-IDF's
372+
// esp_panic_handler() has already enabled the WDT_RWDT to hard-reset the chip
373+
// if the panic handler hangs.
374+
#if defined(CONFIG_ESP_INT_WDT)
375+
// Define ETS_INT_WDT_INUM for compatibility with < 5.1
376+
#if !defined(ETS_INT_WDT_INUM)
377+
#define ETS_INT_WDT_INUM (ETS_T1_WDT_INUM)
378+
#endif
379+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
380+
esp_intr_disable_source(ETS_INT_WDT_INUM);
381+
#else
382+
ESP_INTR_DISABLE(ETS_INT_WDT_INUM);
383+
#endif // ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
384+
#endif // defined(CONFIG_ESP_INT_WDT)
385+
368386
prv_panic_safe_putstr("Saving Memfault Coredump!\r\n");
369387
return (memfault_esp_spi_flash_coredump_begin() == 0);
370388
}

0 commit comments

Comments
 (0)