diff --git a/miosix/arch/cortexM3_stm32f1/stm32f103ze_redbull_v2/boot.cpp b/miosix/arch/cortexM3_stm32f1/stm32f103ze_redbull_v2/boot.cpp index a8924901bf9b328fadcbc1c5444a4b9d15693514..bc39fae6cdb11d49bc833751f83ef06207388e21 100644 --- a/miosix/arch/cortexM3_stm32f1/stm32f103ze_redbull_v2/boot.cpp +++ b/miosix/arch/cortexM3_stm32f1/stm32f103ze_redbull_v2/boot.cpp @@ -36,12 +36,4 @@ void IRQmemoryAndClockInit() SystemInit(); } -/** - * ? - */ -extern "C" void SystemInit_ExtMemCtl_Dummy() -{ - //Do nothing -} - } // namespace miosix diff --git a/miosix/arch/cortexM3_stm32f1/stm32f103ze_stm3210e-eval/boot.cpp b/miosix/arch/cortexM3_stm32f1/stm32f103ze_stm3210e-eval/boot.cpp index a8924901bf9b328fadcbc1c5444a4b9d15693514..bc39fae6cdb11d49bc833751f83ef06207388e21 100644 --- a/miosix/arch/cortexM3_stm32f1/stm32f103ze_stm3210e-eval/boot.cpp +++ b/miosix/arch/cortexM3_stm32f1/stm32f103ze_stm3210e-eval/boot.cpp @@ -36,12 +36,4 @@ void IRQmemoryAndClockInit() SystemInit(); } -/** - * ? - */ -extern "C" void SystemInit_ExtMemCtl_Dummy() -{ - //Do nothing -} - } // namespace miosix diff --git a/miosix/arch/cpu/common/cortexMx_interrupts.cpp b/miosix/arch/cpu/common/cortexMx_interrupts.cpp index f8c1cd034faaffdc82bb2d15d7083abe13280667..d958c4d101ebc9def1df0b48bdd19f65031ae34f 100644 --- a/miosix/arch/cpu/common/cortexMx_interrupts.cpp +++ b/miosix/arch/cpu/common/cortexMx_interrupts.cpp @@ -226,12 +226,14 @@ __attribute__((section(".isr_vector"))) extern const InterruptTable hardwareInte void IRQinitIrqTable() noexcept { + //Cortex M0 non-plus do not have a VTOR register #if __CORTEX_M != 0 || (defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)) + //Can't set VTOR to point to XRAM + #ifndef __CODE_IN_XRAM //NOTE: the bootoader in some MCUs such as ATSam4l does not relocate the //vector table offset to the one in the firmware, so we force it here. SCB->VTOR=reinterpret_cast<unsigned int>(&hardwareInterruptTable); - #else - //Cortex M0 non-plus do not have a VTOR register + #endif #endif //Quirk: static_cast<IRQn_Type>(-5) is sometimes defined as SVCall_IRQn and diff --git a/miosix/kernel/boot.cpp b/miosix/kernel/boot.cpp index 4503ed7ccdbb535e805a4bb972b56d31e12dd5d5..b1646f45ec6bdbaef5345918854abc57b896b83e 100644 --- a/miosix/kernel/boot.cpp +++ b/miosix/kernel/boot.cpp @@ -87,7 +87,13 @@ void IRQkernelBootEntryPoint() unsigned char *edata=&_edata; unsigned char *bss_start=&_bss_start; unsigned char *bss_end=&_bss_end; + #ifndef __CODE_IN_XRAM memcpy(data, etext, edata-data); + #else //__CODE_IN_XRAM + (void)etext; //Avoid unused variable warning + (void)data; + (void)edata; + #endif //__CODE_IN_XRAM memset(bss_start, 0, bss_end-bss_start); IRQinitIrqTable();