git-svn-id: trunk@32568 -
@@ -606,7 +606,13 @@ begin
with embedded_controllers[current_settings.controllertype] do
with linkres do
begin
- Add('ENTRY(_START)');
+ if (embedded_controllers[current_settings.controllertype].controllerunitstr='MK20D5')
+ or (embedded_controllers[current_settings.controllertype].controllerunitstr='MK20D7')
+ or (embedded_controllers[current_settings.controllertype].controllerunitstr='MK22F51212')
+ or (embedded_controllers[current_settings.controllertype].controllerunitstr='MK64F12') then
+ Add('ENTRY(_LOWLEVELSTART)')
+ else
+ Add('ENTRY(_START)');
Add('MEMORY');
Add('{');
if flashsize<>0 then
@@ -1106,13 +1106,43 @@ procedure SWI_interrupt; external name 'SWI_interrupt';
{$i cortexm4f_start.inc}
+procedure FlashConfiguration; assembler; nostackframe;
+label flash_conf;
+asm
+ .section ".flash_config.flash_conf"
+flash_conf:
+ .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF
+
+ .text
+end;
+procedure LowLevelStartup; assembler; nostackframe; [public, alias: '_LOWLEVELSTART'];
+ // Unlock watchdog
+ ldr r0, .LWDOG_BASE
+ movw r1, #50464
+ strh r1, [r0, #0xE]
+ movw r1, #55592
+ nop
+ // Disable watchdog for now
+ movs r1, #0
+ strh r1, [r0, #0]
+ b Startup
+.LWDOG_BASE:
+ .long 0x40052000
procedure Vectors; assembler; nostackframe;
label interrupt_vectors;
asm
.section ".init.interrupt_vectors"
interrupt_vectors:
.long _stack_top
- .long Startup
+ .long LowLevelStartup
.long NonMaskableInt_interrupt
.long 0
.long MemoryManagement_interrupt
@@ -1388,13 +1388,43 @@ procedure SWI_interrupt; external name 'SWI_interrupt';
@@ -1298,13 +1298,43 @@ procedure RESERVED101_interrupt; external name 'RESERVED101_interrupt';
+ movw r1, #0xc520 //50464
+ movw r1, #0xd928 //55592
+ movs r1, #0x1d2
.long HardFault_interrupt
@@ -1711,13 +1711,44 @@ procedure ENET_Receive_interrupt; external name 'ENET_Receive_interrupt';
procedure ENET_Error_interrupt; external name 'ENET_Error_interrupt';
- .long Startup // int -15
+ .long LowLevelStartup // int -15
.long NonMaskableInt_interrupt // int -14
.long HardFault_interrupt // int -13
.long MemoryManagement_interrupt // int -12