Skip to content

Commit 37fa662

Browse files
committed
Merge pull request #348 from 0xc0170/dev_k64f_gcc_fix
[K64F] ARM GCC startup fix - watchdog, linker correction and NVIC number of ...
2 parents aba739c + e48e797 commit 37fa662

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/K64FN1M0xxx12.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MEMORY
77
VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
88
FLASH_PROTECTION (rx) : ORIGIN = 0x00000400, LENGTH = 0x00000010
99
FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 0x00100000 - 0x00000410
10-
RAM (rwx) : ORIGIN = 0x1FFF0400, LENGTH = 0x00040000 - 0x00000400
10+
RAM (rwx) : ORIGIN = 0x1FFF0198, LENGTH = 0x00040000 - 0x00000198
1111
}
1212

1313
/* Linker script to place sections and symbol values. Should be used together

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/startup_MK64F12.s

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#ifdef __STACK_SIZE
5050
.equ Stack_Size, __STACK_SIZE
5151
#else
52-
.equ Stack_Size, 0x400
52+
.equ Stack_Size, 0xC00
5353
#endif
5454
.globl __StackTop
5555
.globl __StackLimit
@@ -64,7 +64,7 @@ __StackTop:
6464
#ifdef __HEAP_SIZE
6565
.equ Heap_Size, __HEAP_SIZE
6666
#else
67-
.equ Heap_Size, 0x80
67+
.equ Heap_Size, 0x400
6868
#endif
6969
.globl __HeapBase
7070
.globl __HeapLimit
@@ -199,6 +199,18 @@ Reset_Handler:
199199
* __data_start__/__data_end__: RAM address range that data should be
200200
* copied to. Both must be aligned to 4 bytes boundary. */
201201

202+
disable_watchdog:
203+
/* unlock */
204+
ldr r1, =0x4005200e
205+
ldr r0, =0xc520
206+
strh r0, [r1]
207+
ldr r0, =0xd928
208+
strh r0, [r1]
209+
/* disable */
210+
ldr r1, =0x40052000
211+
ldr r0, =0x01d2
212+
strh r0, [r1]
213+
202214
ldr r1, =__etext
203215
ldr r2, =__data_start__
204216
ldr r3, =__data_end__

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K64F/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef MBED_CMSIS_NVIC_H
88
#define MBED_CMSIS_NVIC_H
99

10-
#define NVIC_NUM_VECTORS (16 + 85) // CORE + MCU Peripherals
10+
#define NVIC_NUM_VECTORS (16 + 86) // CORE + MCU Peripherals
1111
#define NVIC_USER_IRQ_OFFSET 16
1212

1313
#include "cmsis.h"

0 commit comments

Comments
 (0)