diff --git a/.clang b/.clang
index 95c5782d783672d29161b192ae1f84d425622529..287a1dfd9a103dcf9c81e8ef92f8027260cdecab 100644
--- a/.clang
+++ b/.clang
@@ -1 +1 @@
-flags = -DBOARD_CARD10=1 -D_FILE_OFFSET_BITS=64 -DTARGET=32665 -DTARGET_REV=0x4131 -Ihw-tests/bmatest -Ihw-tests/bmetest -Ihw-tests/ecgtest -Ihw-tests/hello-freertos -Ihw-tests/hello-freertos/./ -Ihw-tests/hello-world -Ihw-tests/imutest -Ihw-tests/ips -Ilib/./card10/./ -Ilib/card10 -Ilib/./gfx/./ -Ilib/gfx -Ilib/./gfx/./Fonts/ -Ilib/./gfx/./GUI_DEV/ -Ilib/./gfx/./LCD/ -Ilib/sdk/Libraries/Boards/card10 -Ilib/./sdk/./Libraries/Boards/card10/../Include/ -Ilib/./sdk/./Libraries/Boards/card10/./Include/ -Ilib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665 -Ilib/./sdk/./Libraries/FreeRTOS/../FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/ -Ilib/./sdk/./Libraries/FreeRTOS/./Source/include/ -Ilib/./sdk/./Libraries/FreeRTOS/./Source/portable/GCC/ARM_CM4F/ -Ilib/sdk/Libraries/MAX32665PeriphDriver -Ilib/./sdk/./Libraries/MAX32665PeriphDriver/../CMSIS/Device/Maxim/MAX32665/Include/ -Ilib/./sdk/./Libraries/MAX32665PeriphDriver/../CMSIS/Include/ -Ilib/./sdk/./Libraries/MAX32665PeriphDriver/Include/ -Ilib/vendor/Bosch/BHy1 -Ilib/./vendor/Bosch/BHy1/../../../card10/ -Ilib/./vendor/Bosch/BHy1/./driver/inc/ -Ilib/./vendor/Bosch/BHy1/./examples/firmware/ -Ilib/./vendor/Bosch/BMA400/./ -Ilib/vendor/Bosch/BMA400 -Ilib/./vendor/Bosch/BME680/./ -Ilib/vendor/Bosch/BME680 -Ilib/./vendor/Maxim/MAX77650/./ -Ilib/vendor/Maxim/MAX77650
+flags = -DBOARD_CARD10=1 -D_FILE_OFFSET_BITS=64 -DTARGET=32665 -DTARGET_REV=0x4131 -Ibuild/../hw-tests/api-demo -Ibuild/hw-tests/api-demo/ -Ibuild/hw-tests/api-demo/53736c5@@api-demo-core0.elf@exe -Ibuild/hw-tests/api-demo/53736c5@@api-demo-core1.elf@exe -Ibuild/../hw-tests/bmatest -Ibuild/hw-tests/bmatest/ -Ibuild/hw-tests/bmatest/9cb7b92@@bmatest.elf@exe -Ibuild/../hw-tests/bmetest -Ibuild/hw-tests/bmetest/ -Ibuild/hw-tests/bmetest/6886391@@bmetest.elf@exe -Ibuild/../hw-tests/dual-core -Ibuild/hw-tests/dual-core/ -Ibuild/hw-tests/dual-core/b5198ad@@dual-core0.elf@exe -Ibuild/hw-tests/dual-core/b5198ad@@dual-core1.elf@exe -Ibuild/../hw-tests/ecgtest -Ibuild/hw-tests/ecgtest/ -Ibuild/hw-tests/ecgtest/8ae72c4@@ecgtest.elf@exe -Ibuild/../hw-tests/hello-freertos -Ibuild/../hw-tests/hello-freertos/./ -Ibuild/hw-tests/hello-freertos/ -Ibuild/hw-tests/hello-freertos/./ -Ibuild/hw-tests/hello-freertos/b7270e9@@freertos-sdk@sta -Ibuild/hw-tests/hello-freertos/b7270e9@@hello-freertos.elf@exe -Ibuild/../hw-tests/hello-world -Ibuild/hw-tests/hello-world/ -Ibuild/hw-tests/hello-world/96b467b@@hello-world.elf@exe -Ibuild/../hw-tests/imutest -Ibuild/hw-tests/imutest/ -Ibuild/hw-tests/imutest/438301c@@imutest.elf@exe -Ibuild/../hw-tests/ips -Ibuild/hw-tests/ips/ -Ibuild/hw-tests/ips/3a8d6c1@@ips.elf@exe -Ibuild/../hw-tests/upy-minimal -Ibuild/hw-tests/upy-minimal/ -Ibuild/hw-tests/upy-minimal/59d35c7@@micropython@sta -Ibuild/hw-tests/upy-minimal/59d35c7@@upy-minimal.elf@exe -Ibuild/../lib/./card10/./ -Ibuild/../lib/card10 -Ibuild/lib/./card10/ -Ibuild/lib/./card10/./ -Ibuild/lib/./card10/7eaaaa5@@card10@sta -Ibuild/../lib/./gfx/./ -Ibuild/../lib/gfx -Ibuild/lib/./gfx/ -Ibuild/lib/./gfx/./ -Ibuild/lib/./gfx/2308dff@@gfx@sta -Ibuild/../lib/./gfx/./Fonts/ -Ibuild/../lib/./gfx/./GUI_DEV/ -Ibuild/../lib/./gfx/./LCD/ -Ibuild/../lib/./micropython/./micropython/ -Ibuild/../lib/./micropython/./micropython/extmod/ -Ibuild/../lib/./micropython/./micropython/lib/utils -Ibuild/../lib/sdk/Libraries/Boards/card10 -Ibuild/lib/./sdk/./Libraries/Boards/card10/ -Ibuild/lib/./sdk/./Libraries/Boards/card10/9eeeac4@@board-card10@sta -Ibuild/../lib/./sdk/./Libraries/Boards/card10/../Include/ -Ibuild/../lib/./sdk/./Libraries/Boards/card10/./Include/ -Ibuild/../lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665 -Ibuild/lib/./sdk/./Libraries/CMSIS/Device/Maxim/MAX32665/ -Ibuild/lib/./sdk/./Libraries/CMSIS/Device/Maxim/MAX32665/a500f70@@max32665-startup-core0@sta -Ibuild/lib/./sdk/./Libraries/CMSIS/Device/Maxim/MAX32665/a500f70@@max32665-startup-core1@sta -Ibuild/lib/./sdk/./Libraries/CMSIS/Device/Maxim/MAX32665/a500f70@@max32665-startup@sta -Ibuild/../lib/./sdk/./Libraries/FreeRTOS/../FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/ -Ibuild/../lib/./sdk/./Libraries/FreeRTOS/./Source/include/ -Ibuild/../lib/./sdk/./Libraries/FreeRTOS/./Source/portable/GCC/ARM_CM4F/ -Ibuild/../lib/sdk/Libraries/MAX32665PeriphDriver -Ibuild/lib/./sdk/./Libraries/MAX32665PeriphDriver/ -Ibuild/lib/./sdk/./Libraries/MAX32665PeriphDriver/0d96707@@PeriphDriver@sta -Ibuild/../lib/./sdk/./Libraries/MAX32665PeriphDriver/../CMSIS/Device/Maxim/MAX32665/Include/ -Ibuild/../lib/./sdk/./Libraries/MAX32665PeriphDriver/../CMSIS/Include/ -Ibuild/../lib/./sdk/./Libraries/MAX32665PeriphDriver/Include/ -Ibuild/../lib/vendor/Bosch/BHy1 -Ibuild/lib/./vendor/Bosch/BHy1/ -Ibuild/lib/./vendor/Bosch/BHy1/6298ab9@@bhy1@sta -Ibuild/../lib/./vendor/Bosch/BHy1/../../../card10/ -Ibuild/lib/./vendor/Bosch/BHy1/../../../card10/ -Ibuild/../lib/./vendor/Bosch/BHy1/./driver/inc/ -Ibuild/../lib/./vendor/Bosch/BHy1/./examples/firmware/ -Ibuild/../lib/./vendor/Bosch/BMA400/./ -Ibuild/../lib/vendor/Bosch/BMA400 -Ibuild/lib/./vendor/Bosch/BMA400/ -Ibuild/lib/./vendor/Bosch/BMA400/./ -Ibuild/lib/./vendor/Bosch/BMA400/b6b0216@@bma400@sta -Ibuild/../lib/./vendor/Bosch/BME680/./ -Ibuild/../lib/vendor/Bosch/BME680 -Ibuild/lib/./vendor/Bosch/BME680/ -Ibuild/lib/./vendor/Bosch/BME680/./ -Ibuild/lib/./vendor/Bosch/BME680/ef6f079@@bme680@sta -Ibuild/../lib/./vendor/Maxim/MAX77650/./ -Ibuild/../lib/vendor/Maxim/MAX77650 -Ibuild/lib/./vendor/Maxim/MAX77650/ -Ibuild/lib/./vendor/Maxim/MAX77650/./ -Ibuild/lib/./vendor/Maxim/MAX77650/cc369b8@@max77650@sta
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000000000000000000000000000000000..430906d70e2d2a88ccc7540524f9ae9a94d2fb97
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "lib/micropython/micropython"]
+	path = lib/micropython/micropython
+	url = https://github.com/micropython/micropython.git
diff --git a/bootstrap.sh b/bootstrap.sh
index 34e4b03c050407a129e71f3e98b935af36d07f19..1363d4ebe413a252ba8e7e540405a63458320c0a 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,10 +1,10 @@
 #!/bin/sh
 set -xe
 
-cd "$(dirname "$0")" || exit 1
+cd "$(dirname "$0")"
 test -d build/ && rm -r build/
 
-git submodule update --init --recursive
+git submodule update --init ./lib/micropython
 meson --cross-file card10-cross.ini build/
 
 set +x
diff --git a/epicardium/main.c b/epicardium/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..cb2051e3dc996aa63dd66e9d242bd45dddab8427
--- /dev/null
+++ b/epicardium/main.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include "card10.h"
+
+int main(void)
+{
+	card10_init();
+	card10_diag();
+
+	printf("Staring core1 payload ...\n");
+	core1_start();
+}
diff --git a/epicardium/meson.build b/epicardium/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..51cc66740759e53e22892ffe8bda02db19e857af
--- /dev/null
+++ b/epicardium/meson.build
@@ -0,0 +1,19 @@
+name = 'epicardium'
+
+elf = executable(
+  name + '.elf',
+  'main.c',
+  dependencies: [libcard10, max32665_startup_core0],
+  link_whole: [max32665_startup_core0_lib, board_card10_lib],
+  link_args: [
+    '-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
+  ],
+)
+
+custom_target(
+  name + '.bin',
+  build_by_default: true,
+  output: name + '.bin',
+  input: elf,
+  command: [build_image, '@INPUT@', '@OUTPUT0@'],
+)
diff --git a/hw-tests/meson.build b/hw-tests/meson.build
index 1c04f9e686ffbd17c7c3023fc443b3309beb379f..0523f5006d3e9a55b000f276564ad5a052db24de 100644
--- a/hw-tests/meson.build
+++ b/hw-tests/meson.build
@@ -7,3 +7,4 @@ subdir('hello-freertos/')
 subdir('hello-world/')
 subdir('imutest/')
 subdir('ips/')
+subdir('upy-minimal/')
diff --git a/hw-tests/upy-minimal/.gdbinit b/hw-tests/upy-minimal/.gdbinit
new file mode 100644
index 0000000000000000000000000000000000000000..51a2201ec7c7632523f9b780ea6e46331a25205b
--- /dev/null
+++ b/hw-tests/upy-minimal/.gdbinit
@@ -0,0 +1,2 @@
+file ../../build/hw-tests/upy-minimal/upy-minimal.elf
+source ../../.gdbinit
diff --git a/hw-tests/upy-minimal/main.c b/hw-tests/upy-minimal/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..22d88bdfe0589527c7761207fb5c7a5dd46f85a8
--- /dev/null
+++ b/hw-tests/upy-minimal/main.c
@@ -0,0 +1,72 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "py/compile.h"
+#include "py/runtime.h"
+#include "py/repl.h"
+#include "py/gc.h"
+#include "py/mperrno.h"
+#include "lib/utils/pyexec.h"
+#include "leds.h"
+
+static char *stack_top;
+
+#if MICROPY_ENABLE_GC
+static char heap[4096];
+#endif
+
+int mp_hal_stdin_rx_chr(void);
+
+int main(int argc, char **argv) {
+    int stack_dummy;
+    stack_top = (char*)&stack_dummy;
+    leds_init();
+
+    #if MICROPY_ENABLE_GC
+    gc_init(heap, heap + sizeof(heap));
+    #endif
+
+    mp_init();
+    pyexec_friendly_repl();
+    mp_deinit();
+    return 0;
+}
+
+void gc_collect(void) {
+    // WARNING: This gc_collect implementation doesn't try to get root
+    // pointers from CPU registers, and thus may function incorrectly.
+    void *dummy;
+    gc_collect_start();
+    gc_collect_root(&dummy, ((mp_uint_t)stack_top - (mp_uint_t)&dummy) / sizeof(mp_uint_t));
+    gc_collect_end();
+    gc_dump_info();
+}
+
+mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
+    mp_raise_OSError(MP_ENOENT);
+}
+
+mp_import_stat_t mp_import_stat(const char *path) {
+    return MP_IMPORT_STAT_NO_EXIST;
+}
+
+mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
+    return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
+
+void nlr_jump_fail(void *val) {
+    while (1);
+}
+
+void NORETURN __fatal_error(const char *msg) {
+    while (1);
+}
+
+#ifndef NDEBUG
+void MP_WEAK __assert_func(const char *file, int line, const char *func, const char *expr) {
+    printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
+    __fatal_error("Assertion failed");
+}
+#endif
diff --git a/hw-tests/upy-minimal/meson.build b/hw-tests/upy-minimal/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..b38cf95235fb7d76a5952767896937438fd8db45
--- /dev/null
+++ b/hw-tests/upy-minimal/meson.build
@@ -0,0 +1,62 @@
+name = 'upy-minimal'
+
+modsrc = files(
+  'modules/buzzer.c',
+  'modules/leds.c',
+  'modules/utime.c',
+)
+
+#################################
+# MicroPython Generated Headers #
+#################################
+
+version_h = custom_target(
+  'mpversion.h',
+  output: 'mpversion.h',
+  command: [micropython_gen_version, '@OUTPUT@'],
+)
+
+modules_h = custom_target(
+  'moduledefs.h',
+  output: 'moduledefs.h',
+  input: [micropython_sources, modsrc],
+  command: [micropython_gen_modules, '@OUTPUT@', '@INPUT@'],
+)
+
+qstr_h = custom_target(
+  'qstrdefs.generated.h',
+  output: 'qstrdefs.generated.h',
+  input: ['modules/qstrdefs.h', micropython_sources],
+  depends: [modules_h, version_h],
+  command: [micropython_gen_qstr, meson.current_source_dir(), '@OUTPUT@', '@INPUT@'],
+)
+
+###################
+# MicroPython Lib #
+###################
+
+upy = static_library(
+  'micropython',
+  micropython_sources,
+  micropython_additional_sources,
+  modules_h,
+  qstr_h,
+  version_h,
+  include_directories: micropython_includes,
+)
+
+executable(
+  name + '.elf',
+  'main.c',
+  'uart.c',
+  'systick.c',
+  modsrc,
+  qstr_h,
+  include_directories: micropython_includes,
+  dependencies: [libcard10, max32665_startup],
+  link_whole: [max32665_startup_lib, board_card10_lib],
+  link_with: upy,
+  link_args: [
+    '-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
+  ],
+)
diff --git a/hw-tests/upy-minimal/modules/buzzer.c b/hw-tests/upy-minimal/modules/buzzer.c
new file mode 100644
index 0000000000000000000000000000000000000000..e2c8fcaecbcaf0570121921b86c41c6dd6aea3e7
--- /dev/null
+++ b/hw-tests/upy-minimal/modules/buzzer.c
@@ -0,0 +1,44 @@
+#include "py/obj.h"
+#include "py/runtime.h"
+#include "py/builtin.h"
+#include <stdio.h>
+#include "gpio.h"
+
+static const gpio_cfg_t motor_pin = {
+	PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE
+};
+
+STATIC mp_obj_t buzzer_set(mp_obj_t state_obj)
+{
+	if (state_obj == mp_const_true) {
+		printf("Buzzer ON!\n");
+		GPIO_OutSet(&motor_pin);
+	} else if (state_obj == mp_const_false){
+		printf("Buzzer OFF!\n");
+		GPIO_OutClr(&motor_pin);
+	} else {
+		mp_raise_TypeError("expected bool");
+	}
+	return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(buzzer_set_obj, buzzer_set);
+
+// Define all properties of the example module.
+// Table entries are key/value pairs of the attribute name (a string)
+// and the MicroPython object reference.
+// All identifiers and strings are written as MP_QSTR_xxx and will be
+// optimized to word-sized integers by the build system (interned strings).
+STATIC const mp_rom_map_elem_t buzzer_module_globals_table[] = {
+	{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_buzzer) },
+	{ MP_ROM_QSTR(MP_QSTR_set), MP_ROM_PTR(&buzzer_set_obj) },
+};
+STATIC MP_DEFINE_CONST_DICT(buzzer_module_globals, buzzer_module_globals_table);
+
+// Define module object.
+const mp_obj_module_t buzzer_module = {
+	.base = { &mp_type_module },
+	.globals = (mp_obj_dict_t*)&buzzer_module_globals,
+};
+
+// Register the module to make it available in Python
+MP_REGISTER_MODULE(MP_QSTR_buzzer, buzzer_module, MODULE_BUZZER_ENABLED);
diff --git a/hw-tests/upy-minimal/modules/leds.c b/hw-tests/upy-minimal/modules/leds.c
new file mode 100644
index 0000000000000000000000000000000000000000..f7a670fe974129c8154935736bbe300e85182470
--- /dev/null
+++ b/hw-tests/upy-minimal/modules/leds.c
@@ -0,0 +1,63 @@
+#include "py/obj.h"
+#include "py/runtime.h"
+#include "py/builtin.h"
+#include <stdio.h>
+
+STATIC mp_obj_t mp_leds_set(size_t n_args, const mp_obj_t *args)
+{
+	assert (n_args == 4);
+	int led = mp_obj_get_int (args[0]);
+	int r = mp_obj_get_int (args[1]);
+	int g = mp_obj_get_int (args[2]);
+	int b = mp_obj_get_int (args[3]);
+
+	if ( (0 > led || 256 < led) &&
+	     (0 >   r || 256 <   r) &&
+	     (0 >   g || 256 <   g) &&
+	     (0 >   b || 256 <   b) )
+	{
+		mp_raise_ValueError("out of bounds");
+	}
+	printf("Set %u to (%x %x %x)\n", led, r, g, b);
+	leds_set (led, r, g, b);
+	leds_update ();
+
+	return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(leds_set_obj, 4, 4, mp_leds_set);
+
+STATIC mp_obj_t mp_leds_set_dim(mp_obj_t led_obj, mp_obj_t dim_obj)
+{
+	int led = mp_obj_get_int (led_obj);
+	int dim = mp_obj_get_int (dim_obj);
+
+	if ( (0 > led || 256 < led) &&
+	     (0 > dim || 256 < dim) )
+	{
+		mp_raise_ValueError("out of bounds");
+	}
+	leds_set_dim (led, dim);
+	return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(leds_set_dim_obj, mp_leds_set_dim);
+
+// Define all properties of the example module.
+// Table entries are key/value pairs of the attribute name (a string)
+// and the MicroPython object reference.
+// All identifiers and strings are written as MP_QSTR_xxx and will be
+// optimized to word-sized integers by the build system (interned strings).
+STATIC const mp_rom_map_elem_t leds_module_globals_table[] = {
+	{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_leds) },
+	{ MP_ROM_QSTR(MP_QSTR_set), MP_ROM_PTR(&leds_set_obj) },
+	{ MP_ROM_QSTR(MP_QSTR_set_dim), MP_ROM_PTR(&leds_set_dim_obj) },
+};
+STATIC MP_DEFINE_CONST_DICT(leds_module_globals, leds_module_globals_table);
+
+// Define module object.
+const mp_obj_module_t leds_module = {
+	.base = { &mp_type_module },
+	.globals = (mp_obj_dict_t*)&leds_module_globals,
+};
+
+// Register the module to make it available in Python
+MP_REGISTER_MODULE(MP_QSTR_leds, leds_module, MODULE_LEDS_ENABLED);
diff --git a/hw-tests/upy-minimal/modules/qstrdefs.h b/hw-tests/upy-minimal/modules/qstrdefs.h
new file mode 100644
index 0000000000000000000000000000000000000000..b6c21cc086fa8612b6ecf4785e697b0230943e3c
--- /dev/null
+++ b/hw-tests/upy-minimal/modules/qstrdefs.h
@@ -0,0 +1,19 @@
+#include "py/mpconfig.h"
+
+/* buzzer */
+Q(buzzer)
+
+/* leds */
+Q(leds)
+Q(set_dim)
+
+/* utime */
+Q(utime)
+Q(sleep)
+Q(sleep_ms)
+Q(sleep_us)
+Q(ticks_ms)
+Q(ticks_us)
+Q(ticks_cpu)
+Q(ticks_add)
+Q(ticks_diff)
diff --git a/hw-tests/upy-minimal/modules/utime.c b/hw-tests/upy-minimal/modules/utime.c
new file mode 100644
index 0000000000000000000000000000000000000000..98aca15aa1dc12af058019e82a966ce92196f789
--- /dev/null
+++ b/hw-tests/upy-minimal/modules/utime.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <string.h>
+
+#include "py/runtime.h"
+#include "py/smallint.h"
+#include "py/obj.h"
+#include "lib/timeutils/timeutils.h"
+#include "extmod/utime_mphal.h"
+
+STATIC const mp_rom_map_elem_t time_module_globals_table[] = {
+    { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_utime) },
+    { MP_ROM_QSTR(MP_QSTR_sleep), MP_ROM_PTR(&mp_utime_sleep_obj) },
+    { MP_ROM_QSTR(MP_QSTR_sleep_ms), MP_ROM_PTR(&mp_utime_sleep_ms_obj) },
+    { MP_ROM_QSTR(MP_QSTR_sleep_us), MP_ROM_PTR(&mp_utime_sleep_us_obj) },
+    { MP_ROM_QSTR(MP_QSTR_ticks_ms), MP_ROM_PTR(&mp_utime_ticks_ms_obj) },
+    { MP_ROM_QSTR(MP_QSTR_ticks_us), MP_ROM_PTR(&mp_utime_ticks_us_obj) },
+    { MP_ROM_QSTR(MP_QSTR_ticks_cpu), MP_ROM_PTR(&mp_utime_ticks_cpu_obj) },
+    { MP_ROM_QSTR(MP_QSTR_ticks_add), MP_ROM_PTR(&mp_utime_ticks_add_obj) },
+    { MP_ROM_QSTR(MP_QSTR_ticks_diff), MP_ROM_PTR(&mp_utime_ticks_diff_obj) },
+};
+
+STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);
+
+const mp_obj_module_t mp_module_utime = {
+    .base = { &mp_type_module },
+    .globals = (mp_obj_dict_t*)&time_module_globals,
+};
+
+// Register the module to make it available in Python
+MP_REGISTER_MODULE(MP_QSTR_utime, mp_module_utime, MODULE_UTIME_ENABLED);
diff --git a/hw-tests/upy-minimal/mpconfigport.h b/hw-tests/upy-minimal/mpconfigport.h
new file mode 100644
index 0000000000000000000000000000000000000000..5629a65b7a7fb48b5265fcad25b51661f27c175f
--- /dev/null
+++ b/hw-tests/upy-minimal/mpconfigport.h
@@ -0,0 +1,97 @@
+#include <stdint.h>
+
+// options to control how MicroPython is built
+
+// You can disable the built-in MicroPython compiler by setting the following
+// config option to 0.  If you do this then you won't get a REPL prompt, but you
+// will still be able to execute pre-compiled scripts, compiled with mpy-cross.
+#define MICROPY_ENABLE_COMPILER     (1)
+
+#define MICROPY_QSTR_BYTES_IN_HASH  (1)
+// #define MICROPY_QSTR_EXTRA_POOL     mp_qstr_frozen_const_pool
+#define MICROPY_ALLOC_PATH_MAX      (256)
+#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
+#define MICROPY_EMIT_X64            (0)
+#define MICROPY_EMIT_THUMB          (0)
+#define MICROPY_EMIT_INLINE_THUMB   (0)
+#define MICROPY_COMP_MODULE_CONST   (0)
+#define MICROPY_COMP_CONST          (0)
+#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0)
+#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0)
+#define MICROPY_MEM_STATS           (0)
+#define MICROPY_DEBUG_PRINTERS      (1)
+#define MICROPY_ENABLE_GC           (1)
+#define MICROPY_GC_ALLOC_THRESHOLD  (0)
+#define MICROPY_HELPER_REPL         (1)
+#define MICROPY_HELPER_LEXER_UNIX   (0)
+#define MICROPY_ENABLE_SOURCE_LINE  (1)
+#define MICROPY_ENABLE_DOC_STRING   (1)
+#define MICROPY_ERROR_REPORTING     (MICROPY_ERROR_REPORTING_DETAILED)
+#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
+#define MICROPY_PY_ASYNC_AWAIT      (0)
+#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
+#define MICROPY_PY_BUILTINS_DICT_FROMKEYS (1)
+#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
+#define MICROPY_PY_BUILTINS_ENUMERATE (1)
+#define MICROPY_PY_BUILTINS_FILTER  (1)
+#define MICROPY_PY_BUILTINS_FROZENSET (1)
+#define MICROPY_PY_BUILTINS_REVERSED (1)
+#define MICROPY_PY_BUILTINS_SET     (1)
+#define MICROPY_PY_BUILTINS_SLICE   (1)
+#define MICROPY_PY_BUILTINS_PROPERTY (1)
+#define MICROPY_PY_BUILTINS_MIN_MAX (1)
+#define MICROPY_PY_BUILTINS_STR_COUNT (1)
+#define MICROPY_PY_BUILTINS_STR_OP_MODULO (0)
+#define MICROPY_PY_BUILTINS_HELP    (1)
+#define MICROPY_PY_BUILTINS_HELP_MODULES    (1)
+#define MICROPY_PY___FILE__         (0)
+#define MICROPY_PY_GC               (0)
+#define MICROPY_PY_ARRAY            (1)
+#define MICROPY_PY_ATTRTUPLE        (1)
+#define MICROPY_PY_COLLECTIONS      (1)
+#define MICROPY_PY_MATH             (1)
+#define MICROPY_PY_CMATH            (1)
+#define MICROPY_PY_IO               (1)
+#define MICROPY_PY_STRUCT           (1)
+#define MICROPY_PY_SYS              (1)
+#define MICROPY_MODULE_FROZEN_MPY   (0)
+#define MICROPY_CPYTHON_COMPAT      (0)
+#define MICROPY_LONGINT_IMPL        (MICROPY_LONGINT_IMPL_LONGLONG)
+#define MICROPY_FLOAT_IMPL          (MICROPY_FLOAT_IMPL_FLOAT)
+#define MICROPY_PY_UTIME_MP_HAL     (1)
+#define MODULE_BUZZER_ENABLED       (1)
+#define MODULE_UTIME_ENABLED        (1)
+#define MODULE_LEDS_ENABLED        (1)
+
+// type definitions for the specific machine
+
+#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
+
+// This port is intended to be 32-bit, but unfortunately, int32_t for
+// different targets may be defined in different ways - either as int
+// or as long. This requires different printf formatting specifiers
+// to print such value. So, we avoid int32_t and use int directly.
+#define UINT_FMT "%u"
+#define INT_FMT "%d"
+typedef int mp_int_t; // must be pointer size
+typedef unsigned mp_uint_t; // must be pointer size
+
+typedef long mp_off_t;
+
+#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
+
+// extra built in names to add to the global namespace
+#define MICROPY_PORT_BUILTINS \
+    { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
+
+// We need to provide a declaration/definition of alloca()
+#include <alloca.h>
+
+#define MICROPY_HW_BOARD_NAME "card10"
+#define MICROPY_HW_MCU_NAME "max32665"
+
+#define MP_STATE_PORT MP_STATE_VM
+
+#define MICROPY_PORT_ROOT_POINTERS \
+    const char *readline_hist[8];
+
diff --git a/hw-tests/upy-minimal/mphalport.h b/hw-tests/upy-minimal/mphalport.h
new file mode 100644
index 0000000000000000000000000000000000000000..0afb2c9576610c251df67bd908fc73c75b4cad12
--- /dev/null
+++ b/hw-tests/upy-minimal/mphalport.h
@@ -0,0 +1,3 @@
+#pragma once
+
+void mp_hal_set_interrupt_char(char c);
diff --git a/hw-tests/upy-minimal/systick.c b/hw-tests/upy-minimal/systick.c
new file mode 100644
index 0000000000000000000000000000000000000000..635e7d3ed9cc802452a7181e4aefc3c44ca76a45
--- /dev/null
+++ b/hw-tests/upy-minimal/systick.c
@@ -0,0 +1,22 @@
+#include "py/mpconfig.h"
+#include "mxc_delay.h"
+
+void mp_hal_delay_ms(mp_uint_t ms) {
+	mxc_delay (ms * 1000); // TODO check return value
+}
+
+void mp_hal_delay_us(mp_uint_t us) {
+	mxc_delay (us); // TODO check return value
+}
+
+mp_uint_t mp_hal_ticks_ms(void) {
+	return 0;
+}
+
+mp_uint_t mp_hal_ticks_us(void) {
+	return 0;
+}
+
+mp_uint_t mp_hal_ticks_cpu(void) {
+	return 0;
+}
diff --git a/hw-tests/upy-minimal/uart.c b/hw-tests/upy-minimal/uart.c
new file mode 100644
index 0000000000000000000000000000000000000000..2ef443177852d56232762c5807ffeef6ad7d32d4
--- /dev/null
+++ b/hw-tests/upy-minimal/uart.c
@@ -0,0 +1,23 @@
+#include <unistd.h>
+#include "py/mpconfig.h"
+#include "uart.h"
+
+/*
+ * Core UART functions to implement for a port
+ */
+
+extern mxc_uart_regs_t * ConsoleUart;
+
+// Receive single character
+int mp_hal_stdin_rx_chr(void) {
+	return UART_ReadByte(ConsoleUart);
+}
+
+// Send string of given length
+void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
+	UART_Write(ConsoleUart, (uint8_t*)str, len);
+}
+
+void mp_hal_set_interrupt_char(char c) {
+	return;
+}
diff --git a/lib/meson.build b/lib/meson.build
index 80fd654a828e4e01c14ccf9548df96491fe47cc1..ed96479d32e59298cff8eab032be442deb58639d 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -6,5 +6,7 @@ subdir('./vendor/Bosch/BMA400/')
 subdir('./vendor/Maxim/MAX77650/')
 subdir('./gfx/')
 
+subdir('./micropython/')
+
 subdir('./card10/')
 subdir('./ff13/')
diff --git a/lib/micropython/gen-modules.py b/lib/micropython/gen-modules.py
new file mode 100644
index 0000000000000000000000000000000000000000..64868e33e48f693ad7d9103e6590e3e83350407f
--- /dev/null
+++ b/lib/micropython/gen-modules.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+# Usage: gen-modules.py <source path> <output.h> <input.c ...>
+
+import sys
+import os
+
+
+def main():
+    # Get 'official' makemoduledefs.py
+    path = sys.argv[1] + "/micropython/py"
+    sys.path.insert(0, path)
+    import makemoduledefs
+
+    modules = set()
+    for source in sys.argv[3:]:
+        modules |= makemoduledefs.find_module_registrations(source)
+
+    stdout = sys.stdout
+    with open(sys.argv[2], "w") as f:
+        sys.stdout = f
+        makemoduledefs.generate_module_table_header(sorted(modules))
+    sys.stdout = stdout
+
+    try:
+        os.mkdir(os.path.dirname(sys.argv[2]) + "/genhdr")
+    except FileExistsError:
+        pass
+
+    linkname = os.path.dirname(sys.argv[2]) + "/genhdr/" + os.path.basename(sys.argv[2])
+    if os.path.exists(linkname):
+        os.unlink(linkname)
+    os.symlink(
+        "../" + os.path.basename(sys.argv[2]),
+        linkname,
+    )
+
+
+if __name__ == "__main__":
+    main()
diff --git a/lib/micropython/gen-qstr.sh b/lib/micropython/gen-qstr.sh
new file mode 100755
index 0000000000000000000000000000000000000000..81ae17f2e77c39e3edde012d81ac219b4969515e
--- /dev/null
+++ b/lib/micropython/gen-qstr.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -e
+
+PYTHON="$1"
+SOURCE_DIR="$2"
+PROJECT_SRC="$3"
+OUTPUT="$4"
+CUSTOM_QSTR="$5"
+
+shift 5
+
+OUTPUT_DIR="$(dirname "$OUTPUT")"
+
+mkdir -p "$OUTPUT_DIR/genhdr"
+ln -sfr "$OUTPUT" "$OUTPUT_DIR/genhdr/$(basename "$OUTPUT")"
+
+# call gcc -E to generate qstr.i.last
+gcc -E -DNO_QSTR -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" "$@" >"$OUTPUT_DIR/qstr.i.last"
+
+# Generate qstr.split
+"$PYTHON" "$SOURCE_DIR/micropython/py/makeqstrdefs.py" split \
+    "$OUTPUT_DIR/qstr.i.last" "$OUTPUT_DIR/qstr" "$OUTPUT_DIR/qstrdefs.collected.h" >/dev/null
+
+# Generate qstr.collected.h
+"$PYTHON" "$SOURCE_DIR/micropython/py/makeqstrdefs.py" cat \
+    "$OUTPUT_DIR/qstr.i.last" "$OUTPUT_DIR/qstr" "$OUTPUT_DIR/qstrdefs.collected.h" >/dev/null
+
+# Preprocess Header ... I did not come up with this, this is code copied from
+#    the official make file.  Seriously.
+cat "$SOURCE_DIR/micropython/py/qstrdefs.h" "$CUSTOM_QSTR" "$OUTPUT_DIR/qstrdefs.collected.h" \
+    | sed 's/^Q(.*)/"&"/' \
+    | gcc -E -DNO_QSTR -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" - \
+    | sed 's/^\"\(Q(.*)\)\"/\1/' \
+    >"$OUTPUT_DIR/qstrdefs.preprocessed.h"
+
+# Call makeqstrdata
+"$PYTHON" "$SOURCE_DIR/micropython/py/makeqstrdata.py" "$OUTPUT_DIR/qstrdefs.preprocessed.h" >"$OUTPUT"
diff --git a/lib/micropython/gen-version.sh b/lib/micropython/gen-version.sh
new file mode 100755
index 0000000000000000000000000000000000000000..fd56bd99b56117b79a1c9ab15818a7bd7d049717
--- /dev/null
+++ b/lib/micropython/gen-version.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+# makeversionhdr has to be executed in the micropython subdir
+# so it picks up the correct version
+OUT="$(realpath "$3")"
+OUTDIR="$(dirname "$OUT")"
+
+mkdir -p "$OUTDIR/genhdr"
+ln -sfr "$OUT" "$OUTDIR/genhdr/$(basename "$OUT")"
+
+cd "$2/micropython"
+"$1" "$2/micropython/py/makeversionhdr.py" "$OUT"
diff --git a/lib/micropython/meson.build b/lib/micropython/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..bca808fa4a12af50c0a2a12396b99ec692910205
--- /dev/null
+++ b/lib/micropython/meson.build
@@ -0,0 +1,147 @@
+# Scripts
+micropython_gen_modules = [
+  python3,
+  files('gen-modules.py'),
+  meson.current_source_dir(),
+]
+
+micropython_gen_version = [
+  files('./gen-version.sh'),
+  python3,
+  meson.current_source_dir(),
+]
+
+micropython_gen_qstr = [
+  files('gen-qstr.sh'),
+  python3,
+  meson.current_source_dir(),
+]
+
+# Sources
+micropython_includes = include_directories(
+  './micropython/',
+  './micropython/lib/utils',
+  './micropython/extmod/',
+)
+
+micropython_sources = files(
+  'micropython/py/argcheck.c',
+  'micropython/py/asmarm.c', 'micropython/py/asmbase.c',
+  'micropython/py/asmthumb.c',
+  'micropython/py/asmx64.c',
+  'micropython/py/asmx86.c',
+  'micropython/py/asmxtensa.c',
+  'micropython/py/bc.c',
+  'micropython/py/binary.c',
+  'micropython/py/builtinevex.c',
+  'micropython/py/builtinhelp.c',
+  'micropython/py/builtinimport.c',
+  'micropython/py/compile.c',
+  'micropython/py/emitbc.c',
+  'micropython/py/emitcommon.c',
+  'micropython/py/emitglue.c',
+  'micropython/py/emitinlinethumb.c',
+  'micropython/py/emitinlinextensa.c',
+  'micropython/py/emitnarm.c',
+  'micropython/py/emitnative.c',
+  'micropython/py/emitnthumb.c',
+  'micropython/py/emitnx64.c',
+  'micropython/py/emitnx86.c',
+  'micropython/py/emitnxtensa.c',
+  'micropython/py/formatfloat.c',
+  'micropython/py/frozenmod.c',
+  'micropython/py/gc.c',
+  'micropython/py/lexer.c',
+  'micropython/py/malloc.c',
+  'micropython/py/map.c',
+  'micropython/py/modarray.c',
+  'micropython/py/modbuiltins.c',
+  'micropython/py/modcmath.c',
+  'micropython/py/modcollections.c',
+  'micropython/py/modgc.c',
+  'micropython/py/modio.c',
+  'micropython/py/modmath.c',
+  'micropython/py/modmicropython.c',
+  'micropython/py/modstruct.c',
+  'micropython/py/modsys.c',
+  'micropython/py/modthread.c',
+  'micropython/py/moduerrno.c',
+  'micropython/py/mpprint.c',
+  'micropython/py/mpstate.c',
+  'micropython/py/mpz.c',
+  'micropython/py/nativeglue.c',
+  'micropython/py/nlr.c',
+  'micropython/py/nlrsetjmp.c',
+  'micropython/py/nlrthumb.c',
+  'micropython/py/nlrx64.c',
+  'micropython/py/nlrx86.c',
+  'micropython/py/nlrxtensa.c',
+  'micropython/py/obj.c',
+  'micropython/py/objarray.c',
+  'micropython/py/objattrtuple.c',
+  'micropython/py/objbool.c',
+  'micropython/py/objboundmeth.c',
+  'micropython/py/objcell.c',
+  'micropython/py/objclosure.c',
+  'micropython/py/objcomplex.c',
+  'micropython/py/objdeque.c',
+  'micropython/py/objdict.c',
+  'micropython/py/objenumerate.c',
+  'micropython/py/objexcept.c',
+  'micropython/py/objfilter.c',
+  'micropython/py/objfloat.c',
+  'micropython/py/objfun.c',
+  'micropython/py/objgenerator.c',
+  'micropython/py/objgetitemiter.c',
+  'micropython/py/objint.c',
+  'micropython/py/objint_longlong.c',
+  'micropython/py/objint_mpz.c',
+  'micropython/py/objlist.c',
+  'micropython/py/objmap.c',
+  'micropython/py/objmodule.c',
+  'micropython/py/objnamedtuple.c',
+  'micropython/py/objnone.c',
+  'micropython/py/objobject.c',
+  'micropython/py/objpolyiter.c',
+  'micropython/py/objproperty.c',
+  'micropython/py/objrange.c',
+  'micropython/py/objreversed.c',
+  'micropython/py/objset.c',
+  'micropython/py/objsingleton.c',
+  'micropython/py/objslice.c',
+  'micropython/py/objstr.c',
+  'micropython/py/objstringio.c',
+  'micropython/py/objstrunicode.c',
+  'micropython/py/objtuple.c',
+  'micropython/py/objtype.c',
+  'micropython/py/objzip.c',
+  'micropython/py/opmethods.c',
+  'micropython/py/parse.c',
+  'micropython/py/parsenum.c',
+  'micropython/py/parsenumbase.c',
+  'micropython/py/persistentcode.c',
+  'micropython/py/pystack.c',
+  'micropython/py/qstr.c',
+  'micropython/py/reader.c',
+  'micropython/py/repl.c',
+  'micropython/py/runtime.c',
+  'micropython/py/runtime_utils.c',
+  'micropython/py/scheduler.c',
+  'micropython/py/scope.c',
+  'micropython/py/sequence.c',
+  'micropython/py/showbc.c',
+  'micropython/py/smallint.c',
+  'micropython/py/stackctrl.c',
+  'micropython/py/stream.c',
+  'micropython/py/unicode.c',
+  'micropython/py/vm.c',
+  'micropython/py/vstr.c',
+  'micropython/py/warning.c',
+)
+
+micropython_additional_sources = files(
+  'micropython/lib/utils/stdout_helpers.c',
+  'micropython/lib/utils/pyexec.c',
+  'micropython/lib/mp-readline/readline.c',
+  'micropython/extmod/utime_mphal.c',
+)
diff --git a/lib/micropython/micropython b/lib/micropython/micropython
new file mode 160000
index 0000000000000000000000000000000000000000..62f004ba424920a01e60c7a9a064b8ec9cd69c12
--- /dev/null
+++ b/lib/micropython/micropython
@@ -0,0 +1 @@
+Subproject commit 62f004ba424920a01e60c7a9a064b8ec9cd69c12
diff --git a/meson.build b/meson.build
index b8ea87e9386f46387c2d19a60d02d2e970f9b3e8..20b7040b216e7d4294c9a911230e71bd3b96e257 100644
--- a/meson.build
+++ b/meson.build
@@ -32,4 +32,8 @@ python3 = 'python3'
 
 subdir('lib/')
 subdir('bootloader/')
+
+subdir('epicardium/')
+subdir('pycardium/')
+
 subdir('hw-tests/')
diff --git a/pycardium/main.c b/pycardium/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..5c6b38a764f146ae4aa7f2e375478ef2677ad6dc
--- /dev/null
+++ b/pycardium/main.c
@@ -0,0 +1,32 @@
+#include "py/runtime.h"
+#include "py/gc.h"
+#include "lib/utils/pyexec.h"
+
+static char *stack_top;
+static char heap[4096];
+
+int main(void)
+{
+	/* TODO: Replace this with a proper heap implementation */
+	int stack_dummy;
+	stack_top = (char*)&stack_dummy;
+
+	gc_init(heap, heap + sizeof(heap));
+
+	mp_init();
+	pyexec_friendly_repl();
+
+	while (1) {
+		;
+	}
+}
+
+void gc_collect(void)
+{
+	/* TODO: Replace this with a proper heap implementation */
+	void*dummy;
+
+	gc_collect_start();
+	gc_collect_root(&dummy, ((mp_uint_t)stack_top - (mp_uint_t)&dummy) / sizeof(mp_uint_t));
+	gc_collect_end();
+}
diff --git a/pycardium/meson.build b/pycardium/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..7bb11316fe865e7bbf1dae740eddb15dd950ffcd
--- /dev/null
+++ b/pycardium/meson.build
@@ -0,0 +1,62 @@
+name = 'pycardium'
+
+modsrc = files(
+)
+
+#################################
+# MicroPython Generated Headers #
+#################################
+
+version_h = custom_target(
+  'mpversion.h',
+  output: 'mpversion.h',
+  command: [micropython_gen_version, '@OUTPUT@'],
+)
+
+modules_h = custom_target(
+  'moduledefs.h',
+  output: 'moduledefs.h',
+  input: [micropython_sources, modsrc],
+  command: [micropython_gen_modules, '@OUTPUT@', '@INPUT@'],
+)
+
+qstr_h = custom_target(
+  'qstrdefs.generated.h',
+  output: 'qstrdefs.generated.h',
+  input: [
+    # 'modules/qstrdefs.h',
+    'mpconfigport.h',
+    micropython_sources,
+  ],
+  depends: [modules_h, version_h],
+  command: [micropython_gen_qstr, meson.current_source_dir(), '@OUTPUT@', '@INPUT@'],
+)
+
+mp_headers = [version_h, modules_h, qstr_h]
+
+###################
+# MicroPython Lib #
+###################
+
+upy = static_library(
+  'micropython',
+  micropython_sources,
+  micropython_additional_sources,
+  mp_headers,
+  include_directories: micropython_includes,
+)
+
+executable(
+  name + '.elf',
+  'main.c',
+  'mphalport.c',
+  modsrc,
+  mp_headers,
+  include_directories: micropython_includes,
+  dependencies: [max32665_startup_core1, board_card10, periphdriver],
+  link_whole: [max32665_startup_core1_lib, board_card10_lib],
+  link_with: upy,
+  link_args: [
+    '-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
+  ],
+)
diff --git a/pycardium/mpconfigport.h b/pycardium/mpconfigport.h
new file mode 100644
index 0000000000000000000000000000000000000000..3418da7188333e186894902dd597fa76c69fd84f
--- /dev/null
+++ b/pycardium/mpconfigport.h
@@ -0,0 +1,48 @@
+/* Hardware Name */
+#define MICROPY_HW_BOARD_NAME "card10"
+#define MICROPY_HW_MCU_NAME "max32665"
+
+/* MicroPython Config Options */
+
+/*
+ * Right now, we do not support importing external modules
+ * though this might change in the future.
+ */
+#define MICROPY_ENABLE_EXTERNAL_IMPORT  (0)
+
+#define MICROPY_ENABLE_DOC_STRING           (1)
+#define MICROPY_ENABLE_GC                   (1)
+#define MICROPY_FLOAT_IMPL                  (MICROPY_FLOAT_IMPL_FLOAT)
+#define MICROPY_HELPER_REPL                 (1)
+#define MICROPY_LONGINT_IMPL                (MICROPY_LONGINT_IMPL_LONGLONG)
+#define MICROPY_PY_BUILTINS_HELP            (1)
+#define MICROPY_PY_BUILTINS_HELP_MODULES    (1)
+
+/*
+ * This port is intended to be 32-bit, but unfortunately, int32_t for
+ * different targets may be defined in different ways - either as int
+ * or as long. This requires different printf formatting specifiers
+ * to print such value. So, we avoid int32_t and use int directly.
+ */
+#define UINT_FMT "%u"
+#define INT_FMT "%d"
+typedef int mp_int_t;       /* must be pointer size */
+typedef unsigned mp_uint_t; /* must be pointer size */
+
+typedef long mp_off_t;
+
+/*
+ * Make a pointer to RAM callable (eg set lower bit for Thumb code)
+ * (This scheme won't work if we want to mix Thumb and normal ARM code.)
+ */
+#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
+
+/* We need to provide a declaration/definition of alloca() */
+#include <alloca.h>
+
+/* TODO: Document this */
+#define MP_STATE_PORT MP_STATE_VM
+
+/* For some reason, we need to define readline history manually */
+#define MICROPY_PORT_ROOT_POINTERS \
+    const char *readline_hist[16];
diff --git a/pycardium/mphalport.c b/pycardium/mphalport.c
new file mode 100644
index 0000000000000000000000000000000000000000..5f69a7d2f656d01b5147a2a78745e99560fd6ef7
--- /dev/null
+++ b/pycardium/mphalport.c
@@ -0,0 +1,74 @@
+#include <stdint.h>
+
+#include "py/lexer.h"
+#include "py/mpconfig.h"
+#include "py/mperrno.h"
+#include "py/obj.h"
+#include "py/runtime.h"
+
+/******************************************************************************
+ * Serial Communication
+ */
+
+/* TODO: Use API boundary instead of direct communication */
+#include "uart.h"
+extern mxc_uart_regs_t * ConsoleUart;
+
+/* Receive single character */
+int mp_hal_stdin_rx_chr(void)
+{
+	return UART_ReadByte(ConsoleUart);
+}
+
+/* Send string of given length */
+void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len)
+{
+	UART_Write(ConsoleUart, (uint8_t*)str, len);
+}
+
+/******************************************************************************
+ * Fatal Errors
+ */
+
+void NORETURN nlr_jump_fail(void *val)
+{
+	/* TODO: Report error and restart */
+	while (1) {
+	}
+}
+
+/******************************************************************************
+ * Stubs
+ */
+
+mp_lexer_t *mp_lexer_new_from_file(const char *filename)
+{
+	/* TODO: Do we need an implementation for this? */
+	mp_raise_OSError(MP_ENOENT);
+}
+
+mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs)
+{
+	/* TODO: Once fs is implemented, get this working as well */
+	return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
+
+/******************************************************************************
+ * TODO: Remove
+ */
+
+int _getpid(void)
+{
+	;
+}
+
+int _kill(int pid, int f)
+{
+	;
+}
+
+void _exit(int r)
+{
+	;
+}
diff --git a/pycardium/mphalport.h b/pycardium/mphalport.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf772d7f1a1a219e786ea0fbe0b4372088da0e67
--- /dev/null
+++ b/pycardium/mphalport.h
@@ -0,0 +1,7 @@
+#include "py/mpconfig.h"
+
+/* TODO: Replace this with a proper implementation */
+static inline mp_uint_t mp_hal_ticks_ms(void) { return 0; }
+
+/* TODO: Replace this with a proper implementation */
+static inline void mp_hal_set_interrupt_char(char c) {}