1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2009-01-05     Bernard      first implementation
9  * 2014-06-20     xiaonong     ported to LPC43xx
10  */
11 
12 #include <rthw.h>
13 #include <rtthread.h>
14 
15 #include "board.h"
16 #include "drv_uart.h"
17 
18 
19 /**
20  * This is the timer interrupt service routine.
21  *
22  */
SysTick_Handler(void)23 void SysTick_Handler(void)
24 {
25     /* enter interrupt */
26     rt_interrupt_enter();
27 
28     rt_tick_increase();
29 
30     /* leave interrupt */
31     rt_interrupt_leave();
32 }
33 
34 extern void SystemCoreClockUpdate(void);
35 /**
36  * This function will initial LPC43xx board.
37  */
rt_hw_board_init()38 void rt_hw_board_init()
39 {
40 #ifdef CORE_M4
41     /* NVIC Configuration */
42 #ifdef  VECT_TAB_RAM
43     /* Set the Vector Table base location at 0x10000000 */
44     SCB->VTOR  = 0x10000000;
45 #else  /* VECT_TAB_FLASH  */
46     /* Set the Vector Table base location at 0x00000000 */
47     SCB->VTOR  = 0x1A000000;
48 #endif
49 #endif
50     /* update the core clock */
51     SystemCoreClockUpdate();
52 
53     /* init systick */
54     SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
55 
56     /* set pend exception priority */
57     NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
58 
59     /* init uart device */
60     rt_hw_uart_init();
61 
62     /* setup the console device */
63     rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
64 
65 #if LPC_EXT_SDRAM == 1
66     lpc_sdram_hw_init();
67     mpu_init();
68 #endif
69 }
70 
71 
72 
73