diff --git a/py/defaultconfig.h b/py/defaultconfig.h
deleted file mode 100644
index 9829bf707dfe096fd0744c0d630016672c5f767d..0000000000000000000000000000000000000000
--- a/py/defaultconfig.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file contains default configuration settings for MicroPython.
-// You can override any of these options in mpconfig.h for your port.
-
-// Whether to collect memory allocation stats
-#ifndef MICROPY_MEM_STATS
-#define MICROPY_MEM_STATS (1)
-#endif
diff --git a/py/malloc.c b/py/malloc.c
index 1765eb6743bf7e8a34bdd57d495c1d62ae981a92..4f01dc63f5208ccba6678b90fbf5f6a9999b4367 100644
--- a/py/malloc.c
+++ b/py/malloc.c
@@ -3,7 +3,6 @@
 
 #include "misc.h"
 #include "mpconfig.h"
-#include "defaultconfig.h"
 
 #if MICROPY_MEM_STATS
 static int total_bytes_allocated = 0;
diff --git a/py/mpconfig.h b/py/mpconfig.h
new file mode 100644
index 0000000000000000000000000000000000000000..17c5a770c4967af083a5479cfece9d5c064653c4
--- /dev/null
+++ b/py/mpconfig.h
@@ -0,0 +1,13 @@
+// This file contains default configuration settings for MicroPython.
+// You can override any of these options using mpconfigport.h file located
+// in a directory of your port.
+
+#include <mpconfigport.h>
+
+// Any options not explicitly set in mpconfigport.h will get default
+// values below.
+
+// Whether to collect memory allocation stats
+#ifndef MICROPY_MEM_STATS
+#define MICROPY_MEM_STATS (1)
+#endif
diff --git a/stm/Makefile b/stm/Makefile
index 018d31f491ae6cf0ade51970ef2b9c05923eb5e8..d6c77e2bd7258b5f1317ca48998463c3b42ced8c 100644
--- a/stm/Makefile
+++ b/stm/Makefile
@@ -187,7 +187,7 @@ $(BUILD)/%.o: $(PYSRC)/%.s
 $(BUILD)/%.o: $(PYSRC)/%.S
 	$(CC) $(CFLAGS) -c -o $@ $<
 
-$(BUILD)/%.o: $(PYSRC)/%.c mpconfig.h
+$(BUILD)/%.o: $(PYSRC)/%.c mpconfigport.h
 	$(CC) $(CFLAGS) -c -o $@ $<
 
 $(BUILD)/emitnthumb.o: $(PYSRC)/emitnative.c $(PYSRC)/emit.h
diff --git a/stm/mpconfig.h b/stm/mpconfigport.h
similarity index 96%
rename from stm/mpconfig.h
rename to stm/mpconfigport.h
index 1f9529e11ba8df1afdb692e129061534878b9870..4cea332f3977f5c3206d5ee85523c5e8a08684e8 100644
--- a/stm/mpconfig.h
+++ b/stm/mpconfigport.h
@@ -1,3 +1,5 @@
+#include <stdint.h>
+
 // options to control how Micro Python is built
 
 #define MICROPY_ENABLE_FLOAT        (1)
diff --git a/unix/Makefile b/unix/Makefile
index 271cf226542931e4636133bf3495f08aa8f000f2..fd5b6b43e0fc0928f7eb5be508e7fbaaa3fedcbb 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -79,7 +79,7 @@ $(BUILD)/%.o: %.c
 $(BUILD)/%.o: $(PYSRC)/%.S
 	$(CC) $(CFLAGS) -c -o $@ $<
 
-$(BUILD)/%.o: $(PYSRC)/%.c mpconfig.h
+$(BUILD)/%.o: $(PYSRC)/%.c mpconfigport.h
 	$(CC) $(CFLAGS) -c -o $@ $<
 
 $(BUILD)/emitnx64.o: $(PYSRC)/emitnative.c $(PYSRC)/emit.h
@@ -92,7 +92,7 @@ $(BUILD)/emitnthumb.o: $(PYSRC)/emitnative.c $(PYSRC)/emit.h
 $(BUILD)/vm.o: $(PYSRC)/vm.c
 	$(CC) $(CFLAGS) -O3 -c -o $@ $<
 
-$(BUILD)/main.o: mpconfig.h
+$(BUILD)/main.o: mpconfigport.h
 $(BUILD)/parse.o: $(PYSRC)/grammar.h
 $(BUILD)/compile.o: $(PYSRC)/grammar.h
 $(BUILD)/emitcpy.o: $(PYSRC)/emit.h
diff --git a/unix/mpconfig.h b/unix/mpconfigport.h
similarity index 100%
rename from unix/mpconfig.h
rename to unix/mpconfigport.h