diff --git a/tests/pyb/rtc.py b/tests/pyb/rtc.py
index 001553ac31c6d077fd06fa9ba941eedd806a3158..09af52629f578ffb9236d5b1912bc7d618be9282 100644
--- a/tests/pyb/rtc.py
+++ b/tests/pyb/rtc.py
@@ -1,4 +1,4 @@
-import pyb
+import pyb, stm
 from pyb import RTC
 
 rtc = RTC()
@@ -49,3 +49,30 @@ set_and_print_calib(-511)
 
 # restore existing calibration value
 rtc.calibration(cal_tmp)
+
+# Check register settings for wakeup
+def set_and_print_wakeup(ms):
+    try:
+        rtc.wakeup(ms)
+        wucksel = stm.mem32[stm.RTC + stm.RTC_CR] & 7
+        wut = stm.mem32[stm.RTC + stm.RTC_WUTR] & 0xffff
+    except ValueError:
+        wucksel = -1
+        wut = -1
+    print((wucksel, wut))
+
+set_and_print_wakeup(0)
+set_and_print_wakeup(1)
+set_and_print_wakeup(4000)
+set_and_print_wakeup(4001)
+set_and_print_wakeup(8000)
+set_and_print_wakeup(8001)
+set_and_print_wakeup(16000)
+set_and_print_wakeup(16001)
+set_and_print_wakeup(32000)
+set_and_print_wakeup(32001)
+set_and_print_wakeup(0x10000*1000)
+set_and_print_wakeup(0x10001*1000)
+set_and_print_wakeup(0x1ffff*1000)
+set_and_print_wakeup(0x20000*1000)
+set_and_print_wakeup(0x20001*1000) # exception
diff --git a/tests/pyb/rtc.py.exp b/tests/pyb/rtc.py.exp
index d8d5e0f0a95f1c5b9c5d7914c090f5863f8ced96..7d3aaf6af7d41cc014069938b178e30a998401be 100644
--- a/tests/pyb/rtc.py.exp
+++ b/tests/pyb/rtc.py.exp
@@ -23,3 +23,18 @@
 -123
 -510
 -511
+(3, 0)
+(3, 15)
+(3, 65535)
+(2, 32775)
+(2, 65535)
+(1, 32771)
+(1, 65535)
+(0, 32769)
+(0, 65535)
+(4, 31)
+(4, 65535)
+(6, 0)
+(6, 65534)
+(6, 65535)
+(-1, -1)