File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
src/modm/platform/core/cortex Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ def build(env):
293
293
env .outbasepath = "modm/src/modm/platform/core"
294
294
295
295
# startup script
296
- env .copy ("reset_handler.sx" )
296
+ env .template ("reset_handler.sx.in " )
297
297
env .template ("startup.c.in" )
298
298
env .template ("vectors.c.in" )
299
299
env .collect (":build:linkflags" , "-nostartfiles" )
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2019, Niklas Hauser
2
+ * Copyright (c) 2019, 2021, Niklas Hauser
3
3
*
4
4
* This file is part of the modm project.
5
5
*
16
16
.type Reset_Handler, %function
17
17
.func Reset_Handler
18
18
Reset_Handler:
19
+ // Some bootloaders do not reset the stack pointer back to the VTOR entry
19
20
ldr r0,=__main_stack_top
20
21
mov sp,r0
22
+ %% if with_fpu
23
+ // Enable FPU early so the compiler may use FPU registers for copying
24
+ // SCB->CPACR = ((3UL << 10*2) | (3UL << 11*2));
25
+ ldr r0,=0xe000ed88
26
+ ldr r1,=0x00f00000
27
+ str r1, [r0, #0]
28
+ %% endif
21
29
bl __modm_initialize_platform
22
30
bl modm_initialize_platform
23
31
b __modm_startup
Original file line number Diff line number Diff line change @@ -102,11 +102,6 @@ void __modm_startup(void)
102
102
SCB_EnableICache();
103
103
%% endif
104
104
105
- %% if with_fpu
106
- // Enable FPU in privileged and user mode
107
- SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2));
108
- %% endif
109
-
110
105
%% if "m0" not in core
111
106
// Set the vector table location
112
107
SCB->VTOR = (uint32_t)__vector_table_{{ vector_table_location }}_start;
You can’t perform that action at this time.
0 commit comments