From 149b84802ce28bc00d3702d0baaef0771b658fa1 Mon Sep 17 00:00:00 2001 From: bjoernQ Date: Mon, 15 Jan 2024 15:03:23 +0100 Subject: [PATCH 1/2] Fix stack-top calculation for app-core --- esp-hal-common/src/soc/esp32/cpu_control.rs | 2 +- esp-hal-common/src/soc/esp32s3/cpu_control.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esp-hal-common/src/soc/esp32/cpu_control.rs b/esp-hal-common/src/soc/esp32/cpu_control.rs index 975544a1c30..f48d5063c83 100644 --- a/esp-hal-common/src/soc/esp32/cpu_control.rs +++ b/esp-hal-common/src/soc/esp32/cpu_control.rs @@ -98,7 +98,7 @@ impl Stack { } pub fn top(&mut self) -> *mut u32 { - unsafe { self.bottom().add(SIZE) } + unsafe { self.bottom().add(SIZE / 4) } } } diff --git a/esp-hal-common/src/soc/esp32s3/cpu_control.rs b/esp-hal-common/src/soc/esp32s3/cpu_control.rs index 0153a9d7ac3..12ef9223797 100644 --- a/esp-hal-common/src/soc/esp32s3/cpu_control.rs +++ b/esp-hal-common/src/soc/esp32s3/cpu_control.rs @@ -98,7 +98,7 @@ impl Stack { } pub fn top(&mut self) -> *mut u32 { - unsafe { self.bottom().add(SIZE) } + unsafe { self.bottom().add(SIZE / 4) } } } From b0cfd385b5e8db69f842868c5c10ce1f2aecf875 Mon Sep 17 00:00:00 2001 From: bjoernQ Date: Mon, 15 Jan 2024 15:06:24 +0100 Subject: [PATCH 2/2] CHANGELOG.md entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a8c533934..847ce50b990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ESP32-H2: Fix used RAM (#1003) - Fix SPI slave DMA dma\_read and dma\_write (#1013) - ESP32-C6/H2: Fix disabling of interrupts (#1040) +- ESP32/ESP32-S3: Fix stack-top calculation for app-core (#1081) ### Removed