diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h
index 3f36831997ac9ae5ccb3f2eb12ca3af1a55d16fb..2186e2ed649685b805fb2df2c9c2beb2f303ba65 100644
--- a/stmhal/mpconfigport.h
+++ b/stmhal/mpconfigport.h
@@ -123,6 +123,7 @@
 #define MICROPY_PY_UTIME_MP_HAL     (1)
 #define MICROPY_PY_MACHINE          (1)
 #define MICROPY_PY_MACHINE_PULSE    (1)
+#define MICROPY_PY_MACHINE_PIN_MAKE_NEW mp_pin_make_new
 #define MICROPY_PY_MACHINE_I2C      (1)
 #define MICROPY_PY_MACHINE_I2C_MAKE_NEW machine_hard_i2c_make_new
 #define MICROPY_PY_MACHINE_SPI      (1)
diff --git a/stmhal/pin.c b/stmhal/pin.c
index 29370e6a2cc13a68d1ab1c4cbd70b9c5ab2ae5e9..845126e28e84250275e1870daaef454cb0f70cc6 100644
--- a/stmhal/pin.c
+++ b/stmhal/pin.c
@@ -245,7 +245,7 @@ STATIC mp_obj_t pin_obj_init_helper(const pin_obj_t *pin, mp_uint_t n_args, cons
 /// \classmethod \constructor(id, ...)
 /// Create a new Pin object associated with the id.  If additional arguments are given,
 /// they are used to initialise the pin.  See `init`.
-STATIC mp_obj_t pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
+mp_obj_t mp_pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
     mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
 
     // Run an argument through the mapper and return the result.
@@ -567,7 +567,7 @@ const mp_obj_type_t pin_type = {
     { &mp_type_type },
     .name = MP_QSTR_Pin,
     .print = pin_print,
-    .make_new = pin_make_new,
+    .make_new = mp_pin_make_new,
     .call = pin_call,
     .protocol = &pin_pin_p,
     .locals_dict = (mp_obj_t)&pin_locals_dict,