summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-10-04 13:13:51 +0700
committerhathach <[email protected]>2019-10-04 15:56:45 +0700
commit281cd858b067a240478490af6d302f7881b3aaf7 (patch)
treef588758462f228e8e7acb89586124b0d6fb838ea /hw
parent13d37e4a36386cadc4db29b005f33b48d68564b4 (diff)
adding lpc1549, but couldnt recieve setup packet, though setup received interrupt is triggered
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c4
-rw-r--r--hw/bsp/lpcxpresso1347/board.mk2
-rw-r--r--hw/bsp/lpcxpresso1549/board.mk6
-rw-r--r--hw/bsp/lpcxpresso1549/lpcxpresso1549.c14
4 files changed, 9 insertions, 17 deletions
diff --git a/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c b/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
index ce093ed29..f7fc16ec2 100644
--- a/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
+++ b/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
@@ -58,8 +58,6 @@ static const PINMUX_GRP_T pinmuxing[] =
{0, 19, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // UART0 TX
};
-
-#if 1
/* Setup system clocking */
static void SystemSetupClocking(void)
{
@@ -114,13 +112,11 @@ static void SystemSetupClocking(void)
/* Wait for PLL to lock */
while (!Chip_Clock_IsUSBPLLLocked()) {}
}
-#endif
// Invoked by startup code
void SystemInit(void)
{
SystemSetupClocking();
-// Chip_SystemInit();
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_RAM1);
/* Enable IOCON clock */
diff --git a/hw/bsp/lpcxpresso1347/board.mk b/hw/bsp/lpcxpresso1347/board.mk
index 4e0c70392..0f9be1b56 100644
--- a/hw/bsp/lpcxpresso1347/board.mk
+++ b/hw/bsp/lpcxpresso1347/board.mk
@@ -7,7 +7,7 @@ CFLAGS += \
-D__USE_LPCOPEN \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_LPC13XX \
- -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM3")))' \
+ -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM2")))' \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
# startup.c and lpc_types.h cause following errors
diff --git a/hw/bsp/lpcxpresso1549/board.mk b/hw/bsp/lpcxpresso1549/board.mk
index 682674822..929c63a8d 100644
--- a/hw/bsp/lpcxpresso1549/board.mk
+++ b/hw/bsp/lpcxpresso1549/board.mk
@@ -5,13 +5,11 @@ CFLAGS += \
-nostdlib \
-DCORE_M3 \
-D__USE_LPCOPEN \
+ -DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_LPC15XX \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-# -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM3")))' \
-# -DCFG_EXAMPLE_MSC_READONLY \
-
-# startup.c and lpc_types.h cause following errors
+# mcu driver cause following warnings
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable
MCU_DIR = hw/mcu/nxp/lpc_driver/lpc15xx/lpc_chip_15xx
diff --git a/hw/bsp/lpcxpresso1549/lpcxpresso1549.c b/hw/bsp/lpcxpresso1549/lpcxpresso1549.c
index 8e178eb76..e10e24020 100644
--- a/hw/bsp/lpcxpresso1549/lpcxpresso1549.c
+++ b/hw/bsp/lpcxpresso1549/lpcxpresso1549.c
@@ -40,24 +40,21 @@ const uint32_t RTCOscRateIn = 32768;
/* Pin muxing table, only items that need changing from their default pin
state are in this table. */
-static const PINMUX_GRP_T pinmuxing[] =
+static const PINMUX_GRP_T pinmuxing[] =
{
- {1, 11, (IOCON_MODE_PULLDOWN | IOCON_DIGMODE_EN)}, /* PIO0_3 used for USB_VBUS */
+ {1, 11, (IOCON_MODE_PULLDOWN | IOCON_DIGMODE_EN)}, /* PIO1_11-ISP_1 (VBUS) */
};
// Invoked by startup code
void SystemInit(void)
{
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
- Chip_SYSCTL_PeriphReset(RESET_IOCON);
+ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
+ Chip_SYSCTL_PeriphReset(RESET_IOCON);
- // Pin Mux
+ // Pin Mux
Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
- // SWM USB
- Chip_SWM_MovablePortPinAssign(SWM_USB_VBUS_I, 1, 11);
-
Chip_SetupXtalClocking();
}
@@ -82,6 +79,7 @@ void board_init(void)
Chip_GPIO_SetPinDIRInput(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
// USB: Setup PLL clock, and power
+ Chip_SWM_MovablePortPinAssign(SWM_USB_VBUS_I, 1, 11);
Chip_USB_Init();
}