Skip to content

Commit

Permalink
Memfault Firmware SDK 1.14.0 (Build 10647)
Browse files Browse the repository at this point in the history
  • Loading branch information
Memfault Inc committed Oct 9, 2024
1 parent 3b0fd7c commit 6652e81
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 12 deletions.
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.14.0] - 2024-10-09

### 📈 Added

- ESP-IDF:

- The Memfault port will now disable the `IWDT` (Interrupt Watchdog Timer)
before starting coredump saving, to prevent interrupting the coredump
process. The ESP-IDF fault handler enables the `WDT_RWDT` hardware watchdog
when a fault occurs, so there is still protection if the fault handling
hangs.

## [1.13.0] - 2024-10-07

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

- ESP-IDF:

- Added a Kconfig, `CONFIG_MEMFAULT_FREERTOS_RUNTIME_STATS_MULTI_CORE_SPLIT`,
to control `MEMFAULT_FREERTOS_RUNTIME_STATS_MULTI_CORE_SPLIT`. This Kconfig
is enabled by default for multi-core devices.
Expand Down Expand Up @@ -46,14 +59,14 @@ and this project adheres to
### 🚩 Deprecated

Support for the following vendor platform versions is deprecated in this
release, and will be removed in the following release:
release, and will be removed in a future release:

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

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

## [1.12.0] - 2024-09-25

Expand Down
6 changes: 3 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BUILD ID: 10617
GIT COMMIT: edc2beda42
VERSION: 1.13.0
BUILD ID: 10647
GIT COMMIT: 8448e7acf8
VERSION: 1.14.0
4 changes: 2 additions & 2 deletions components/include/memfault/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ typedef struct {
} sMfltSdkVersion;

#define MEMFAULT_SDK_VERSION \
{ .major = 1, .minor = 13, .patch = 0 }
#define MEMFAULT_SDK_VERSION_STR "1.13.0"
{ .major = 1, .minor = 14, .patch = 0 }
#define MEMFAULT_SDK_VERSION_STR "1.14.0"

#ifdef __cplusplus
}
Expand Down
14 changes: 10 additions & 4 deletions examples/esp32/apps/memfault_demo_app/main/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
#include "esp_attr.h"
#include "esp_log.h"
#include "esp_system.h"
#include "freertos/FreeRTOS.h"

static const char *TAG = "button";
static portMUX_TYPE s_button_spinlock = portMUX_INITIALIZER_UNLOCKED;

static void IRAM_ATTR prv_gpio_isr_handler(void *arg) {
uint32_t gpio_num = (uint32_t)arg;
// Make volatile to prevent compiler optimization in while loop
volatile uint32_t gpio_num = (uint32_t)arg;

// dereference a null point to trigger a crash
volatile uint32_t *ptr = NULL;
*ptr = gpio_num;
// Grab a spinlock to ensure this ISR does not get interrupted
portENTER_CRITICAL_ISR(&s_button_spinlock);
// Hang the interrupt to trigger a fault from the interrupt watchdog
while (true) {
gpio_num++;
}
}

// The flex glitch filter is only available on 5.1. Skip it for earlier SDKs.
Expand Down
18 changes: 18 additions & 0 deletions ports/esp_idf/memfault/common/memfault_platform_coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <stdint.h>
#include <string.h>

#include "esp_intr_alloc.h"
#include "esp_partition.h"
#include "memfault/esp_port/version.h"

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

// Disable the interrupt watchdog (IWDT) if it's enabled, to avoid contention
// with the IWDT interrupt when the fault handler is executing. This is safe
// to do when we're in the panic handler, because ESP-IDF's
// esp_panic_handler() has already enabled the WDT_RWDT to hard-reset the chip
// if the panic handler hangs.
#if defined(CONFIG_ESP_INT_WDT)
// Define ETS_INT_WDT_INUM for compatibility with < 5.1
#if !defined(ETS_INT_WDT_INUM)
#define ETS_INT_WDT_INUM (ETS_T1_WDT_INUM)
#endif
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
esp_intr_disable_source(ETS_INT_WDT_INUM);
#else
ESP_INTR_DISABLE(ETS_INT_WDT_INUM);
#endif // ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
#endif // defined(CONFIG_ESP_INT_WDT)

prv_panic_safe_putstr("Saving Memfault Coredump!\r\n");
return (memfault_esp_spi_flash_coredump_begin() == 0);
}
Expand Down

0 comments on commit 6652e81

Please sign in to comment.