Skip to content

Commit 8f607de

Browse files
committed
[BSP] Add EMAC driver in lpc4088
1 parent 6809547 commit 8f607de

File tree

13 files changed

+1380
-129
lines changed

13 files changed

+1380
-129
lines changed

bsp/lpc408x/Libraries/Device/NXP/LPC407x_8x_177x_8x/Source/Templates/system_LPC407x_8x_177x_8x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@
221221
#define SCS_Val 0x00000020
222222
#define CLKSRCSEL_Val 0x00000001
223223
#define PLL0_SETUP 1
224-
#define PLL0CFG_Val 0x0000000a
224+
#define PLL0CFG_Val 0x00000009
225225
#define PLL1_SETUP 1
226226
#define PLL1CFG_Val 0x00000023
227227
#define CCLKSEL_Val 0x00000101
228228
#define USBCLKSEL_Val 0x00000201
229-
#define EMCCLKSEL_Val 0x00000001
229+
#define EMCCLKSEL_Val 0x00000000
230230
#define PCLKSEL_Val 0x00000002
231231
#define SPIFICLKSEL_Val 0x00000002
232232
#define PCONP_Val 0x042887DE

bsp/lpc408x/Libraries/Device/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ elif rtconfig.CROSS_TOOL == 'keil':
1818
elif rtconfig.CROSS_TOOL == 'iar':
1919
src += ['NXP/LPC407x_8x_177x_8x/Source/Templates/IAR/startup_LPC407x_8x_177x_8x.s']
2020

21-
group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
21+
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
2222

2323
Return('group')

bsp/lpc408x/applications/board.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ void rt_hw_board_init()
5252
#endif
5353

5454
/* init systick */
55-
SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
55+
SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND - 1);
5656
/* set pend exception priority */
5757
NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
58+
5859
/*init uart device*/
5960
rt_hw_uart_init();
6061
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
@@ -64,5 +65,5 @@ void rt_hw_board_init()
6465
lpc_sdram_hw_init();
6566
rt_kprintf("done!\n");
6667
#endif
67-
rt_components_board_init();
68+
// rt_components_board_init();
6869
}

bsp/lpc408x/applications/board.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Date Author Notes
1212
* 2009-09-22 Bernard add board.h to this bsp
1313
* 2010-02-04 Magicoe add board.h to LPC176x bsp
14+
* 2013-12-18 Bernard porting to LPC4088 bsp
1415
*/
1516

1617
#ifndef __BOARD_H__
@@ -19,10 +20,21 @@
1920
#include "LPC407x_8x_177x_8x.h"
2021
#include <rtthread.h>
2122

23+
/* SRAM allocation for Peripherals */
24+
#define USB_RAM_BASE 0x20000000
25+
#define MCI_RAM_BASE 0x20002000
26+
#define ETH_RAM_BASE 0x20004000
27+
28+
/* use SDRAM in default */
29+
#define LPC_EXT_SDRAM 1
30+
31+
/* disable SDRAM in default */
32+
#ifndef LPC_EXT_SDRAM
33+
#define LPC_EXT_SDRAM 0
34+
#endif
35+
2236
// <RDTConfigurator URL="http://www.rt-thread.com/eclipse">
2337

24-
// <integer name="LPC_EXT_SDRAM" description="Enable External SDRAM memory" default="0" />
25-
//#define LPC_EXT_SDRAM 0
2638
// <integer name="LPC_EXT_SDRAM" description="Begin Address of External SDRAM" default="0xA0000000" />
2739
#define LPC_EXT_SDRAM_BEGIN 0xA0000000
2840
// <integer name="LPC_EXT_SDRAM_END" description="End Address of External SDRAM" default="0xA2000000" />
@@ -47,7 +59,7 @@ extern int Image$$RW_IRAM1$$ZI$$Limit;
4759
extern int __bss_end;
4860
#define HEAP_BEGIN ((void *)&__bss_end)
4961
#endif
50-
#define HEAP_END (0x10000000 + 0x10000)
62+
#define HEAP_END (void*)(0x10000000 + 0x10000)
5163

5264
#define FINSH_DEVICE_NAME RT_CONSOLE_DEVICE_NAME
5365
void rt_hw_board_init(void);

0 commit comments

Comments
 (0)