Skip to content

Commit 9abcf3d

Browse files
committed
Initial commit for K64F
- KPSDK addition - CMSIS + HAL for K64F - HAL is not yet implemented - scripts - target contain macros, ignore folders, cmsis copy folders
1 parent 12e3614 commit 9abcf3d

File tree

146 files changed

+154394
-195
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+154394
-195
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
LR_IROM1 0x00000000 0x100000 { ; load region size_region (132k)
3+
ER_IROM1 0x00000000 0x100000 { ; load address = execution address
4+
*.o (RESET, +First)
5+
*(InRoot$$Sections)
6+
.ANY (+RO)
7+
}
8+
; 8_byte_aligned(62 vect * 4 bytes) = 8_byte_aligned(0x194) = 0x198
9+
; 0x40000 - 0x198 = 0x3FE68
10+
RW_IRAM1 0x1FFF0198 0x3FE68 {
11+
.ANY (+RW +ZI)
12+
}
13+
}
14+

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

Lines changed: 733 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* mbed Microcontroller Library - stackheap
2+
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
3+
*
4+
* Setup a fixed single stack/heap memory model,
5+
* between the top of the RW/ZI region and the stackpointer
6+
*/
7+
8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
12+
#include <rt_misc.h>
13+
#include <stdint.h>
14+
15+
extern char Image$$RW_IRAM1$$ZI$$Limit[];
16+
17+
extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
18+
uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
19+
uint32_t sp_limit = __current_sp();
20+
21+
zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
22+
23+
struct __initial_stackheap r;
24+
r.heap_base = zi_limit;
25+
r.heap_limit = sp_limit;
26+
return r;
27+
}
28+
29+
#ifdef __cplusplus
30+
}
31+
#endif
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* mbed Microcontroller Library - CMSIS
2+
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
3+
*
4+
* A generic CMSIS include header, pulling in LPC11U24 specifics
5+
*/
6+
7+
#ifndef MBED_CMSIS_H
8+
#define MBED_CMSIS_H
9+
10+
#include "device/MK64F12/MK64F12.h"
11+
#include "cmsis_nvic.h"
12+
13+
#endif
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* mbed Microcontroller Library - cmsis_nvic for LPC11U24
2+
* Copyright (c) 2011 ARM Limited. All rights reserved.
3+
*
4+
* CMSIS-style functionality to support dynamic vectors
5+
*/
6+
#include "cmsis_nvic.h"
7+
8+
#define NVIC_RAM_VECTOR_ADDRESS (0x1FFF0000) // Vectors positioned at start of RAM
9+
#define NVIC_FLASH_VECTOR_ADDRESS (0x0) // Initial vector position in flash
10+
11+
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
12+
uint32_t *vectors = (uint32_t*)SCB->VTOR;
13+
uint32_t i;
14+
15+
// Copy and switch to dynamic vectors if the first time called
16+
if (SCB->VTOR == NVIC_FLASH_VECTOR_ADDRESS) {
17+
uint32_t *old_vectors = vectors;
18+
vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS;
19+
for (i=0; i<NVIC_NUM_VECTORS; i++) {
20+
vectors[i] = old_vectors[i];
21+
}
22+
SCB->VTOR = (uint32_t)NVIC_RAM_VECTOR_ADDRESS;
23+
}
24+
vectors[IRQn + 16] = vector;
25+
}
26+
27+
uint32_t NVIC_GetVector(IRQn_Type IRQn) {
28+
uint32_t *vectors = (uint32_t*)SCB->VTOR;
29+
return vectors[IRQn + 16];
30+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* mbed Microcontroller Library - cmsis_nvic
2+
* Copyright (c) 2009-2011 ARM Limited. All rights reserved.
3+
*
4+
* CMSIS-style functionality to support dynamic vectors
5+
*/
6+
7+
#ifndef MBED_CMSIS_NVIC_H
8+
#define MBED_CMSIS_NVIC_H
9+
10+
#define NVIC_NUM_VECTORS (16 + 101) // CORE + MCU Peripherals
11+
#define NVIC_USER_IRQ_OFFSET 16
12+
13+
#include "cmsis.h"
14+
15+
#ifdef __cplusplus
16+
extern "C" {
17+
#endif
18+
19+
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
20+
uint32_t NVIC_GetVector(IRQn_Type IRQn);
21+
22+
#ifdef __cplusplus
23+
}
24+
#endif
25+
26+
#endif

0 commit comments

Comments
 (0)