diff --git a/drivers/cc3000/src/ccspi.c b/drivers/cc3000/src/ccspi.c
index 68d2da7c192c8689af841a520205625cd90a3642..0e1ba7ad0c53043790828bff266a8d6f7117094f 100644
--- a/drivers/cc3000/src/ccspi.c
+++ b/drivers/cc3000/src/ccspi.c
@@ -34,13 +34,9 @@
 
 #include <string.h>
 
-#include "stm32f4xx_hal.h"
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/obj.h"
+#include "py/runtime.h"
 #include "pin.h"
 #include "led.h"
 #include "extint.h"
diff --git a/stmhal/Makefile b/stmhal/Makefile
index 422b31dfa31ca10687d9feb5a523d7a21cd6d11b..fe9e57a4479e6e88f7ff05e9741ef3966041db11 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -33,7 +33,6 @@ CROSS_COMPILE = arm-none-eabi-
 
 INC =  -I.
 INC += -I..
-INC += -I$(PY_SRC)
 INC += -I$(BUILD)
 INC += -I$(CMSIS_DIR)/inc
 INC += -I$(CMSIS_DIR)/devinc
diff --git a/stmhal/accel.c b/stmhal/accel.c
index 0af8c8fd4017e37d26d59e45980dbe2172336f7e..a61e8ef3eef9a2884eac4fd69b8b2da57294e04a 100644
--- a/stmhal/accel.c
+++ b/stmhal/accel.c
@@ -29,12 +29,8 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "i2c.h"
 #include "accel.h"
 
diff --git a/stmhal/adc.c b/stmhal/adc.c
index 6044931ec954be363917daafd4a6cd56f68ca8f6..cacfed7a8a6092feb8f2ade20f2cfb60f975657d 100644
--- a/stmhal/adc.c
+++ b/stmhal/adc.c
@@ -28,13 +28,9 @@
 #include <stm32f4xx_hal.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "nlr.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include "binary.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
+#include "py/binary.h"
 #include "adc.h"
 #include "pin.h"
 #include "genhdr/pins.h"
diff --git a/stmhal/boards/stm32f4xx_prefix.c b/stmhal/boards/stm32f4xx_prefix.c
index c200301726dfcffbab384a3ebcea192b3e9ab042..d22bfacadfa4e757491ea1f3d97c04a68850a5b5 100644
--- a/stmhal/boards/stm32f4xx_prefix.c
+++ b/stmhal/boards/stm32f4xx_prefix.c
@@ -1,15 +1,10 @@
 // stm32f4xx_prefix.c becomes the initial portion of the generated pins file.
 
 #include <stdio.h>
-#include <stdint.h>
 
-#include "stm32f4xx_hal.h"
-
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/obj.h"
 #include "pin.h"
+#include MICROPY_HAL_H
 
 #define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
 { \
diff --git a/stmhal/bufhelper.c b/stmhal/bufhelper.c
index 1f823ea96300629efec4bc84f041182c753dd979..57aef5a91e3e9cdee38fd5d87988ec908e4eb733 100644
--- a/stmhal/bufhelper.c
+++ b/stmhal/bufhelper.c
@@ -24,10 +24,7 @@
  * THE SOFTWARE.
  */
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/obj.h"
 #include "bufhelper.h"
 
 void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data) {
diff --git a/stmhal/can.c b/stmhal/can.c
index 118c4d8d906c62666bc6b9f45ec25e7be8809025..28f00c99408eaebca2bdee1fdbf4bfb7044d31c8 100644
--- a/stmhal/can.c
+++ b/stmhal/can.c
@@ -29,13 +29,9 @@
 #include <stdarg.h>
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "objtuple.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/objtuple.h"
+#include "py/runtime.h"
 #include "bufhelper.h"
 #include "can.h"
 #include "pybioctl.h"
diff --git a/stmhal/dac.c b/stmhal/dac.c
index d6b66688602b7fbab33c3d0fd03537062c1fb4d9..e8ed752c06b88880c4faf310370a92ab817b0b03 100644
--- a/stmhal/dac.c
+++ b/stmhal/dac.c
@@ -30,13 +30,8 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "parse.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "timer.h"
 #include "dac.h"
 #include "pin.h"
diff --git a/stmhal/diskio.c b/stmhal/diskio.c
index baebd279293e306b1755994a390f37f6bcf18e62..948297aa48aad82be4073abfc8055040a88b63dd 100644
--- a/stmhal/diskio.c
+++ b/stmhal/diskio.c
@@ -32,11 +32,7 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/runtime.h"
 #include "systick.h"
 #include "rtc.h"
 #include "storage.h"
diff --git a/stmhal/extint.c b/stmhal/extint.c
index a67af65b05320e95725aa5ffcfc1e49433710cb1..78bc17be0fd46e15cbaaff99e2ba1fbcba920f76 100644
--- a/stmhal/extint.c
+++ b/stmhal/extint.c
@@ -30,15 +30,10 @@
 
 #include <stm32f4xx_hal.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "gc.h"
-#include "obj.h"
-#include "runtime.h"
-#include "pfenv.h"
-
+#include "py/nlr.h"
+#include "py/runtime.h"
+#include "py/gc.h"
+#include "py/pfenv.h"
 #include "pin.h"
 #include "extint.h"
 
diff --git a/stmhal/ffconf.c b/stmhal/ffconf.c
index 8ed75434334c7104819370bee8d6f81b6beee429..0a4745462eb9aa5c082e0648d3a1cddd4ee82f08 100644
--- a/stmhal/ffconf.c
+++ b/stmhal/ffconf.c
@@ -26,10 +26,7 @@
 
 #include <string.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/obj.h"
 #include "ff.h"
 #include "ffconf.h"
 #include "fsusermount.h"
diff --git a/stmhal/file.c b/stmhal/file.c
index c4f4dace0dc8bf1c05717b40064abea631da837b..66bb51f49cdbd79cd3d07e0ef006d7258611d300 100644
--- a/stmhal/file.c
+++ b/stmhal/file.c
@@ -27,13 +27,9 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include "stream.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
+#include "py/stream.h"
 #include "file.h"
 #include "ff.h"
 
diff --git a/stmhal/fsusermount.c b/stmhal/fsusermount.c
index e6b915382af29d3de1efa15bc3f6559143b432bf..0cd36480e6e3cdac8b50fb7499843b8c448e1860 100644
--- a/stmhal/fsusermount.c
+++ b/stmhal/fsusermount.c
@@ -24,12 +24,8 @@
  * THE SOFTWARE.
  */
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "nlr.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "ff.h"
 #include "fsusermount.h"
 
diff --git a/stmhal/gccollect.c b/stmhal/gccollect.c
index e79dc38494bf3362ed45740f41d4761523290bef..fcbe10fec18ef87d2c07b8b4bc7b03edd670d797 100644
--- a/stmhal/gccollect.c
+++ b/stmhal/gccollect.c
@@ -27,11 +27,8 @@
 #include <stdio.h>
 #include <stdint.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "gc.h"
+#include "py/obj.h"
+#include "py/gc.h"
 #include "gccollect.h"
 #include MICROPY_HAL_H
 
diff --git a/stmhal/help.c b/stmhal/help.c
index 525f5b0f4bc05191f57587770afdfd5f6ab21eab..3d9656c63caef230599dcdb28da857caa434d102 100644
--- a/stmhal/help.c
+++ b/stmhal/help.c
@@ -26,11 +26,8 @@
 
 #include <stdio.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/nlr.h"
+#include "py/obj.h"
 
 STATIC const char *help_text =
 "Welcome to Micro Python!\n"
diff --git a/stmhal/i2c.c b/stmhal/i2c.c
index 7678e9a234822fe1d88f8297439ef085fd30c1a3..e4d406b4ab7c2e469579e96f72fd015712a89513 100644
--- a/stmhal/i2c.c
+++ b/stmhal/i2c.c
@@ -27,12 +27,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "pin.h"
 #include "genhdr/pins.h"
 #include "bufhelper.h"
diff --git a/stmhal/import.c b/stmhal/import.c
index 88ddaefacf8e554b9917ce3e880f17ad13117063..e94cf620e0e864835edda57ed7d928d1e8ab8fd8 100644
--- a/stmhal/import.c
+++ b/stmhal/import.c
@@ -25,12 +25,8 @@
  */
 
 #include <stdio.h>
-#include <stdint.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "lexer.h"
+#include "py/lexer.h"
 #include "ff.h"
 
 mp_import_stat_t mp_import_stat(const char *path) {
diff --git a/stmhal/input.c b/stmhal/input.c
index 9b67b641c640f859c92d5081b71d744840ec34e0..b735ca24924cfa085ca8ec0192ec093fdbd3c5f4 100644
--- a/stmhal/input.c
+++ b/stmhal/input.c
@@ -24,13 +24,8 @@
  * THE SOFTWARE.
  */
 
-#include <stdint.h>
-
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/nlr.h"
+#include "py/obj.h"
 #include "readline.h"
 #include "usb.h"
 
diff --git a/stmhal/irq.c b/stmhal/irq.c
index 286af73cc1bc905239835b64e154146a2089ce6d..d0d89b394f7a0f64532d959029cfdcae27dc44e2 100644
--- a/stmhal/irq.c
+++ b/stmhal/irq.c
@@ -24,11 +24,8 @@
  * THE SOFTWARE.
  */
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "nlr.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/nlr.h"
+#include "py/obj.h"
 #include "irq.h"
 
 #include MICROPY_HAL_H
diff --git a/stmhal/lcd.c b/stmhal/lcd.c
index dbe2be9ecc8f2a4dceb10d97f4ed12fdab8eb088..22e11d950226978cebf507271498400c7d821898 100644
--- a/stmhal/lcd.c
+++ b/stmhal/lcd.c
@@ -28,17 +28,11 @@
 #include <string.h>
 #include <stm32f4xx_hal.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 
 #if MICROPY_HW_HAS_LCD
 
-#include "qstr.h"
-#include "parse.h"
-#include "obj.h"
-#include "runtime.h"
-
 #include "pin.h"
 #include "genhdr/pins.h"
 #include "bufhelper.h"
diff --git a/stmhal/led.c b/stmhal/led.c
index 69d753cff86700b1c135f674d352dd64ac49a5dc..4a583d4cf7c5a897d7dfa103a3371f93711d05f7 100644
--- a/stmhal/led.c
+++ b/stmhal/led.c
@@ -27,12 +27,8 @@
 #include <stdio.h>
 #include <stm32f4xx_hal.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "timer.h"
 #include "led.h"
 #include "pin.h"
diff --git a/stmhal/lexerfatfs.c b/stmhal/lexerfatfs.c
index ea47aaf884947e93f87f30c8c0d063634aee5702..639cd1f2f1826a1fe26e0b4e8f290791dee06ecd 100644
--- a/stmhal/lexerfatfs.c
+++ b/stmhal/lexerfatfs.c
@@ -24,13 +24,9 @@
  * THE SOFTWARE.
  */
 
-#include <stdint.h>
 #include <stdio.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "lexer.h"
+#include "py/lexer.h"
 #include "lexerfatfs.h"
 #include "ff.h"
 
diff --git a/stmhal/main.c b/stmhal/main.c
index a946b86eea020f5b930465bcde7d116f3d1ac303..ae5c94b531320d5f23ac887b8a2b6aeba7532f87 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -27,21 +27,16 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "stm32f4xx_hal.h"
+#include "py/nlr.h"
+#include "py/lexer.h"
+#include "py/parse.h"
+#include "py/obj.h"
+#include "py/runtime.h"
+#include "py/stackctrl.h"
+#include "py/gc.h"
 
-#include "mpconfig.h"
-#include "misc.h"
 #include "systick.h"
 #include "pendsv.h"
-#include "qstr.h"
-#include "misc.h"
-#include "nlr.h"
-#include "lexer.h"
-#include "parse.h"
-#include "obj.h"
-#include "runtime.h"
-#include "stackctrl.h"
-#include "gc.h"
 #include "gccollect.h"
 #include "readline.h"
 #include "pyexec.h"
diff --git a/stmhal/modnetwork.c b/stmhal/modnetwork.c
index 21e279a99d013383ff70a7e9460f6dacbab53275..f1ca4a9546fac50479ac048cebc81b7baf443be1 100644
--- a/stmhal/modnetwork.c
+++ b/stmhal/modnetwork.c
@@ -29,13 +29,9 @@
 #include <string.h>
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "objlist.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/objlist.h"
+#include "py/runtime.h"
 #include "modnetwork.h"
 
 /// \module network - network configuration
diff --git a/stmhal/modnwcc3k.c b/stmhal/modnwcc3k.c
index 41358a06cbdb2e337dabbe6e594a44570fe4496c..63180caf7d52ae00d793579c4075c3aad4790504 100644
--- a/stmhal/modnwcc3k.c
+++ b/stmhal/modnwcc3k.c
@@ -35,16 +35,11 @@
 // CC3000 defines its own ENOBUFS (different to standard one!)
 #undef ENOBUFS
 
-#include "stm32f4xx_hal.h"
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "objtuple.h"
-#include "objlist.h"
-#include "stream.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/objtuple.h"
+#include "py/objlist.h"
+#include "py/stream.h"
+#include "py/runtime.h"
 #include "modnetwork.h"
 #include "pin.h"
 #include "genhdr/pins.h"
diff --git a/stmhal/modnwwiznet5k.c b/stmhal/modnwwiznet5k.c
index 4818ff9eb1355ff8136f5632e474adc320f037e4..896c4402d828743d7f07ff050a43abb4fb6e8682 100644
--- a/stmhal/modnwwiznet5k.c
+++ b/stmhal/modnwwiznet5k.c
@@ -29,15 +29,9 @@
 #include <string.h>
 #include <errno.h>
 
-#include "stm32f4xx_hal.h"
-
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "objlist.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/objlist.h"
+#include "py/runtime.h"
 #include "modnetwork.h"
 #include "pin.h"
 #include "genhdr/pins.h"
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c
index 03e65f1be039e2a10c40769579107130cd8cb642..91b9464713a9cc3f491334b7e423e9b01a4e275d 100644
--- a/stmhal/modpyb.c
+++ b/stmhal/modpyb.c
@@ -29,12 +29,9 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "nlr.h"
-#include "qstr.h"
-#include "obj.h"
-#include "gc.h"
+#include "py/nlr.h"
+#include "py/obj.h"
+#include "py/gc.h"
 #include "gccollect.h"
 #include "irq.h"
 #include "systick.h"
diff --git a/stmhal/modstm.c b/stmhal/modstm.c
index 960476fa95dbd3f4960efbd3342fe07bcc16d730..72f4c67a76966e040911e8a255ccf858f4683d01 100644
--- a/stmhal/modstm.c
+++ b/stmhal/modstm.c
@@ -29,11 +29,8 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/nlr.h"
+#include "py/obj.h"
 #include "portmodules.h"
 
 // To use compile-time constants we are restricted to 31-bit numbers (a small int,
diff --git a/stmhal/moduos.c b/stmhal/moduos.c
index b16891fec85c6e3f402c606d97ebe645b9bf6a3d..8706f4981657aaf4efe07e4ecad06408ba32cce6 100644
--- a/stmhal/moduos.c
+++ b/stmhal/moduos.c
@@ -27,12 +27,9 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "objtuple.h"
+#include "py/nlr.h"
+#include "py/obj.h"
+#include "py/objtuple.h"
 #include "systick.h"
 #include "rng.h"
 #include "storage.h"
diff --git a/stmhal/moduselect.c b/stmhal/moduselect.c
index b354e486e7f6a739b65c99f227ac01d2c9bed6bd..1adb6257f167e7faa06c7e4ad5cd6592e0cccba1 100644
--- a/stmhal/moduselect.c
+++ b/stmhal/moduselect.c
@@ -24,16 +24,12 @@
  * THE SOFTWARE.
  */
 
-#include <stdint.h>
 #include <stdio.h>
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "nlr.h"
-#include "qstr.h"
-#include "obj.h"
-#include "objlist.h"
+#include "py/nlr.h"
+#include "py/obj.h"
+#include "py/objlist.h"
 #include "pybioctl.h"
 #include MICROPY_HAL_H
 
diff --git a/stmhal/modusocket.c b/stmhal/modusocket.c
index c2246b3c4df205b2aa90ef77319bcee8a292181a..781720b53294a7128c673a65ad7d16f2e690e5df 100644
--- a/stmhal/modusocket.c
+++ b/stmhal/modusocket.c
@@ -25,18 +25,13 @@
  */
 
 #include <stdio.h>
-#include <stdint.h>
 #include <string.h>
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "objtuple.h"
-#include "objlist.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/objtuple.h"
+#include "py/objlist.h"
+#include "py/runtime.h"
 #include "modnetwork.h"
 
 /******************************************************************************/
diff --git a/stmhal/modutime.c b/stmhal/modutime.c
index 0bc3245c48cd26709f11b7d306053032f9b91b3a..b918b1e9a794dc0534624e0b2f1f14552b18a667 100644
--- a/stmhal/modutime.c
+++ b/stmhal/modutime.c
@@ -28,11 +28,8 @@
 #include <string.h>
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/nlr.h"
+#include "py/obj.h"
 #include "portmodules.h"
 #include "rtc.h"
 
diff --git a/stmhal/mphal.c b/stmhal/mphal.c
index 43e1b9ba367cca9d9ef2402ee9e97bd00fd1c62b..093690d594a6062203f54c6dd031eb3d9d87b763 100644
--- a/stmhal/mphal.c
+++ b/stmhal/mphal.c
@@ -1,10 +1,7 @@
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/nlr.h"
+#include "py/obj.h"
 #include "usb.h"
 #include "mphal.h"
 
diff --git a/stmhal/pendsv.c b/stmhal/pendsv.c
index e71836d0140e9bee6897f55321fe2b8d832e442d..c60d91381fd8177176a1b21af68670c7981574bd 100644
--- a/stmhal/pendsv.c
+++ b/stmhal/pendsv.c
@@ -27,11 +27,7 @@
 #include <stdlib.h>
 #include <stm32f4xx_hal.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/runtime.h"
 #include "pendsv.h"
 
 static void *pendsv_object = NULL;
diff --git a/stmhal/pin.c b/stmhal/pin.c
index 286e0992c09b753f4340716cf9186b3c14cfa569..b71c93efc35115c1b4b7f74adae609921af9b78a 100644
--- a/stmhal/pin.c
+++ b/stmhal/pin.c
@@ -28,14 +28,10 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include MICROPY_HAL_H
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "pin.h"
+#include MICROPY_HAL_H
 
 /// \moduleref pyb
 /// \class Pin - control I/O pins
diff --git a/stmhal/pin_defs_stmhal.c b/stmhal/pin_defs_stmhal.c
index c2409dc6c04ab20cb49cc269f1287059c6258028..6dfefb6bb395633e1af50ebc84b68a06a781665e 100644
--- a/stmhal/pin_defs_stmhal.c
+++ b/stmhal/pin_defs_stmhal.c
@@ -1,11 +1,6 @@
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include MICROPY_HAL_H
+#include "py/obj.h"
 #include "pin.h"
+#include MICROPY_HAL_H
 
 // Returns the pin mode. This value returned by this macro should be one of:
 // GPIO_MODE_INPUT, GPIO_MODE_OUTPUT_PP, GPIO_MODE_OUTPUT_OD,
diff --git a/stmhal/pin_named_pins.c b/stmhal/pin_named_pins.c
index 24b6f79b6c255583673198e9723aa1584a83dd92..420a5d9e0ac678025156f1950086d5a81d171832 100644
--- a/stmhal/pin_named_pins.c
+++ b/stmhal/pin_named_pins.c
@@ -25,16 +25,11 @@
  */
 
 #include <stdio.h>
-#include <stdint.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include MICROPY_HAL_H
+#include "py/runtime.h"
 #include "pin.h"
+#include MICROPY_HAL_H
 
 STATIC void pin_named_pins_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
     pin_named_pins_obj_t *self = self_in;
diff --git a/stmhal/printf.c b/stmhal/printf.c
index ca9b279cdb78c057fa60d2687b4af7336c950801..a239e898c96749255b73662bc8d08ea6307888ad 100644
--- a/stmhal/printf.c
+++ b/stmhal/printf.c
@@ -28,15 +28,12 @@
 #include <string.h>
 #include <stdarg.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "pfenv.h"
+#include "py/obj.h"
+#include "py/pfenv.h"
 #include "pybstdio.h"
 
 #if MICROPY_PY_BUILTINS_FLOAT
-#include "formatfloat.h"
+#include "py/formatfloat.h"
 #endif
 
 int pfenv_vprintf(const pfenv_t *pfenv, const char *fmt, va_list args);
diff --git a/stmhal/pybstdio.c b/stmhal/pybstdio.c
index bc9e5d921307ab4e37ca3ba1f18700ebb331244a..5597bbd689575f1b27d456f085682b8b0ae2621d 100644
--- a/stmhal/pybstdio.c
+++ b/stmhal/pybstdio.c
@@ -29,16 +29,12 @@
 #include <string.h>
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "misc.h"
-#include "obj.h"
-#include "stream.h"
-#include MICROPY_HAL_H
+#include "py/obj.h"
+#include "py/stream.h"
 #include "usb.h"
 #include "uart.h"
 #include "pybstdio.h"
+#include MICROPY_HAL_H
 
 // TODO make stdin, stdout and stderr writable objects so they can
 // be changed by Python code.  This requires some changes, as these
diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c
index f1e645447ce4506e22b8436a0fb1e3a4d5958ece..98cdb4ea7aa07d3fe0e16732ddf4946f4ec9f514 100644
--- a/stmhal/pyexec.c
+++ b/stmhal/pyexec.c
@@ -28,14 +28,13 @@
 #include <stdio.h>
 #include <stdint.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "obj.h"
-#include "parsehelper.h"
-#include "compile.h"
-#include "runtime.h"
-#include "repl.h"
-#include "gc.h"
+#include "py/nlr.h"
+#include "py/parsehelper.h"
+#include "py/compile.h"
+#include "py/runtime.h"
+#include "py/repl.h"
+#include "py/gc.h"
+#include "py/pfenv.h"
 #ifdef MICROPY_HAL_H
 #include MICROPY_HAL_H
 #endif
@@ -44,7 +43,6 @@
 #include "pyexec.h"
 #include "pybstdio.h"
 #include "genhdr/py-version.h"
-#include "pfenv.h"
 
 pyexec_mode_kind_t pyexec_mode_kind = PYEXEC_MODE_FRIENDLY_REPL;
 STATIC bool repl_display_debugging_info = 0;
diff --git a/stmhal/readline.c b/stmhal/readline.c
index f158ccb9006d02d5b3549ca0aa32af85ce65753e..aa9194a035c5b7af48775258ac3afdc5bd7d87a7 100644
--- a/stmhal/readline.c
+++ b/stmhal/readline.c
@@ -28,8 +28,8 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "misc.h"
+#include "py/mpconfig.h"
+#include "py/misc.h"
 #include "readline.h"
 #include "pybstdio.h"
 
diff --git a/stmhal/rng.c b/stmhal/rng.c
index ea636770c0f8b9bbf4b4158f236c8562c8d4752b..c2685ce2be92149758f1f65b99131cdc744e5980 100644
--- a/stmhal/rng.c
+++ b/stmhal/rng.c
@@ -28,10 +28,7 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/obj.h"
 #include "rng.h"
 
 #if MICROPY_HW_ENABLE_RNG
diff --git a/stmhal/rtc.c b/stmhal/rtc.c
index f58aa92733fe589376cab764982a8509a9c7fe03..82bb61bbff32f3a51cb2e183d83bb927de7d0bdb 100644
--- a/stmhal/rtc.c
+++ b/stmhal/rtc.c
@@ -28,11 +28,7 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/runtime.h"
 #include "rtc.h"
 
 /// \moduleref pyb
diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c
index 63a0bac96ec75d72335adaec3f7d7961d100f387..8c9febd9aaaa2519958dada25bcf775f34cf9939 100644
--- a/stmhal/sdcard.c
+++ b/stmhal/sdcard.c
@@ -28,12 +28,8 @@
 
 #include <stm32f4xx_hal.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "sdcard.h"
 #include "pin.h"
 #include "genhdr/pins.h"
diff --git a/stmhal/servo.c b/stmhal/servo.c
index 60ba217a95c4bab8221440f8984d627bcb667bf4..a9b37a54f34d86faf650b1e9b0334437939e3886 100644
--- a/stmhal/servo.c
+++ b/stmhal/servo.c
@@ -28,12 +28,8 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "timer.h"
 #include "servo.h"
 
diff --git a/stmhal/spi.c b/stmhal/spi.c
index 9e2aeffe06f955efc74d2ed4597419181708c744..364bf216918af9bd28384a9670ead419bdaaa1e7 100644
--- a/stmhal/spi.c
+++ b/stmhal/spi.c
@@ -27,12 +27,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "irq.h"
 #include "pin.h"
 #include "genhdr/pins.h"
diff --git a/stmhal/stm32f4xx_it.c b/stmhal/stm32f4xx_it.c
index eb65b1a5482c99773d4185398464b9e0aeb8db2f..17ca21f636f613d59d8680b07bd15762286e4db4 100644
--- a/stmhal/stm32f4xx_it.c
+++ b/stmhal/stm32f4xx_it.c
@@ -70,10 +70,7 @@
 #include "stm32f4xx_it.h"
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/obj.h"
 #include "extint.h"
 #include "timer.h"
 #include "uart.h"
diff --git a/stmhal/storage.c b/stmhal/storage.c
index 001d87afe0c40e15f4a280d6111a35bc3f14b956..be5e400ed720291f5be64829ea8a4e2cb6b7cbaf 100644
--- a/stmhal/storage.c
+++ b/stmhal/storage.c
@@ -28,11 +28,8 @@
 #include <string.h>
 #include <stm32f4xx_hal.h>
 
-#include "mpconfig.h"
-#include "misc.h"
+#include "py/obj.h"
 #include "systick.h"
-#include "qstr.h"
-#include "obj.h"
 #include "led.h"
 #include "flash.h"
 #include "storage.h"
diff --git a/stmhal/systick.c b/stmhal/systick.c
index fc462943f89c40abdbdd0908f3afc16e901f99bb..027e72a4143783f0ccf959c46f7650867e8d59ef 100644
--- a/stmhal/systick.c
+++ b/stmhal/systick.c
@@ -25,11 +25,8 @@
  */
 
 #include <stm32f4xx_hal.h>
-#include "mpconfig.h"
-#include "misc.h"
-#include "nlr.h"
-#include "qstr.h"
-#include "obj.h"
+
+#include "py/obj.h"
 #include "irq.h"
 #include "systick.h"
 
diff --git a/stmhal/timer.c b/stmhal/timer.c
index e95fb5f9ef104365ccb2d3b39bf40e10c6a57599..7adb98c826ec80042d4d126c2d220bdf1376642d 100644
--- a/stmhal/timer.c
+++ b/stmhal/timer.c
@@ -32,17 +32,13 @@
 #include "usbd_cdc_msc_hid.h"
 #include "usbd_cdc_interface.h"
 
-#include "nlr.h"
-#include "misc.h"
-#include "mpconfig.h"
-#include "qstr.h"
-#include "gc.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
+#include "py/gc.h"
+#include "py/pfenv.h"
 #include "timer.h"
 #include "servo.h"
 #include "pin.h"
-#include "pfenv.h"
 
 /// \moduleref pyb
 /// \class Timer - periodically call a function
diff --git a/stmhal/uart.c b/stmhal/uart.c
index 870fa49837c3eec956acbf1cde5f6796df95aefe..98be745938449ca7778805ebda29769f009dba7f 100644
--- a/stmhal/uart.c
+++ b/stmhal/uart.c
@@ -29,13 +29,9 @@
 #include <stdarg.h>
 #include <errno.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include "stream.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
+#include "py/stream.h"
 #include "uart.h"
 #include "pybioctl.h"
 #include MICROPY_HAL_H
diff --git a/stmhal/usb.c b/stmhal/usb.c
index 82f23c26f2b2eea39fea7a25319fd17e109ad986..50a5a7420d538eff62c66d3e18fd8e821c540ff6 100644
--- a/stmhal/usb.c
+++ b/stmhal/usb.c
@@ -34,12 +34,8 @@
 #include "usbd_cdc_interface.h"
 #include "usbd_msc_storage.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include "stream.h"
+#include "py/runtime.h"
+#include "py/stream.h"
 #include "bufhelper.h"
 #include "usb.h"
 #include "pybioctl.h"
diff --git a/stmhal/usbd_conf.h b/stmhal/usbd_conf.h
index 0f7104e2f76e9c05e4e47920b01dd696a2c48a6a..fc8015f318550bdc1fec41851f2f4ab71e7201c6 100644
--- a/stmhal/usbd_conf.h
+++ b/stmhal/usbd_conf.h
@@ -39,7 +39,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "mpconfig.h"
+#include "py/mpconfig.h"
 
 /* Exported types ------------------------------------------------------------*/
 /* Exported constants --------------------------------------------------------*/
diff --git a/stmhal/usbd_msc_storage.c b/stmhal/usbd_msc_storage.c
index c0e4468362e22313f2c95e7e083a2b06eaba8074..04a2b53ae9841d9483fd7b1b254dd67034667760 100644
--- a/stmhal/usbd_msc_storage.c
+++ b/stmhal/usbd_msc_storage.c
@@ -34,7 +34,7 @@
 #include "usbd_cdc_msc_hid.h"
 #include "usbd_msc_storage.h"
 
-#include "misc.h"
+#include "py/misc.h"
 #include "storage.h"
 #include "diskio.h"
 #include "sdcard.h"
diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c
index 2bcf7b8023854ad1fcc746054a6c2628acfa222b..69a636ceac57aa74667da80c98083a90c2615664 100644
--- a/stmhal/usrsw.c
+++ b/stmhal/usrsw.c
@@ -28,11 +28,7 @@
 
 #include "stm32f4xx_hal.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/runtime.h"
 #include "extint.h"
 #include "pin.h"
 #include "genhdr/pins.h"