diff --git a/esp8266/gccollect.c b/esp8266/gccollect.c
index 46f9bb94ced474e18f1be10ff46dab478c62923a..541500292ec0f7b87832edbfbc968af77f6c8865 100644
--- a/esp8266/gccollect.c
+++ b/esp8266/gccollect.c
@@ -29,17 +29,12 @@
 #include "py/gc.h"
 #include "gccollect.h"
 
-STATIC uint32_t stack_end;
+// As we do not have control over the application entry point, there is no way
+// to figure out the real stack base on runtime, so it needs to be hardcoded
+#define STACK_END   0x40000000
 
 mp_uint_t gc_helper_get_regs_and_sp(mp_uint_t *regs);
 
-void gc_collect_init(void) {
-    mp_uint_t regs[8];
-    mp_uint_t sp = gc_helper_get_regs_and_sp(regs);
-    stack_end = sp;
-    //printf("stack=%p ram_end=%p %d\n", stack_end, &_ram_end);
-}
-
 void gc_collect(void) {
     // start the GC
     gc_collect_start();
@@ -53,7 +48,7 @@ void gc_collect(void) {
     mp_uint_t sp = gc_helper_get_regs_and_sp(regs);
 
     // trace the stack, including the registers (since they live on the stack in this function)
-    gc_collect_root((void**)sp, (stack_end - sp) / sizeof(uint32_t));
+    gc_collect_root((void**)sp, (STACK_END - sp) / sizeof(uint32_t));
 
     // end the GC
     gc_collect_end();
diff --git a/esp8266/gccollect.h b/esp8266/gccollect.h
index b1804d30e25cde3d4d792c478e1c8734a2cfb737..e360ef2f29acaa524a84d0b45623e9edfee3406e 100644
--- a/esp8266/gccollect.h
+++ b/esp8266/gccollect.h
@@ -37,5 +37,4 @@ extern uint32_t _bss_end;
 extern uint32_t _heap_start;
 extern uint32_t _heap_end;
 
-void gc_collect_init(void);
 void gc_collect(void);
diff --git a/esp8266/main.c b/esp8266/main.c
index a3878c0e75232b3e9759d639fe63d2e363e06843..81618cd63f6da63e40aaf007dab1007ff0813aa1 100644
--- a/esp8266/main.c
+++ b/esp8266/main.c
@@ -43,7 +43,6 @@ STATIC void mp_reset(void) {
     mp_stack_set_limit(10240);
     mp_hal_init();
     gc_init(heap, heap + sizeof(heap));
-    gc_collect_init();
     mp_init();
     mp_obj_list_init(mp_sys_path, 0);
     mp_obj_list_init(mp_sys_argv, 0);