summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-11-05 13:13:21 +0700
committerhathach <[email protected]>2021-11-05 13:13:21 +0700
commitd87a897a7bc524139f844a323df4e0679b2deebe (patch)
treef79aeb4d6078ad33c49968d1fe719d36e50696fb /hw
parentd9cf49cbfd2e677f30f993257ffd5d1218fe21cf (diff)
xmc4500 ported, cdc msc example run fine
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/xmc4000/family.c13
-rw-r--r--hw/bsp/xmc4000/family.mk3
2 files changed, 16 insertions, 0 deletions
diff --git a/hw/bsp/xmc4000/family.c b/hw/bsp/xmc4000/family.c
index 8b5f82f15..bf6684736 100644
--- a/hw/bsp/xmc4000/family.c
+++ b/hw/bsp/xmc4000/family.c
@@ -30,6 +30,15 @@
#include "bsp/board.h"
#include "board.h"
+
+//--------------------------------------------------------------------+
+// Forward USB interrupt events to TinyUSB IRQ Handler
+//--------------------------------------------------------------------+
+void USB0_0_IRQHandler(void)
+{
+ tud_int_handler(0);
+}
+
void board_init(void)
{
board_clock_init();
@@ -58,6 +67,10 @@ void board_init(void)
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
NVIC_SetPriority(USB0_0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
#endif
+
+ // USB Power Enable
+ XMC_SCU_RESET_DeassertPeripheralReset(XMC_SCU_PERIPHERAL_RESET_USB0);
+ XMC_SCU_POWER_EnableUsb();
}
//--------------------------------------------------------------------+
diff --git a/hw/bsp/xmc4000/family.mk b/hw/bsp/xmc4000/family.mk
index e5b9f7b1a..0b32bdeb5 100644
--- a/hw/bsp/xmc4000/family.mk
+++ b/hw/bsp/xmc4000/family.mk
@@ -18,6 +18,8 @@ CFLAGS += \
# mcu driver cause following warnings
#CFLAGS += -Wno-error=shadow -Wno-error=cast-align
+SKIP_NANOLIB = 1
+
SRC_C += \
src/portable/synopsys/dwc2/dcd_dwc2.c \
$(MCU_DIR)/Newlib/syscalls.c \
@@ -25,6 +27,7 @@ SRC_C += \
$(MCU_DIR)/XMCLib/src/xmc4_gpio.c \
$(MCU_DIR)/XMCLib/src/xmc4_scu.c
+
SRC_S += $(MCU_DIR)/CMSIS/Infineon/COMPONENT_$(MCU_VARIANT)/Source/TOOLCHAIN_GCC_ARM/startup_$(MCU_VARIANT).S
INC += \