diff --git a/esp8266/main.c b/esp8266/main.c
index 1e988ef33ae6ea0ff0ee3c60ad89dc76478d0525..9883f9f96d10d3cd613a008fe526380400ef08b0 100644
--- a/esp8266/main.c
+++ b/esp8266/main.c
@@ -58,7 +58,7 @@ STATIC void mp_reset(void) {
     MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
     MP_STATE_PORT(term_obj) = MP_OBJ_NULL;
     MP_STATE_PORT(dupterm_arr_obj) = MP_OBJ_NULL;
-    #if MICROPY_EMIT_XTENSA
+    #if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA
     extern void esp_native_code_init(void);
     esp_native_code_init();
     #endif
diff --git a/esp8266/modesp.c b/esp8266/modesp.c
index 302bc01edc5a267b08ae1c8afd341b16f005cfdb..a20769abc42d5c410739eb8aa25f24033d8f155f 100644
--- a/esp8266/modesp.c
+++ b/esp8266/modesp.c
@@ -699,7 +699,7 @@ STATIC mp_obj_t esp_esf_free_bufs(mp_obj_t idx_in) {
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_esf_free_bufs_obj, esp_esf_free_bufs);
 
-#if MICROPY_EMIT_XTENSA
+#if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA
 
 // We provide here a way of committing executable data to a region from
 // which it can be executed by the CPU.  There are 2 such writable regions:
@@ -822,7 +822,7 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = {
     { MP_OBJ_NEW_QSTR(MP_QSTR_malloc), (mp_obj_t)&esp_malloc_obj },
     { MP_OBJ_NEW_QSTR(MP_QSTR_free), (mp_obj_t)&esp_free_obj },
     { MP_OBJ_NEW_QSTR(MP_QSTR_esf_free_bufs), (mp_obj_t)&esp_esf_free_bufs_obj },
-    #if MICROPY_EMIT_XTENSA
+    #if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA
     { MP_OBJ_NEW_QSTR(MP_QSTR_set_native_code_location), (mp_obj_t)&esp_set_native_code_location_obj },
     #endif
 
diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h
index 40550024b6debc1ce913ffdfc53ad10940ff666f..d15a7cdd4f6421a6c3f8e54fbda7f07070c5f390 100644
--- a/esp8266/mpconfigport.h
+++ b/esp8266/mpconfigport.h
@@ -11,6 +11,7 @@
 #define MICROPY_ALLOC_PARSE_CHUNK_INIT  (64)
 #define MICROPY_PERSISTENT_CODE_LOAD (1)
 #define MICROPY_EMIT_XTENSA         (1)
+#define MICROPY_EMIT_INLINE_XTENSA  (1)
 #define MICROPY_MEM_STATS           (0)
 #define MICROPY_DEBUG_PRINTERS      (1)
 #define MICROPY_DEBUG_PRINTER_DEST  mp_debug_print
diff --git a/esp8266/mpconfigport_512k.h b/esp8266/mpconfigport_512k.h
index 1bb4524054e30a34d76db8ca3b643a214058e8b0..d1d6025793c2b8220a91a190170a739d0b821f3e 100644
--- a/esp8266/mpconfigport_512k.h
+++ b/esp8266/mpconfigport_512k.h
@@ -2,6 +2,8 @@
 
 #undef MICROPY_EMIT_XTENSA
 #define MICROPY_EMIT_XTENSA             (0)
+#undef MICROPY_EMIT_INLINE_XTENSA
+#define MICROPY_EMIT_INLINE_XTENSA      (0)
 
 #undef MICROPY_FSUSERMOUNT
 #define MICROPY_FSUSERMOUNT             (0)