Skip to content

Commit 03b3a4e

Browse files
committed
Target K64F addition.
Squashed commit of the following: commit db3c9f7 Author: 0xc0170 <[email protected]> Date: Wed Apr 2 09:52:00 2014 +0200 K64F - KSDK - Warnings fixes commit a639a5c Merge: 67a2c2a f3de345 Author: 0xc0170 <[email protected]> Date: Tue Apr 1 12:48:35 2014 +0200 Merge branch latest 'master' into dev_target_k64f Conflicts: libraries/rtos/rtx/RTX_Conf_CM.c workspace_tools/build_api.py commit 67a2c2a Author: 0xc0170 <[email protected]> Date: Sun Mar 30 13:19:51 2014 +0200 K64F - PinName for buttons (SW2, SW3) commit 957573e Author: 0xc0170 <[email protected]> Date: Tue Mar 25 11:46:57 2014 +0100 K64F - pins addition to mbed HAL, uart - 4 instances, fix i2c instance which was not stored commit 2347a6d Author: sg- <[email protected]> Date: Mon Mar 24 15:20:51 2014 -0500 Added wait to i2c stop commit b7b4a9c Author: 0xc0170 <[email protected]> Date: Mon Mar 24 19:28:16 2014 +0100 K64F - I2c - ack flag retreive correction (logic inverted in ksdk hal) commit 46c8752 Author: sg- <[email protected]> Date: Mon Mar 24 13:16:18 2014 -0500 Added I2C Pinnames commit b71c7a0 Author: 0xc0170 <[email protected]> Date: Tue Mar 18 17:02:34 2014 +0100 K64F Arduino pinNames update commit d41b0ee Merge: 9c0a982 e2574eb Author: 0xc0170 <[email protected]> Date: Tue Mar 18 14:57:57 2014 +0100 Merge remote-tracking branch 'upstream/master' into dev_target_k64f. K64F gpio changed according to the latest mbed master. Conflicts: libraries/rtos/rtx/RTX_CM_lib.h workspace_tools/export/uvision4.py commit 9c0a982 Author: 0xc0170 <[email protected]> Date: Mon Mar 17 21:08:17 2014 +0100 K64F - sleep support commit 5edcf36 Author: 0xc0170 <[email protected]> Date: Sun Mar 16 18:19:55 2014 +0100 K64F - pullup/down corrections, LED1 - R, LED2 - G, LED3 - B commit a2b3b53 Author: 0xc0170 <[email protected]> Date: Thu Mar 13 20:55:39 2014 +0100 K64F - SPI - delays are set, pin definition for tests commit 1f3b3ab Author: 0xc0170 <[email protected]> Date: Tue Mar 11 21:26:00 2014 +0100 K64F - DAC update - tested with test a8 - internal reference set to VDDA - PinName DAC0_OUT commit 26d8cf4 Author: 0xc0170 <[email protected]> Date: Tue Mar 11 08:31:44 2014 +0100 KSDK - drivers layer removal, mbed HAL using only KSDK HAL - ADC corrections with channels, and clock configuration commit 67ebe14 Author: 0xc0170 <[email protected]> Date: Mon Mar 10 12:46:08 2014 +0100 K20 copy files removed, targets.py - vertical alignment for K64F definition commit be5c562 Merge: 696a713 fe0aca9 Author: Emilio Monti <[email protected]> Date: Mon Mar 10 11:14:55 2014 +0000 Merge branch 'rtos_support' into dev_target_k64f commit 696a713 Author: 0xc0170 <[email protected]> Date: Mon Mar 10 12:05:30 2014 +0100 [FIX] K64F - adc, sgtl driver updates commit fe0aca9 Author: Emilio Monti <[email protected]> Date: Mon Mar 10 11:04:16 2014 +0000 Add RTOS support for K64F commit 5c3edcb Author: 0xc0170 <[email protected]> Date: Sun Mar 9 20:43:38 2014 +0100 K64F - uvision templates update - uvision 5.10 supports K64F commit 33f18d1 Merge: 26f7587 74e9b2e Author: 0xc0170 <[email protected]> Date: Sat Mar 8 10:34:25 2014 +0100 Update branch from mbed master - merge branch 'master' into dev_target_k64f Conflicts: libraries/USBDevice/USBDevice/USBEndpoints.h libraries/USBDevice/USBDevice/USBHAL_KL25Z.cpp workspace_tools/export/uvision4.py workspace_tools/targets.py commit 26f7587 Author: 0xc0170 <[email protected]> Date: Thu Mar 6 22:15:53 2014 +0100 K64F - USBDevice - MPU disable in init commit e54d6bb Author: 0xc0170 <[email protected]> Date: Wed Feb 26 21:06:58 2014 +0100 K64F - clock setup 4 (usb clock enable) commit c416573 Author: 0xc0170 <[email protected]> Date: Wed Feb 26 20:01:47 2014 +0100 K64F - USBDevice addition commit 9fcdbb8 Author: 0xc0170 <[email protected]> Date: Mon Feb 24 19:11:48 2014 +0100 K64F SPI HAL - initial version commit 8093df5 Author: 0xc0170 <[email protected]> Date: Sat Feb 22 13:14:44 2014 +0100 K64F - RTC and I2C implementation (using KPSDK HAL) - instance correction in objects and peripherals names headers commit 7ef3fbd Author: 0xc0170 <[email protected]> Date: Fri Feb 14 09:45:27 2014 +0100 mbed RTC HAL for K64F commit e40332f Merge: e059f65 6bfcd87 Author: 0xc0170 <[email protected]> Date: Thu Feb 13 14:20:20 2014 +0100 Merge branch 'master' into dev_target_k64f Conflicts: workspace_tools/build_api.py workspace_tools/export/uvision4.py workspace_tools/targets.py workspace_tools/toolchains/__init__.py commit e059f65 Author: 0xc0170 <[email protected]> Date: Wed Feb 5 21:35:49 2014 +0100 pwm mbed HAL - using jusst ftm hal from KPSDK, not yet functional commit b784278 Author: 0xc0170 <[email protected]> Date: Mon Feb 3 18:28:24 2014 +0100 uvision exporters for K64F, uticker - lptmr - lptmr - no hal neiter driver, quick implementation using registers and internal clock - exporters for K64F - using K60 1MB target, because K64F is not available in 4.7 yet commit 7a03069 Author: Bogdan Marinescu <[email protected]> Date: Tue Jan 28 16:29:54 2014 +0200 Attempt to keep target's include directory structure commit a2445b3 Author: 0xc0170 <[email protected]> Date: Mon Jan 27 07:25:16 2014 +0100 Original KPSDK include directory structure for device commit 9c07c58 Author: 0xc0170 <[email protected]> Date: Fri Jan 24 16:51:17 2014 +0000 K64F ADC - initial commit - ADC using KPSDK driver commit 88e03ef Author: 0xc0170 <[email protected]> Date: Fri Jan 24 12:18:14 2014 +0000 GPI IRQ - nvic vectors number correction - gpio irq HAL implementation commit e83f110 Author: 0xc0170 <[email protected]> Date: Fri Jan 24 10:06:44 2014 +0000 PORT HAL implementation - using gpio hal port commit 75c2194 Author: 0xc0170 <[email protected]> Date: Thu Jan 23 16:02:36 2014 +0000 Serial (only 8bit at the moment), using KPSDK HAL commit 296e79d Author: 0xc0170 <[email protected]> Date: Thu Jan 23 08:35:50 2014 +0000 Folder structure correction for K64F - KPSDK - scripts reverted, only new macro is available - K64F specific headers are in HAL in device folder commit f236b1f Author: 0xc0170 <[email protected]> Date: Wed Jan 22 16:07:30 2014 +0100 update KPSDK to RC1 - the update causes few more dependences which were reported. Will be removed later (usb, boards) - pit timer - hal use , pit driver uses us period commit f02c535 Author: 0xc0170 <[email protected]> Date: Tue Jan 21 09:45:55 2014 +0100 KPSDK In/out declaration removal commit 8c88e09 Author: 0xc0170 <[email protected]> Date: Tue Jan 21 09:12:41 2014 +0100 gpio_t struct only needs pinName - gpio_init creates init objects on stack commit 6b96d4e Author: 0xc0170 <[email protected]> Date: Mon Jan 20 19:59:03 2014 +0100 us ticker - pit implementation (not functional yet) - pit driver in KPSDK - added sdk prefix to needed functions commit 098e60a Author: 0xc0170 <[email protected]> Date: Mon Jan 20 13:01:58 2014 +0100 GPIO HAL - gpio_set implementation commit 2bfebbf Author: 0xc0170 <[email protected]> Date: Sun Jan 19 20:46:55 2014 +0100 GPIO KPSDK changes - gpio driver - sdk prefix, no lookuptable, input/output declaration, refactoring, set MUX to GPIO - gpio api in mbed implementation, tested on blue led commit d083733 Author: 0xc0170 <[email protected]> Date: Sat Jan 18 17:14:09 2014 +0100 Update folder structure for KPSDK - drivers addition - usb (needed by drivers - needs to be fixed) - utilities - hal folder - drivers/flash removed (needs to be fixed) - usb host removed (needs to be fixed) commit 9abcf3d Author: 0xc0170 <[email protected]> Date: Thu Jan 16 11:06:16 2014 +0100 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 213efa7 commit 03b3a4e

File tree

160 files changed

+171586
-15
lines changed

Some content is hidden

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

160 files changed

+171586
-15
lines changed

libraries/USBDevice/USBDevice/USBEndpoints.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ typedef enum {
4141
#include "USBEndpoints_LPC17_LPC23.h"
4242
#elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC1347)
4343
#include "USBEndpoints_LPC11U.h"
44-
#elif defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M)
44+
#elif defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M) | defined(TARGET_K64F)
4545
#include "USBEndpoints_KL25Z.h"
4646
#elif defined (TARGET_STM32F4XX)
4747
#include "USBEndpoints_STM32F4.h"

libraries/USBDevice/USBDevice/USBHAL_KL25Z.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1717
*/
1818

19-
#if defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M)
19+
#if defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M) | defined(TARGET_K64F)
2020

2121
#include "USBHAL.h"
2222

@@ -86,6 +86,9 @@ USBHAL::USBHAL(void) {
8686
// Disable IRQ
8787
NVIC_DisableIRQ(USB0_IRQn);
8888

89+
#if defined(TARGET_K64F)
90+
MPU->CESR=0;
91+
#endif
8992
// fill in callback array
9093
epCallback[0] = &USBHAL::EP1_OUT_callback;
9194
epCallback[1] = &USBHAL::EP1_IN_callback;
@@ -136,9 +139,9 @@ USBHAL::USBHAL(void) {
136139
while(USB0->USBTRC0 & USB_USBTRC0_USBRESET_MASK);
137140

138141
// Set BDT Base Register
139-
USB0->BDTPAGE1=(uint8_t)((uint32_t)bdt>>8);
140-
USB0->BDTPAGE2=(uint8_t)((uint32_t)bdt>>16);
141-
USB0->BDTPAGE3=(uint8_t)((uint32_t)bdt>>24);
142+
USB0->BDTPAGE1 = (uint8_t)((uint32_t)bdt>>8);
143+
USB0->BDTPAGE2 = (uint8_t)((uint32_t)bdt>>16);
144+
USB0->BDTPAGE3 = (uint8_t)((uint32_t)bdt>>24);
142145

143146
// Clear interrupt flag
144147
USB0->ISTAT = 0xff;

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

Lines changed: 13416 additions & 0 deletions
Large diffs are not rendered by default.
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 (1000k)
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: 685 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 "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 + 85) // 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)