diff --git a/ion/src/device/shared/boot/Makefile b/ion/src/device/shared/boot/Makefile index 7c702f7ab..2bb8d22d7 100644 --- a/ion/src/device/shared/boot/Makefile +++ b/ion/src/device/shared/boot/Makefile @@ -1,4 +1,4 @@ -src += $(addprefix ion/src/device/shared/boot/, \ +ion_device_src += $(addprefix ion/src/device/shared/boot/, \ isr.c \ rt0.cpp \ ) diff --git a/ion/src/device/shared/boot/rt0.cpp b/ion/src/device/shared/boot/rt0.cpp index 5e4b10f13..79acbdbdc 100644 --- a/ion/src/device/shared/boot/rt0.cpp +++ b/ion/src/device/shared/boot/rt0.cpp @@ -5,6 +5,7 @@ #include "../drivers/board.h" #include "../drivers/reset.h" #include "../drivers/timing.h" +#include typedef void (*cxx_constructor)(); @@ -41,8 +42,13 @@ static void __attribute__((noinline)) non_inlined_ion_main() { } void start() { - // This is where execution starts after reset. - // Many things are not initialized yet so the code here has to pay attention. + /* This is where execution starts after reset. + * Many things are not initialized yet so the code here has to pay attention. */ + + /* First of all, reset the data/instruction caches. Indeed, if we do not, "an + * UNPREDICTIBLE behavior can occur".*/ + Ion::Device::Cache::invalidateDCache(); + Ion::Device::Cache::invalidateICache(); /* Copy data section to RAM * The data section is R/W but its initialization value matters. It's stored