diff --git a/py/qstrdefs.h b/py/qstrdefs.h
index 4a34010a129be7951b991c0d9b4d4442f84322e4..32f5b2ce0590ef4510b74b4ed670ff5fc2375ee5 100644
--- a/py/qstrdefs.h
+++ b/py/qstrdefs.h
@@ -385,6 +385,7 @@ Q(qstr_info)
 #if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0)
 Q(alloc_emergency_exception_buf)
 #endif
+Q(maximum recursion depth exceeded)
 
 Q(<module>)
 Q(<lambda>)
diff --git a/py/stackctrl.c b/py/stackctrl.c
index bf6a815af0e27f8efb0d98edd0c85b58b4436eca..7d7bbc1be13dc38534bd5b6b4eafabbfe3a97a6f 100644
--- a/py/stackctrl.c
+++ b/py/stackctrl.c
@@ -48,7 +48,8 @@ void mp_stack_set_limit(mp_uint_t limit) {
 
 void mp_stack_check(void) {
     if (mp_stack_usage() >= MP_STATE_VM(stack_limit)) {
-        nlr_raise(mp_obj_new_exception_msg(&mp_type_RuntimeError, "maximum recursion depth exceeded"));
+        nlr_raise(mp_obj_new_exception_arg1(&mp_type_RuntimeError,
+            MP_OBJ_NEW_QSTR(MP_QSTR_maximum_space_recursion_space_depth_space_exceeded)));
     }
 }