This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new ed30c61ab hw/mcu/stm32: Fix WFI in RAM for -O3
ed30c61ab is described below
commit ed30c61ab5ba21ec873b28a5a25205d2fba6151e
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Sat Aug 17 12:21:44 2024 +0200
hw/mcu/stm32: Fix WFI in RAM for -O3
Even though function stm32_wfi_from_ram() has attribute
to be placed in ram in -03 it can be inlined that can
effectively run WFI from flash.
Now additional attribute is added to make sure that
it is not inlined.
bx lr is also removed allowing compiler to make normal
exit from function (which in most cases will be bx lr)
Signed-off-by: Jerzy Kasenberg <[email protected]>
---
hw/mcu/stm/stm32_common/src/hal_os_tick.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/mcu/stm/stm32_common/src/hal_os_tick.c
b/hw/mcu/stm/stm32_common/src/hal_os_tick.c
index ab512f0c4..a61e53b13 100644
--- a/hw/mcu/stm/stm32_common/src/hal_os_tick.c
+++ b/hw/mcu/stm/stm32_common/src/hal_os_tick.c
@@ -28,11 +28,10 @@
#endif
#if MYNEWT_VAL(STM32_WFI_FROM_RAM)
-__attribute__((section(".text_ram"))) void
+__attribute__((section(".text_ram"),noinline)) void
stm32_wfi_from_ram(void)
{
- __ASM volatile ("wfi\n"
- "bx lr");
+ __ASM volatile ("wfi");
}
#endif