diff --git a/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch b/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch
index ed9b9ef3c..30754e98c 100644
--- a/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch
+++ b/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch
@@ -33,7 +33,7 @@
-
+
diff --git a/os/common/ports/ARMv8-M-ML/chcore.c b/os/common/ports/ARMv8-M-ML/chcore.c
index 4f4dfec4e..be365dddf 100644
--- a/os/common/ports/ARMv8-M-ML/chcore.c
+++ b/os/common/ports/ARMv8-M-ML/chcore.c
@@ -54,8 +54,7 @@
/**
* @brief Tail ISR context switch code.
*
- * @param[in] sp the stack pointer being switched-out
- * @return The stack pointer being switched-in.
+ * @return The thread being switched-in.
*/
thread_t *port_schedule_next(void) {
thread_t *ntp;
@@ -63,7 +62,7 @@ thread_t *port_schedule_next(void) {
chSysLock();
/* TODO statistics, tracing etc */
- ntp = chSchRunAhead();
+ ntp = chSchSelectFirstI();
chSysUnlock();
diff --git a/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S b/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S
index 24ab6b6be..6e85b0a21 100644
--- a/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S
+++ b/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S
@@ -122,6 +122,8 @@ SVC_Handler:
PendSV_Handler:
/* Pointer to the current thread.*/
ldr r1, =ch
+// movw r1, #:lower16:ch
+// movt r1, #:upper16:ch
ldr r1, [r1, #CURRENT_OFFSET]
/* Saving callee context of thread being swapped out.*/
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index 1c770a30b..b3d6449ea 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -724,7 +724,7 @@ static inline void chSchPreemption(void) {
*
* @special
*/
-static inline thread_t *chSchRunAhead(void) {
+static inline thread_t *chSchSelectFirstI(void) {
thread_t *otp = currp;
thread_t *ntp;