From 50ca0dda2ca4fe32f681f2955c9ec39355e3082e Mon Sep 17 00:00:00 2001 From: kkitayam <45088311+kkitayam@users.noreply.github.com> Date: Sat, 30 Oct 2021 23:41:23 +0900 Subject: Add dcd_musb.c --- hw/bsp/msp432e4/family.c | 2 ++ hw/bsp/msp432e4/family.mk | 17 +++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'hw') diff --git a/hw/bsp/msp432e4/family.c b/hw/bsp/msp432e4/family.c index 3bb36042d..567d5dc93 100644 --- a/hw/bsp/msp432e4/family.c +++ b/hw/bsp/msp432e4/family.c @@ -122,6 +122,8 @@ void board_init(void) for (int i = 0; i < 16; ++i) __NOP(); SYSCTL->SRUSB = 0u; + USB0->CC = USB_CC_CLKEN | (3u << USB_CC_CLKDIV_S); /* 60MHz = 240MHz / 4 */ + __DMB(); /* Wait for completion of opening of the clock gate */ } //--------------------------------------------------------------------+ diff --git a/hw/bsp/msp432e4/family.mk b/hw/bsp/msp432e4/family.mk index d0ea13456..aad5c77e8 100644 --- a/hw/bsp/msp432e4/family.mk +++ b/hw/bsp/msp432e4/family.mk @@ -11,6 +11,9 @@ CFLAGS += \ -D__MSP432E401Y__ \ -DCFG_TUSB_MCU=OPT_MCU_MSP432E4xx +# mcu driver cause following warnings +CFLAGS += -Wno-error=cast-qual -Wno-error=format= + # All source paths should be relative to the top level. LD_FILE = hw/mcu/ti/msp432e4/Source/msp432e401y.ld LDINC += $(TOP)/hw/mcu/ti/msp432e4/Include @@ -19,7 +22,7 @@ LDFLAGS += $(addprefix -L,$(LDINC)) MCU_DIR = hw/mcu/ti/msp432e4 SRC_C += \ - src/portable/mentor/dcd_musb.c \ + src/portable/mentor/musb/dcd_musb.c \ $(MCU_DIR)/Source/system_msp432e401y.c INC += \ @@ -37,12 +40,6 @@ ifneq ($(OS),Windows_NT) export LD_LIBRARY_PATH=$(dir $(shell which MSP430Flasher)) endif -# flash target using TI MSP430-Flasher -# http://www.ti.com/tool/MSP430-FLASHER -# Please add its installation dir to PATH -flash: $(BUILD)/$(PROJECT).hex - MSP430Flasher -w $< -z [VCC] - -# flash target using mspdebug. -flash-mspdebug: $(BUILD)/$(PROJECT).elf - $(MSPDEBUG) tilib "prog $<" --allow-fw-update +# For flash-jlink target +JLINK_DEVICE = MSP432E401Y +JLINK_IF = SWD -- cgit v1.3.1