diff --git a/stmhal/hal/src/stm32f4xx_hal.c b/stmhal/hal/src/stm32f4xx_hal.c
index 6c076c358b95506c55d5f59774175475cf1d7213..0040658a0ccffd0fbd92da5663c35062a765d725 100644
--- a/stmhal/hal/src/stm32f4xx_hal.c
+++ b/stmhal/hal/src/stm32f4xx_hal.c
@@ -93,7 +93,7 @@
 #define CMPCR_CMP_PD_BB           (PERIPH_BB_BASE + (CMPCR_OFFSET * 32) + (CMP_PD_BitNumber * 4))
 /* Private macro -------------------------------------------------------------*/
 /* Private variables ---------------------------------------------------------*/
-static __IO uint32_t uwTick;
+__IO uint32_t uwTick;
 
 /* Private function prototypes -----------------------------------------------*/
 /* Private functions ---------------------------------------------------------*/
diff --git a/stmhal/stm32f4xx_it.c b/stmhal/stm32f4xx_it.c
index 4bd13c05cba311b0796da2c9b5f2cca03b98a402..74fdf53d1e6bf0df13feba1779233920c39569e5 100644
--- a/stmhal/stm32f4xx_it.c
+++ b/stmhal/stm32f4xx_it.c
@@ -173,7 +173,11 @@ void PendSV_Handler(void) {
   * @retval None
   */
 void SysTick_Handler(void) {
-    HAL_IncTick();
+    // Instead of calling HAL_IncTick we do the increment here of the counter.
+    // This is purely for efficiency, since SysTick is called 1000 times per
+    // second at the highest interrupt priority.
+    extern __IO uint32_t uwTick;
+    uwTick += 1;
 
     // Read the systick control regster. This has the side effect of clearing
     // the COUNTFLAG bit, which makes the logic in sys_tick_get_microseconds
diff --git a/stmhal/systick.c b/stmhal/systick.c
index b2381d08eba4357ff02739f5da130dcd266914ee..b4dd68ffece0718db420d2580f1f988c6212e862 100644
--- a/stmhal/systick.c
+++ b/stmhal/systick.c
@@ -33,6 +33,18 @@
 #include "irq.h"
 #include "systick.h"
 
+// We provide our own version of HAL_Delay that calls __WFI while waiting, in
+// order to reduce power consumption.
+void HAL_Delay(uint32_t Delay) {
+    extern __IO uint32_t uwTick;
+    uint32_t start = uwTick;
+    // Wraparound of tick is taken care of by 2's complement arithmetic.
+    while (uwTick - start < Delay) {
+        // Enter sleep mode, waiting for (at least) the SysTick interrupt.
+        __WFI();
+    }
+}
+
 bool sys_tick_has_passed(uint32_t start_tick, uint32_t delay_ms) {
     return HAL_GetTick() - start_tick >= delay_ms;
 }