Skip to content

Commit 3adc1f2

Browse files
michalek-nonordicjm
authored andcommitted
[nrf noup] boot: zephyr: remove nonsecure ram cleanup
nrf-squash! [nrf noup] zephyr: Clean up non-secure RAM if enabled This leads to stack corruption. Signed-off-by: Mateusz Michalek <[email protected]>
1 parent 3b20ec3 commit 3adc1f2

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

boot/zephyr/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ if(SYSBUILD)
755755
set(mcuboot_image_upgrade_footer_size ${required_upgrade_size} CACHE INTERNAL "Estimated MCUboot update image trailer size" FORCE)
756756
endif()
757757

758-
if(CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL OR CONFIG_MCUBOOT_CLEANUP_NONSECURE_RAM)
758+
if(CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL)
759759
zephyr_library_sources(
760760
${BOOT_DIR}/zephyr/nrf_cleanup.c
761761
)

boot/zephyr/main.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ K_SEM_DEFINE(boot_log_sem, 1, 1);
144144
#include <pm_config.h>
145145
#endif
146146

147-
#if CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL || CONFIG_MCUBOOT_NRF_CLEANUP_NONSECURE_RAM
147+
#if CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL
148148
#include <nrf_cleanup.h>
149149
#endif
150150

@@ -224,9 +224,6 @@ static void do_boot(struct boot_rsp *rsp)
224224
#if CONFIG_MCUBOOT_NRF_CLEANUP_PERIPHERAL
225225
nrf_cleanup_peripheral();
226226
#endif
227-
#if CONFIG_MCUBOOT_NRF_CLEANUP_NONSECURE_RAM && defined(PM_SRAM_NONSECURE_NAME)
228-
nrf_cleanup_ns_ram();
229-
#endif
230227
#if CONFIG_MCUBOOT_CLEANUP_ARM_CORE
231228
cleanup_arm_nvic(); /* cleanup NVIC registers */
232229

boot/zephyr/nrf_cleanup.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,3 @@ void nrf_cleanup_peripheral(void)
158158
nrf_cleanup_clock();
159159
#endif
160160
}
161-
162-
#if USE_PARTITION_MANAGER \
163-
&& defined(CONFIG_ARM_TRUSTZONE_M) \
164-
&& defined(PM_SRAM_NONSECURE_NAME)
165-
void nrf_cleanup_ns_ram(void)
166-
{
167-
memset((void *) PM_SRAM_NONSECURE_ADDRESS, 0, PM_SRAM_NONSECURE_SIZE);
168-
}
169-
#endif

0 commit comments

Comments
 (0)