Merge in upstream changes

Merge upstream changes and expand example support to hid examples.
This commit is contained in:
Gordon McNab 2021-12-08 10:05:32 +00:00
parent 45869958f6
commit fa06bd01c9
6 changed files with 270 additions and 3 deletions

41
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,41 @@
{
"configurations": [
{
"name": "FT900",
"includePath": [
// Toolchain installed FT90X SDK.
"C:/Program Files (x86)/Bridgetek/FT9xx Toolchain/Toolchain/hardware/include",
// Submodule for FT90X SDK.
//"${workspaceFolder}/hw/mcu/bridgetek/ft9xx/hardware/Source/include",
// Board headers.
"${workspaceFolder}/hw/bsp/brtmm90x/boards/mm900evxb",
// Hardware abstraction headers.
"${workspaceFolder}/hw/",
// Local header files.
".",
"${workspaceFolder}/src",
// Example headers.
"${workspaceFolder}/examples/device/cdc_msc/src"
//"${workspaceFolder}/examples/host/hid_controller/src"
],
"defines": [
"__FT900__",
"BOARD=mm900evxb",
//"FT32_PORT", "FT32_PORT_HEAP=4", // For FreeRTOS
"CFG_TUSB_MCU=OPT_MCU_FT90X", // For FT90x
//"CFG_TUSB_RHPORT0_MODE=(OPT_MODE_HOST|OPT_MODE_HIGH_SPEED)",
//"CFG_TUSB_RHPORT1_MODE=(OPT_MODE_DEVICE|OPT_MODE_HIGH_SPEED)",
//"BOARD_DEVICE_RHPORT_NUM=1",
//"BOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED",
"CFG_TUSB_DEBUG=0"
],
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/Program Files (x86)/Bridgetek/FT9xx Toolchain/Toolchain/tools/bin/ft32-elf-gcc",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "windows-gcc-x64",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}

32
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,32 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug TinyUSB CDC_MSC",
"type": "cppdbg",
"MIMode": "gdb",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "examples/device/program.elf",
//"program": "examples/device/cdc_msc/_build/mm900ev1b/cdc_msc.elf",
"preLaunchTask": "Build and Program (Memory)",
"target": "localhost:9998",
"remote": true,
"gdbpath": "C:/Program Files (x86)/Bridgetek/FT9xx Toolchain/Toolchain/tools/bin/ft32-elf-gdb.exe",
"stopAtEntry": true,
"environment": [],
"console": "externalTerminal",
"miDebuggerPath": "C:/Program Files (x86)/Bridgetek/FT9xx Toolchain/Toolchain/tools/bin/ft32-elf-gdb.exe",
//"miDebuggerArgs": "-x lib\\FreeRTOS\\.gdbinit-FreeRTOS-helpers",
"miDebuggerServerAddress": "localhost:9998",
"launchCompleteCommand": "None",
"debugServerPath": "C:\\Users\\gordon.mcnab\\AppData\\Local\\Programs\\Python\\Python37\\python.exe",
"debugServerArgs":
"\"C:/Program Files (x86)/Bridgetek/FT9xx Toolchain/Toolchain/utilities/gdb_bridge.py\" live pm",
//"rtos": "FreeRTOS",
}
]
}

17
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"files.associations": {
"tusb_option.h": "c",
"ft900.h": "c",
"ft900_usbd.h": "c",
"ft900_registers.h": "c",
"ft900_usbd_registers.h": "c",
"dcd.h": "c",
"stdint.h": "c",
"board.h": "c",
"ft900_ehci_registers.h": "c",
"stdint-gcc.h": "c",
"ft900_memctl.h": "c",
"stddef.h": "c"
},
"cmake.configureOnOpen": true
}

176
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,176 @@
{
"version": "2.0.0",
"options": {
"env": {
// Set this to the type of example.
// Choices can be "device" or "host".
"exampleType": "device",
// Set this to the name of the example.
// The name is the folder name in the examples directory.
"exampleName": "cdc_msc",
// Set this to the name of the board to target.
"boardName": "mm900evxb"
}
},
"inputs": [
{
"type": "pickString",
"id": "pickExampleName",
"description": "Which example project do you want to use?",
"options": [
"board_test",
"cdc_msc",
"hid_boot_interface",
"hid_composite",
],
"default": "board_test"
},
{
"type": "pickString",
"id": "pickBoardName",
"description": "Which board type do you want to use?",
"options": [
"mm900ev1b",
"mm900ev2b",
"mm900ev3b"
],
"default": "mm900ev1b"
}
],
"tasks": [
{
"label": "test env",
"type": "shell",
"command": "echo",
"args": [
"$env:exampleName"
],
"problemMatcher": []
},
{
"label": "Build and Program (Memory)",
"dependsOrder": "sequence",
"dependsOn": [
"Build Project",
"Program Project (Memory)"
],
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "copy",
"args": [
"examples\\$env:exampleType\\$env:exampleName\\_build\\$env:boardName\\$env:exampleName.elf",
"examples\\$env:exampleType\\program.elf"
],
"problemMatcher": {
"pattern": {
"regexp": "^Error:\\s+(.*)$",
"message": 1
}
}
},
{
"label": "Build Project",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "make.exe",
"args": [
"-C",
"examples\\$env:exampleType\\$env:exampleName",
"BOARD=$env:boardName"
],
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Rebuild Project",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "make.exe",
"args": [
"-C",
"examples\\$env:exampleType\\$env:exampleName",
"BOARD=$env:boardName",
"-B"
],
"problemMatcher": [
"$gcc"
],
"group": "build"
},
{
"label": "Clean Project",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "make.exe",
"args": [
"-C",
"examples\\$env:exampleType\\$env:exampleName",
"BOARD=$env:boardName",
"clean"
],
"problemMatcher": [
"$gcc"
],
"group": "build"
},
{
"label": "Program Project (Flash)",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "C:\\Program Files (x86)\\Bridgetek\\FT9xx Toolchain\\Toolchain\\programmer\\dist\\FT900Prog.exe",
"args": [
"--loadflash",
"examples\\$env:exampleType\\$env:exampleName\\_build\\$env:boardName\\$env:exampleName.bin",
"--onewire",
"--noReset"
],
"problemMatcher": {
"pattern": {
"regexp": "^Error:\\s+(.*)$",
"message": 1
}
},
"dependsOn": "${defaultBuildTask}"
},
{
"label": "Program Project (Memory)",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "C:\\Program Files (x86)\\Bridgetek\\FT9xx Toolchain\\Toolchain\\programmer\\dist\\FT900Prog.exe",
"args": [
"--loadpm",
"examples\\$env:exampleType\\$env:exampleName\\_build\\$env:boardName\\$env:exampleName.bin",
"--onewire",
"--noReset"
],
"problemMatcher": {
"pattern": {
"regexp": "^Error:\\s+(.*)$",
"message": 1
}
},
"dependsOn": "${defaultBuildTask}"
}
],
}

View File

@ -104,10 +104,11 @@ CFLAGS += \
-Wmissing-format-attribute \
-Wunreachable-code \
-Wcast-align \
-Wcast-function-type \
-Wcast-qual \
-Wnull-dereference
# -Wcast-function-type \
# Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -Og

View File

@ -84,7 +84,7 @@ OBJ_DIRS = $(sort $(dir $(OBJ)))
$(OBJ): | $(OBJ_DIRS)
$(OBJ_DIRS):
ifeq ($(CMDEXE),1)
@$(MKDIR) $(subst /,\,$@)
-@$(MKDIR) $(subst /,\,$@)
else
@$(MKDIR) -p $@
endif
@ -207,7 +207,7 @@ debug-bmp: $(BUILD)/$(PROJECT).elf
# Create binary directory
$(BIN):
@$(MKDIR) -p $@
-@$(MKDIR) -p $@
# Copy binaries .elf, .bin, .hex, .uf2 to BIN for upload
# due to large size of combined artifacts, only uf2 is uploaded for now