30 #include <stm32f4xx.h>
51 typedef const
void (
vector)(
void);
68 asm volatile (
"msr msp, %0" : :
"r" (&irq_stack[
sizeof(irq_stack)]) : );
71 asm volatile (
"mov r10, %0" : :
"r" (&irq_stack[0]) : );
77 SCB->SHCSR |= SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_BUSFAULTENA_Msk | SCB_SHCSR_MEMFAULTENA_Msk;
80 FPU->FPCCR |= FPU_FPCCR_ASPEN_Msk | FPU_FPCCR_LSPEN_Msk;
83 FPU->FPDSCR |= FPU_FPDSCR_DN_Msk;
84 FPU->FPDSCR |= FPU_FPDSCR_FZ_Msk;
88 SCB->CPACR |= (0xf << 20);
97 #if defined(STM32F40_41xxx)
98 memset(&_sfast, 0, &_efast - &_sfast);
102 memset(&irq_stack, 0xa5,
sizeof(irq_stack) - 64);
112 register void *stack_pointer
asm(
"sp");
125 #define HANDLER(_name) extern vector _name __attribute__((weak, alias("default_cpu_handler")))
136 struct cm3_vectors cpu_vectors
__attribute((section(".cpu_vectors"))) = {
137 .initial_stack = &irq_stack[
sizeof(irq_stack)],
const void( vector)(void)
const void *_vectors[] __attribute((section(".vectors")))
static void default_cpu_handler(void)