From a23d6a05a6ae91c4a3c436b25919ede86b35683a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Quentin?= Date: Mon, 15 Jan 2024 15:46:34 +0100 Subject: [PATCH] Fix stack-top calculation for app-core (#1081) * Fix stack-top calculation for app-core * CHANGELOG.md entry --- CHANGELOG.md | 1 + esp-hal-common/src/soc/esp32/cpu_control.rs | 2 +- esp-hal-common/src/soc/esp32s3/cpu_control.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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 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) } } }