USB seems to init ok
This commit is contained in:
parent
0932d502c7
commit
98ab8117d6
|
@ -127,3 +127,7 @@
|
||||||
[submodule "hw/mcu/gd/nuclei-sdk"]
|
[submodule "hw/mcu/gd/nuclei-sdk"]
|
||||||
path = hw/mcu/gd/nuclei-sdk
|
path = hw/mcu/gd/nuclei-sdk
|
||||||
url = https://github.com/Nuclei-Software/nuclei-sdk.git
|
url = https://github.com/Nuclei-Software/nuclei-sdk.git
|
||||||
|
[submodule "hw/mcu/broadcom"]
|
||||||
|
path = hw/mcu/broadcom
|
||||||
|
url = git@github.com:adafruit/broadcom-peripherals.git
|
||||||
|
branch = main-build
|
||||||
|
|
|
@ -27,8 +27,9 @@
|
||||||
#include "bsp/board.h"
|
#include "bsp/board.h"
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
|
||||||
#include "io.h"
|
#include "broadcom/io.h"
|
||||||
#include "mmu.h"
|
#include "broadcom/mmu.h"
|
||||||
|
#include "broadcom/vcmailbox.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Forward USB interrupt events to TinyUSB IRQ Handler
|
// Forward USB interrupt events to TinyUSB IRQ Handler
|
||||||
|
@ -46,9 +47,8 @@ void OTG_FS_IRQHandler(void)
|
||||||
// Board porting API
|
// Board porting API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
void print(void) {
|
void print(const char* str) {
|
||||||
const char* greeting2 = "hello from cm100\r\n";
|
board_uart_write(str, strlen(str));
|
||||||
board_uart_write(greeting2, strlen(greeting2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_init(void)
|
void board_init(void)
|
||||||
|
@ -83,7 +83,7 @@ void board_init(void)
|
||||||
board_uart_write(greeting, strlen(greeting));
|
board_uart_write(greeting, strlen(greeting));
|
||||||
// gpio_setPinOutputBool(24, false);
|
// gpio_setPinOutputBool(24, false);
|
||||||
// gpio_setPinOutputBool(25, true);
|
// gpio_setPinOutputBool(25, true);
|
||||||
print();
|
// print();
|
||||||
// gpio_setPinOutputBool(25, false);
|
// gpio_setPinOutputBool(25, false);
|
||||||
// while (true) {
|
// while (true) {
|
||||||
// // for (size_t i = 0; i < 5; i++) {
|
// // for (size_t i = 0; i < 5; i++) {
|
||||||
|
@ -97,6 +97,12 @@ void board_init(void)
|
||||||
// gpio_setPinOutputBool(42, false);
|
// gpio_setPinOutputBool(42, false);
|
||||||
// }
|
// }
|
||||||
// while (1) uart_update();
|
// while (1) uart_update();
|
||||||
|
|
||||||
|
// Turn on USB peripheral.
|
||||||
|
print("Turning on USB power\r\n");
|
||||||
|
|
||||||
|
vcmailbox_set_power_state(VCMAILBOX_DEVICE_USB_HCD, true);
|
||||||
|
print("USB power on\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_led_write(bool state)
|
void board_led_write(bool state)
|
||||||
|
|
|
@ -2,7 +2,7 @@ UF2_FAMILY_ID = 0x57755a57
|
||||||
|
|
||||||
include $(TOP)/$(BOARD_PATH)/board.mk
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
||||||
|
|
||||||
MCU_DIR = hw/mcu/broadcom/bcm2711
|
MCU_DIR = hw/mcu/broadcom
|
||||||
|
|
||||||
CC = clang
|
CC = clang
|
||||||
|
|
||||||
|
@ -18,21 +18,23 @@ CFLAGS += \
|
||||||
|
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
src/portable/broadcom/synopsys/dcd_synopsys.c \
|
src/portable/broadcom/synopsys/dcd_synopsys.c \
|
||||||
$(MCU_DIR)/interrupts.c \
|
$(MCU_DIR)/broadcom/interrupts.c \
|
||||||
$(MCU_DIR)/io.c \
|
$(MCU_DIR)/broadcom/io.c \
|
||||||
$(MCU_DIR)/mmu.c
|
$(MCU_DIR)/broadcom/mmu.c \
|
||||||
|
$(MCU_DIR)/broadcom/vcmailbox.c
|
||||||
|
|
||||||
CROSS_COMPILE = aarch64-none-elf-
|
CROSS_COMPILE = aarch64-none-elf-
|
||||||
|
|
||||||
SKIP_NANOLIB = 1
|
SKIP_NANOLIB = 1
|
||||||
|
|
||||||
LD_FILE = $(MCU_DIR)/link.ld
|
LD_FILE = $(MCU_DIR)/broadcom/link.ld
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
$(TOP)/$(BOARD_PATH) \
|
$(TOP)/$(BOARD_PATH) \
|
||||||
$(TOP)/$(MCU_DIR)
|
$(TOP)/$(MCU_DIR) \
|
||||||
|
$(TOP)/lib/CMSIS_5/CMSIS/Core_A/Include
|
||||||
|
|
||||||
SRC_S += $(MCU_DIR)/boot.S
|
SRC_S += $(MCU_DIR)/broadcom/boot.S
|
||||||
|
|
||||||
$(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf
|
$(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf
|
||||||
$(OBJCOPY) -O binary $^ $@
|
$(OBJCOPY) -O binary $^ $@
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit c24e8f6898d7cf8e2884eb70dbabd97480526450
|
Loading…
Reference in New Issue