diff --git a/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/Makefile b/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/Makefile index 902e59d14..5ed72260f 100644 --- a/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/Makefile +++ b/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/Makefile @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). diff --git a/demos/various/SB-CLIENT-32k-08070000-4k-2001E000/main.c b/demos/various/SB-CLIENT-32k-08070000-4k-2001E000/main.c index 66d2bb44b..ca5f6e216 100644 --- a/demos/various/SB-CLIENT-32k-08070000-4k-2001E000/main.c +++ b/demos/various/SB-CLIENT-32k-08070000-4k-2001E000/main.c @@ -18,6 +18,14 @@ #include "sbuser.h" +__attribute__((naked)) +void __crt0_vrq(int vrqn) { + + (void)vrqn; + + __sb_vrq_return(); +} + /* * Application entry point. */ @@ -30,6 +38,9 @@ int main(void) { while (true) { } #endif + __sb_vrq_seten(2); + __sb_vrq_setwt(2); + while (true) { msg_t msg = sbMsgWait(); printf("#1 Hello World (%u)!!\r\n", (unsigned)msg); diff --git a/os/sb/host/sbvrq.c b/os/sb/host/sbvrq.c index 94ddadf5c..004de22ce 100644 --- a/os/sb/host/sbvrq.c +++ b/os/sb/host/sbvrq.c @@ -55,6 +55,9 @@ __STATIC_FORCEINLINE void vrq_makectx(sb_class_t *sbp, uint32_t irqn = __CLZ(active_mask); sbp->vrq_wtmask &= ~(1U << irqn); + /* Disabling VRQs globally during processing.*/ + sbp->vrq_isr |= SB_VRQ_ISR_DISABLED; + /* Building the return context.*/ newctxp->r0 = irqn; newctxp->pc = sbp->sbhp->hdr_vrq;