summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-09-12 14:44:02 +0700
committerhathach <[email protected]>2013-09-12 14:44:02 +0700
commit968c218f33e2238eb094797d5bc5b80682530587 (patch)
treef091e6922656407a9f9b9d3225d98612b634f6ce
parentad5ce98c027e317df873560e99cc63f7b8fbbb48 (diff)
parent50d0e9bb8d49c150a2924f6d691d0f678c9484b0 (diff)
Merge branch 'master' of github.com:microbuilder/tinyusb
Conflicts: demos/host/host_os_none/host_os_none.uvopt
-rw-r--r--demos/bsp/boards/microbuilder/board_lpc4357usb.c8
-rw-r--r--demos/bsp/boards/microbuilder/board_lpc4357usb.h3
-rw-r--r--demos/bsp/boards/microbuilder/board_lpc4357usb_etminit.ini31
-rw-r--r--demos/host/host_os_none/host_os_none.uvproj2
4 files changed, 42 insertions, 2 deletions
diff --git a/demos/bsp/boards/microbuilder/board_lpc4357usb.c b/demos/bsp/boards/microbuilder/board_lpc4357usb.c
index 829348537..83f9c8b16 100644
--- a/demos/bsp/boards/microbuilder/board_lpc4357usb.c
+++ b/demos/bsp/boards/microbuilder/board_lpc4357usb.c
@@ -69,7 +69,15 @@ void board_init(void)
scu_pinmux(0x7, 5, MD_PDN, 0x5); /* P7_5 = TRACEDATA[1] */
scu_pinmux(0x7, 6, MD_PDN, 0x5); /* P7_6 = TRACEDATA[2] */
scu_pinmux(0x7, 7, MD_PDN, 0x5); /* P7_7 = TRACEDATA[3] */
+
+ // USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357
+ scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7); // USB0 VBus Power
+ // 1.5Kohm pull-up resistor is needed on the USB DP data signal. GPIO28 (base), P9_5 (LPC4357) controls
+ //scu_pinmux(0x9, 5, MD_PUP|MD_EZI|MD_ZI, FUNC4); // GPIO5[18]
+ //GPIO_SetDir(5, BIT_(18), 1); // output
+ //GPIO_ClearValue(5, BIT_(18));
+
/* Init I2C @ 400kHz */
I2C_Init(LPC_I2C0, 400000);
I2C_Cmd(LPC_I2C0, ENABLE);
diff --git a/demos/bsp/boards/microbuilder/board_lpc4357usb.h b/demos/bsp/boards/microbuilder/board_lpc4357usb.h
index 9a67d4a00..96d535c7c 100644
--- a/demos/bsp/boards/microbuilder/board_lpc4357usb.h
+++ b/demos/bsp/boards/microbuilder/board_lpc4357usb.h
@@ -63,7 +63,8 @@
#include "lpc43xx_uart.h"
#include "lpc43xx_i2c.h"
-#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
+#define CFG_PRINTF_TARGET PRINTF_TARGET_SWO
+//#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
#ifdef __cplusplus
}
diff --git a/demos/bsp/boards/microbuilder/board_lpc4357usb_etminit.ini b/demos/bsp/boards/microbuilder/board_lpc4357usb_etminit.ini
new file mode 100644
index 000000000..67aed412e
--- /dev/null
+++ b/demos/bsp/boards/microbuilder/board_lpc4357usb_etminit.ini
@@ -0,0 +1,31 @@
+/*-------------------------------------------------------------------
+** Define the function to enable the trace port
+**-----------------------------------------------------------------*/
+FUNC void EnableTPIU(void) {
+
+ /* Configure TRACE pins for MCB4357 */
+ //_WDWORD(0x40086790, 0x000000B2); // LPC_SCU->SFSPF_4 = 2;
+ //_WDWORD(0x40086794, 0x000000B3); // LPC_SCU->SFSPF_5 = 3;
+ //_WDWORD(0x40086798, 0x000000B3); // LPC_SCU->SFSPF_6 = 3;
+ //_WDWORD(0x4008679C, 0x000000B3); // LPC_SCU->SFSPF_7 = 3;
+ //_WDWORD(0x400867A0, 0x000000B3); // LPC_SCU->SFSPF_8 = 3;
+
+ /* Configure TRACE pins for LPC4357USB */
+ _WDWORD(0x40086790, 0x000000B2); // LPC_SCU->SFSPF_4 = 2 - TRACECLK
+ _WDWORD(0x40086390, 0x000000B5); // LPC_SCU->SFSP7_4 = 5 - TRACEDATA[0]
+ _WDWORD(0x40086394, 0x000000B5); // LPC_SCU->SFSP7_5 = 5 - TRACEDATA[1]
+ _WDWORD(0x40086398, 0x000000B5); // LPC_SCU->SFSP7_6 = 5 - TRACEDATA[2]
+ _WDWORD(0x4008639C, 0x000000B5); // LPC_SCU->SFSP7_7 = 5 - TRACEDATA[3]
+}
+
+/*-------------------------------------------------------------------
+** Invoke the function at debugger startup
+**-----------------------------------------------------------------*/
+EnableTPIU();
+
+/*-------------------------------------------------------------------
+** Execute upon software RESET
+**-----------------------------------------------------------------*/
+FUNC void OnResetExec(void) {
+ EnableTPIU();
+}
diff --git a/demos/host/host_os_none/host_os_none.uvproj b/demos/host/host_os_none/host_os_none.uvproj
index 6a0432933..30df50d6d 100644
--- a/demos/host/host_os_none/host_os_none.uvproj
+++ b/demos/host/host_os_none/host_os_none.uvproj
@@ -746,7 +746,7 @@
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
- <InitializationFile></InitializationFile>
+ <InitializationFile>..\..\bsp\boards\microbuilder\board_lpc4357usb_etminit.ini</InitializationFile>
<Driver>Segger\JL2CM3.dll</Driver>
</TargetDlls>
</DebugOption>