Merge branch 'master' into fork/pschatzmann/rp2040-iso
This commit is contained in:
@@ -114,13 +114,14 @@ commands:
|
|||||||
name: Build
|
name: Build
|
||||||
command: |
|
command: |
|
||||||
if [ << parameters.toolchain >> == esp-idf ]; then
|
if [ << parameters.toolchain >> == esp-idf ]; then
|
||||||
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py << parameters.family >>
|
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.2 python tools/build.py << parameters.family >>
|
||||||
else
|
else
|
||||||
# Toolchain option default is gcc
|
# Toolchain option default is gcc
|
||||||
if [ << parameters.toolchain >> == arm-clang ]; then
|
if [ << parameters.toolchain >> == arm-clang ]; then
|
||||||
TOOLCHAIN_OPTION="--toolchain clang"
|
TOOLCHAIN_OPTION="--toolchain clang"
|
||||||
elif [ << parameters.toolchain >> == arm-iar ]; then
|
elif [ << parameters.toolchain >> == arm-iar ]; then
|
||||||
TOOLCHAIN_OPTION="--toolchain iar"
|
TOOLCHAIN_OPTION="--toolchain iar"
|
||||||
|
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
|
||||||
iccarm --version
|
iccarm --version
|
||||||
elif [ << parameters.toolchain >> == arm-gcc ]; then
|
elif [ << parameters.toolchain >> == arm-gcc ]; then
|
||||||
TOOLCHAIN_OPTION="--toolchain gcc"
|
TOOLCHAIN_OPTION="--toolchain gcc"
|
||||||
|
|||||||
4
.github/actions/setup_toolchain/action.yml
vendored
4
.github/actions/setup_toolchain/action.yml
vendored
@@ -4,9 +4,6 @@ inputs:
|
|||||||
toolchain:
|
toolchain:
|
||||||
description: 'Toolchain name'
|
description: 'Toolchain name'
|
||||||
required: true
|
required: true
|
||||||
toolchain_version:
|
|
||||||
description: 'Toolchain version'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
build_option:
|
build_option:
|
||||||
@@ -27,7 +24,6 @@ runs:
|
|||||||
uses: ./.github/actions/setup_toolchain/espressif
|
uses: ./.github/actions/setup_toolchain/espressif
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ inputs.toolchain }}
|
toolchain: ${{ inputs.toolchain }}
|
||||||
toolchain_version: ${{ inputs.toolchain_version }}
|
|
||||||
|
|
||||||
- name: Get Toolchain URL
|
- name: Get Toolchain URL
|
||||||
if: >-
|
if: >-
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
toolchain_version:
|
toolchain_version:
|
||||||
description: 'Toolchain version'
|
description: 'Toolchain version'
|
||||||
required: true
|
required: false
|
||||||
|
default: 'v5.3.2'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
@@ -39,3 +40,9 @@ runs:
|
|||||||
du -sh $DOCKER_ESP_IDF
|
du -sh $DOCKER_ESP_IDF
|
||||||
docker load --input $DOCKER_ESP_IDF
|
docker load --input $DOCKER_ESP_IDF
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Tag Local Image
|
||||||
|
run: |
|
||||||
|
docker tag espressif/idf:${{ inputs.toolchain_version }} espressif/idf:tinyusb
|
||||||
|
docker images
|
||||||
|
shell: bash
|
||||||
|
|||||||
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
@@ -111,6 +111,7 @@ jobs:
|
|||||||
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Build IAR on HFP self-hosted
|
# Build IAR on HFP self-hosted
|
||||||
|
# Since IAR Token secret is not passed to forked PR, only build on PR from the same repo
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
arm-iar:
|
arm-iar:
|
||||||
if: github.repository_owner == 'hathach' && github.event_name == 'push'
|
if: github.repository_owner == 'hathach' && github.event_name == 'push'
|
||||||
@@ -118,7 +119,8 @@ jobs:
|
|||||||
runs-on: [self-hosted, Linux, X64, hifiphile]
|
runs-on: [self-hosted, Linux, X64, hifiphile]
|
||||||
env:
|
env:
|
||||||
BUILD_ARGS: ${{ join(fromJSON(needs.set-matrix.outputs.json)['arm-iar'], ' ') }}
|
BUILD_ARGS: ${{ join(fromJSON(needs.set-matrix.outputs.json)['arm-iar'], ' ') }}
|
||||||
# IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
|
IAR_LMS_CLOUD_URL: ${{ vars.IAR_LMS_CLOUD_URL }}
|
||||||
|
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Clean workspace
|
- name: Clean workspace
|
||||||
run: |
|
run: |
|
||||||
@@ -127,7 +129,9 @@ jobs:
|
|||||||
mkdir -p "${{ github.workspace }}"
|
mkdir -p "${{ github.workspace }}"
|
||||||
|
|
||||||
- name: Toolchain version
|
- name: Toolchain version
|
||||||
run: iccarm --version
|
run: |
|
||||||
|
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
|
||||||
|
iccarm --version
|
||||||
|
|
||||||
- name: Checkout TinyUSB
|
- name: Checkout TinyUSB
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -137,3 +141,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: python3 tools/build.py --one-per-family --toolchain iar $BUILD_ARGS
|
run: python3 tools/build.py --one-per-family --toolchain iar $BUILD_ARGS
|
||||||
|
|
||||||
|
# ---------------------------------------
|
||||||
|
# Zephyr
|
||||||
|
# ---------------------------------------
|
||||||
|
zephyr:
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout TinyUSB
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Zephyr project
|
||||||
|
uses: zephyrproject-rtos/action-zephyr-setup@v1
|
||||||
|
with:
|
||||||
|
app-path: examples
|
||||||
|
toolchains: arm-zephyr-eabi
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
west build -b pca10056 -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
|
||||||
|
west build -b pca10056 -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr
|
||||||
|
|||||||
3
.github/workflows/build_util.yml
vendored
3
.github/workflows/build_util.yml
vendored
@@ -41,7 +41,6 @@ jobs:
|
|||||||
uses: ./.github/actions/setup_toolchain
|
uses: ./.github/actions/setup_toolchain
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ inputs.toolchain }}
|
toolchain: ${{ inputs.toolchain }}
|
||||||
toolchain_version: 'v5.3.1'
|
|
||||||
|
|
||||||
- name: Get Dependencies
|
- name: Get Dependencies
|
||||||
uses: ./.github/actions/get_deps
|
uses: ./.github/actions/get_deps
|
||||||
@@ -61,7 +60,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
|
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
|
||||||
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py ${{ matrix.arg }}
|
docker run --rm -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py ${{ matrix.arg }}
|
||||||
else
|
else
|
||||||
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
|
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
|
||||||
fi
|
fi
|
||||||
|
|||||||
12
.github/workflows/hil_test.yml
vendored
12
.github/workflows/hil_test.yml
vendored
@@ -90,12 +90,14 @@ jobs:
|
|||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Hardware in the loop (HIL)
|
# Hardware in the loop (HIL)
|
||||||
# self-hosted by HFP, build with IAR toolchain, for attached hardware checkout test/hil/hfp.json
|
# self-hosted by HFP, build with IAR toolchain, for attached hardware checkout test/hil/hfp.json
|
||||||
|
# Since IAR Token secret is not passed to forked PR, only build on PR from the same repo
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
hil-hfp:
|
hil-hfp:
|
||||||
if: github.repository_owner == 'hathach'
|
if: github.repository_owner == 'hathach' && github.event.pull_request.head.repo.fork == false
|
||||||
runs-on: [self-hosted, Linux, X64, hifiphile]
|
runs-on: [self-hosted, Linux, X64, hifiphile]
|
||||||
#env:
|
env:
|
||||||
# IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
|
IAR_LMS_CLOUD_URL: ${{ vars.IAR_LMS_CLOUD_URL }}
|
||||||
|
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Clean workspace
|
- name: Clean workspace
|
||||||
run: |
|
run: |
|
||||||
@@ -104,7 +106,9 @@ jobs:
|
|||||||
mkdir -p "${{ github.workspace }}"
|
mkdir -p "${{ github.workspace }}"
|
||||||
|
|
||||||
- name: Toolchain version
|
- name: Toolchain version
|
||||||
run: iccarm --version
|
run: |
|
||||||
|
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
|
||||||
|
iccarm --version
|
||||||
|
|
||||||
- name: Checkout TinyUSB
|
- name: Checkout TinyUSB
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -37,4 +37,10 @@ cmake-build-*
|
|||||||
sdkconfig
|
sdkconfig
|
||||||
.PVS-Studio
|
.PVS-Studio
|
||||||
.vscode/
|
.vscode/
|
||||||
build/
|
build
|
||||||
|
CMakeFiles
|
||||||
|
Debug
|
||||||
|
RelWithDebInfo
|
||||||
|
Release
|
||||||
|
BrowseInfo
|
||||||
|
.cmake_build
|
||||||
|
|||||||
4
.idea/cmake.xml
generated
4
.idea/cmake.xml
generated
@@ -12,6 +12,8 @@
|
|||||||
<configuration PROFILE_NAME="feather_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_feather_rp2040 -DLOG=1" />
|
<configuration PROFILE_NAME="feather_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_feather_rp2040 -DLOG=1" />
|
||||||
<configuration PROFILE_NAME="feather_rp2040_max3421" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_rp2040_max3421 -DLOG=1" />
|
<configuration PROFILE_NAME="feather_rp2040_max3421" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_rp2040_max3421 -DLOG=1" />
|
||||||
<configuration PROFILE_NAME="metro_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_metro_rp2040 -DLOG=1 -DMAX3421_HOST=1" />
|
<configuration PROFILE_NAME="metro_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_metro_rp2040 -DLOG=1 -DMAX3421_HOST=1" />
|
||||||
|
<configuration PROFILE_NAME="adafruit_metro_rp2350" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=adafruit_metro_rp2350 -DLOG=1" />
|
||||||
|
<configuration PROFILE_NAME="adafruit_fruit_jam" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=adafruit_fruit_jam -DLOG=1 -DCFLAGS_CLI="-DCFG_TUH_RPI_PIO_USB=1"" />
|
||||||
<configuration PROFILE_NAME="adafruit_feather_esp32_v2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=adafruit_feather_esp32_v2 -DMAX3421_HOST=1 -DLOG=1">
|
<configuration PROFILE_NAME="adafruit_feather_esp32_v2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=adafruit_feather_esp32_v2 -DMAX3421_HOST=1 -DLOG=1">
|
||||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||||
<envs>
|
<envs>
|
||||||
@@ -81,11 +83,13 @@
|
|||||||
<configuration PROFILE_NAME="atsaml21_xpro" ENABLED="false" GENERATION_OPTIONS="-DBOARD=atsaml21_xpro" />
|
<configuration PROFILE_NAME="atsaml21_xpro" ENABLED="false" GENERATION_OPTIONS="-DBOARD=atsaml21_xpro" />
|
||||||
<configuration PROFILE_NAME="feather_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_m4_express -DLOG=1 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
<configuration PROFILE_NAME="feather_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_m4_express -DLOG=1 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||||
<configuration PROFILE_NAME="metro_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m4_express -DLOG=1 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
<configuration PROFILE_NAME="metro_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m4_express -DLOG=1 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||||
|
<configuration PROFILE_NAME="feather_m4_express-zephyr" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_m4_express -DLOG=1 -DMAX3421_HOST=1 -DRTOS=zephyr" />
|
||||||
<configuration PROFILE_NAME="itsybitsy_m4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=itsybitsy_m4" />
|
<configuration PROFILE_NAME="itsybitsy_m4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=itsybitsy_m4" />
|
||||||
<configuration PROFILE_NAME="same54_xplained" ENABLED="false" GENERATION_OPTIONS="-DBOARD=same54_xplained -DLOG=1 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="same54_xplained" ENABLED="false" GENERATION_OPTIONS="-DBOARD=same54_xplained -DLOG=1 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="samg55_xplained" ENABLED="false" GENERATION_OPTIONS="-DBOARD=samg55_xplained" />
|
<configuration PROFILE_NAME="samg55_xplained" ENABLED="false" GENERATION_OPTIONS="-DBOARD=samg55_xplained" />
|
||||||
<configuration PROFILE_NAME="feather_nrf52840_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_nrf52840_express -DLOG=1 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
<configuration PROFILE_NAME="feather_nrf52840_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_nrf52840_express -DLOG=1 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||||
<configuration PROFILE_NAME="pca10056" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10056 -DLOG=1 -DLOGGER=RTT -DTRACE_ETM=1" />
|
<configuration PROFILE_NAME="pca10056" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10056 -DLOG=1 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||||
|
<configuration PROFILE_NAME="pca10056-zephyr" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10056 -DLOG=1 -DTRACE_ETM=1 -DRTOS=zephyr" BUILD_OPTIONS="-v" />
|
||||||
<configuration PROFILE_NAME="pca10095" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10095 -DLOG=1 -DLOGGER=RTT -DTRACE_ETM=1" />
|
<configuration PROFILE_NAME="pca10095" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10095 -DLOG=1 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||||
<configuration PROFILE_NAME="metro m7 1011 sd" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011_sd -DLOG=1 -DLOGGER=RTT -DTRACE_ETM=1" />
|
<configuration PROFILE_NAME="metro m7 1011 sd" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011_sd -DLOG=1 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||||
<configuration PROFILE_NAME="metro_m7_1011" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011 -DLOG=1 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="metro_m7_1011" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011 -DLOG=1 -DLOGGER=RTT" />
|
||||||
|
|||||||
1
.idea/vcs.xml
generated
1
.idea/vcs.xml
generated
@@ -2,5 +2,6 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/hw/mcu/raspberry_pi/Pico-PIO-USB" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
#set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
#set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../hw/bsp/family_support.cmake)
|
||||||
|
|||||||
6
examples/CMakePresets.json
Normal file
6
examples/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
if (RTOS STREQUAL zephyr)
|
||||||
|
return()
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (NOT DEFINED CMAKE_C_COMPILER)
|
if (NOT DEFINED CMAKE_C_COMPILER)
|
||||||
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
|
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ include(CMakePrintHelpers)
|
|||||||
# Common
|
# Common
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
set(CMAKE_SYSTEM_NAME Generic)
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_CPU})
|
||||||
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
|
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
|
||||||
|
|
||||||
# Look for includes and libraries only in the target system prefix.
|
# Look for includes and libraries only in the target system prefix.
|
||||||
@@ -13,8 +14,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
|
||||||
# pass TOOLCHAIN_CPU to
|
# pass TOOLCHAIN_CPU to
|
||||||
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR)
|
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR CMAKE_SYSTEM_CPU)
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_PROCESSOR}.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_CPU}.cmake)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Compile flags
|
# Compile flags
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
# Toolchain
|
# Toolchain
|
||||||
# Can be changed via TOOLCHAIN=gcc|iar or CC=arm-none-eabi-gcc|iccarm|clang
|
# Can be changed via TOOLCHAIN=gcc|iar or CC=arm-none-eabi-gcc|iccarm|clang
|
||||||
#-------------------------------------------------------------
|
#-------------------------------------------------------------
|
||||||
|
|
||||||
ifneq (,$(findstring clang,$(CC)))
|
ifneq (,$(findstring clang,$(CC)))
|
||||||
TOOLCHAIN = clang
|
TOOLCHAIN = clang
|
||||||
else ifneq (,$(findstring iccarm,$(CC)))
|
else ifneq (,$(findstring iccarm,$(CC)))
|
||||||
@@ -65,7 +64,9 @@ BUILD := _build/$(BOARD)
|
|||||||
PROJECT := $(notdir $(CURDIR))
|
PROJECT := $(notdir $(CURDIR))
|
||||||
BIN := $(TOP)/_bin/$(BOARD)/$(notdir $(CURDIR))
|
BIN := $(TOP)/_bin/$(BOARD)/$(notdir $(CURDIR))
|
||||||
|
|
||||||
#-------------- Select the board to build for. ------------
|
#-------------------------------------------------------------
|
||||||
|
# Board / Family
|
||||||
|
#-------------------------------------------------------------
|
||||||
|
|
||||||
# Board without family
|
# Board without family
|
||||||
ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),)
|
ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),)
|
||||||
@@ -93,7 +94,9 @@ else
|
|||||||
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
|
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#-------------- Source files and compiler flags --------------
|
#-------------------------------------------------------------
|
||||||
|
# Source files and compiler flags
|
||||||
|
#-------------------------------------------------------------
|
||||||
# tinyusb makefile
|
# tinyusb makefile
|
||||||
include $(TOP)/src/tinyusb.mk
|
include $(TOP)/src/tinyusb.mk
|
||||||
SRC_C += $(TINYUSB_SRC_C)
|
SRC_C += $(TINYUSB_SRC_C)
|
||||||
@@ -148,7 +151,37 @@ endif
|
|||||||
# toolchain specific
|
# toolchain specific
|
||||||
include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk
|
include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk
|
||||||
|
|
||||||
# Handy check parameter function
|
#---------------------- FreeRTOS -----------------------
|
||||||
|
FREERTOS_SRC = lib/FreeRTOS-Kernel
|
||||||
|
FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
|
||||||
|
|
||||||
|
ifeq ($(RTOS),freertos)
|
||||||
|
SRC_C += \
|
||||||
|
$(FREERTOS_SRC)/list.c \
|
||||||
|
$(FREERTOS_SRC)/queue.c \
|
||||||
|
$(FREERTOS_SRC)/tasks.c \
|
||||||
|
$(FREERTOS_SRC)/timers.c \
|
||||||
|
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c))
|
||||||
|
|
||||||
|
SRC_S += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
|
||||||
|
INC += \
|
||||||
|
$(TOP)/hw/bsp/$(FAMILY)/FreeRTOSConfig \
|
||||||
|
$(TOP)/$(FREERTOS_SRC)/include \
|
||||||
|
$(TOP)/$(FREERTOS_PORTABLE_SRC)
|
||||||
|
|
||||||
|
CFLAGS += -DCFG_TUSB_OS=OPT_OS_FREERTOS
|
||||||
|
|
||||||
|
# Suppress FreeRTOSConfig.h warnings
|
||||||
|
CFLAGS_GCC += -Wno-error=redundant-decls
|
||||||
|
|
||||||
|
# Suppress FreeRTOS source warnings
|
||||||
|
CFLAGS_GCC += -Wno-error=cast-qual
|
||||||
|
|
||||||
|
# FreeRTOS (lto + Os) linker issue
|
||||||
|
LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
|
||||||
|
endif
|
||||||
|
|
||||||
|
#---------------- Helper ----------------
|
||||||
check_defined = \
|
check_defined = \
|
||||||
$(strip $(foreach 1,$1, \
|
$(strip $(foreach 1,$1, \
|
||||||
$(call __check_defined,$1,$(strip $(value 2)))))
|
$(call __check_defined,$1,$(strip $(value 2)))))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/CMakePresets.json
Normal file
6
examples/device/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/audio_4_channel_mic/CMakePresets.json
Normal file
6
examples/device/audio_4_channel_mic/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
|
RTOS = freertos
|
||||||
include ../../build_system/make/make.mk
|
include ../../build_system/make/make.mk
|
||||||
|
|
||||||
FREERTOS_SRC = lib/FreeRTOS-Kernel
|
|
||||||
FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
|
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
src \
|
src \
|
||||||
src/FreeRTOSConfig \
|
|
||||||
$(TOP)/hw \
|
$(TOP)/hw \
|
||||||
$(TOP)/$(FREERTOS_SRC)/include \
|
|
||||||
$(TOP)/$(FREERTOS_PORTABLE_SRC) \
|
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
EXAMPLE_SOURCE = \
|
EXAMPLE_SOURCE = \
|
||||||
@@ -17,21 +12,4 @@ EXAMPLE_SOURCE = \
|
|||||||
|
|
||||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||||
|
|
||||||
# FreeRTOS source, all files in port folder
|
|
||||||
SRC_C += \
|
|
||||||
$(FREERTOS_SRC)/list.c \
|
|
||||||
$(FREERTOS_SRC)/queue.c \
|
|
||||||
$(FREERTOS_SRC)/tasks.c \
|
|
||||||
$(FREERTOS_SRC)/timers.c \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c))
|
|
||||||
|
|
||||||
SRC_S += \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
|
|
||||||
|
|
||||||
# Suppress FreeRTOS warnings
|
|
||||||
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
|
|
||||||
|
|
||||||
# FreeRTOS (lto + Os) linker issue
|
|
||||||
LDFLAGS += -Wl,--undefined=vTaskSwitchContext
|
|
||||||
|
|
||||||
include ../../build_system/make/rules.mk
|
include ../../build_system/make/rules.mk
|
||||||
|
|||||||
@@ -1,191 +0,0 @@
|
|||||||
/*
|
|
||||||
* FreeRTOS Kernel V10.0.0
|
|
||||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software. If you wish to use our Amazon
|
|
||||||
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* http://www.FreeRTOS.org
|
|
||||||
* http://aws.amazon.com/freertos
|
|
||||||
*
|
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FREERTOS_CONFIG_H
|
|
||||||
#define FREERTOS_CONFIG_H
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
|
||||||
* Application specific definitions.
|
|
||||||
*
|
|
||||||
* These definitions should be adjusted for your particular hardware and
|
|
||||||
* application requirements.
|
|
||||||
*
|
|
||||||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
|
|
||||||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
|
|
||||||
*
|
|
||||||
* See http://www.freertos.org/a00110.html.
|
|
||||||
*----------------------------------------------------------*/
|
|
||||||
|
|
||||||
// skip if included from IAR assembler
|
|
||||||
#ifndef __IASMARM__
|
|
||||||
|
|
||||||
// Include MCU header
|
|
||||||
#include "bsp/board_mcu.h"
|
|
||||||
|
|
||||||
#if TUSB_MCU_VENDOR_ESPRESSIF
|
|
||||||
#error "ESP32-Sx should use IDF's FreeRTOSConfig.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO fix later
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_MM32F327X
|
|
||||||
extern u32 SystemCoreClock;
|
|
||||||
#else
|
|
||||||
// FIXME cause redundant-decls warnings
|
|
||||||
extern uint32_t SystemCoreClock;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Cortex M23/M33 port configuration. */
|
|
||||||
#define configENABLE_MPU 0
|
|
||||||
#define configENABLE_FPU 1
|
|
||||||
#define configENABLE_TRUSTZONE 0
|
|
||||||
#define configMINIMAL_SECURE_STACK_SIZE ( 1024 )
|
|
||||||
#define configRUN_FREERTOS_SECURE_ONLY 1
|
|
||||||
|
|
||||||
#define configUSE_PREEMPTION 1
|
|
||||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
|
||||||
#define configCPU_CLOCK_HZ SystemCoreClock
|
|
||||||
#define configTICK_RATE_HZ ( 1000 )
|
|
||||||
#define configMAX_PRIORITIES ( 5 )
|
|
||||||
#define configMINIMAL_STACK_SIZE ( 128 )
|
|
||||||
#define configTOTAL_HEAP_SIZE ( configSUPPORT_DYNAMIC_ALLOCATION*4*1024 )
|
|
||||||
#define configMAX_TASK_NAME_LEN 16
|
|
||||||
#define configUSE_16_BIT_TICKS 0
|
|
||||||
#define configIDLE_SHOULD_YIELD 1
|
|
||||||
#define configUSE_MUTEXES 1
|
|
||||||
#define configUSE_RECURSIVE_MUTEXES 1
|
|
||||||
#define configUSE_COUNTING_SEMAPHORES 1
|
|
||||||
#define configQUEUE_REGISTRY_SIZE 4
|
|
||||||
#define configUSE_QUEUE_SETS 0
|
|
||||||
#define configUSE_TIME_SLICING 0
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 0
|
|
||||||
#define configENABLE_BACKWARD_COMPATIBILITY 1
|
|
||||||
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
|
||||||
|
|
||||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
|
||||||
#define configSUPPORT_DYNAMIC_ALLOCATION 0
|
|
||||||
|
|
||||||
/* Hook function related definitions. */
|
|
||||||
#define configUSE_IDLE_HOOK 0
|
|
||||||
#define configUSE_TICK_HOOK 0
|
|
||||||
#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
|
|
||||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
|
||||||
#define configCHECK_HANDLER_INSTALLATION 0
|
|
||||||
|
|
||||||
/* Run time and task stats gathering related definitions. */
|
|
||||||
#define configGENERATE_RUN_TIME_STATS 0
|
|
||||||
#define configUSE_TRACE_FACILITY 1 // legacy trace
|
|
||||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
|
|
||||||
|
|
||||||
/* Co-routine definitions. */
|
|
||||||
#define configUSE_CO_ROUTINES 0
|
|
||||||
#define configMAX_CO_ROUTINE_PRIORITIES 2
|
|
||||||
|
|
||||||
/* Software timer related definitions. */
|
|
||||||
#define configUSE_TIMERS 1
|
|
||||||
#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
|
|
||||||
#define configTIMER_QUEUE_LENGTH 32
|
|
||||||
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
|
|
||||||
|
|
||||||
/* Optional functions - most linkers will remove unused functions anyway. */
|
|
||||||
#define INCLUDE_vTaskPrioritySet 0
|
|
||||||
#define INCLUDE_uxTaskPriorityGet 0
|
|
||||||
#define INCLUDE_vTaskDelete 0
|
|
||||||
#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
|
|
||||||
#define INCLUDE_xResumeFromISR 0
|
|
||||||
#define INCLUDE_vTaskDelayUntil 1
|
|
||||||
#define INCLUDE_vTaskDelay 1
|
|
||||||
#define INCLUDE_xTaskGetSchedulerState 0
|
|
||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 0
|
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark 0
|
|
||||||
#define INCLUDE_xTaskGetIdleTaskHandle 0
|
|
||||||
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
|
|
||||||
#define INCLUDE_pcTaskGetTaskName 0
|
|
||||||
#define INCLUDE_eTaskGetState 0
|
|
||||||
#define INCLUDE_xEventGroupSetBitFromISR 0
|
|
||||||
#define INCLUDE_xTimerPendFunctionCall 0
|
|
||||||
|
|
||||||
#ifdef __RX__
|
|
||||||
/* Renesas RX series */
|
|
||||||
#define vSoftwareInterruptISR INT_Excep_ICU_SWINT
|
|
||||||
#define vTickISR INT_Excep_CMT0_CMI0
|
|
||||||
#define configPERIPHERAL_CLOCK_HZ (configCPU_CLOCK_HZ/2)
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY 1
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* FreeRTOS hooks to NVIC vectors */
|
|
||||||
#define xPortPendSVHandler PendSV_Handler
|
|
||||||
#define xPortSysTickHandler SysTick_Handler
|
|
||||||
#define vPortSVCHandler SVC_Handler
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
// Interrupt nesting behavior configuration.
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
#if defined(__NVIC_PRIO_BITS)
|
|
||||||
// For Cortex-M specific: __NVIC_PRIO_BITS is defined in core_cmx.h
|
|
||||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
|
||||||
|
|
||||||
#elif defined(__ECLIC_INTCTLBITS)
|
|
||||||
// RISC-V Bumblebee core from nuclei
|
|
||||||
#define configPRIO_BITS __ECLIC_INTCTLBITS
|
|
||||||
|
|
||||||
#elif defined(__IASMARM__)
|
|
||||||
// FIXME: IAR Assembler cannot include mcu header directly to get __NVIC_PRIO_BITS.
|
|
||||||
// Therefore we will hard coded it to minimum value of 2 to get pass ci build.
|
|
||||||
// IAR user must update this to correct value of the target MCU
|
|
||||||
#message "configPRIO_BITS is hard coded to 2 to pass IAR build only. User should update it per MCU"
|
|
||||||
#define configPRIO_BITS 2
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error "FreeRTOS configPRIO_BITS to be defined"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
|
|
||||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
|
|
||||||
|
|
||||||
/* The highest interrupt priority that can be used by any interrupt service
|
|
||||||
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
|
||||||
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
|
||||||
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
|
||||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
|
|
||||||
|
|
||||||
/* Interrupt priorities used by the kernel port layer itself. These are generic
|
|
||||||
to all Cortex-M ports, and do not rely on any particular library functions. */
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
|
||||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __FREERTOS_CONFIG__H */
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/audio_test/CMakePresets.json
Normal file
6
examples/device/audio_test/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/audio_test_freertos/CMakePresets.json
Normal file
6
examples/device/audio_test_freertos/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
|
RTOS = freertos
|
||||||
include ../../build_system/make/make.mk
|
include ../../build_system/make/make.mk
|
||||||
|
|
||||||
FREERTOS_SRC = lib/FreeRTOS-Kernel
|
|
||||||
FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
|
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
src \
|
src \
|
||||||
src/FreeRTOSConfig \
|
|
||||||
$(TOP)/hw \
|
$(TOP)/hw \
|
||||||
$(TOP)/$(FREERTOS_SRC)/include \
|
|
||||||
$(TOP)/$(FREERTOS_PORTABLE_SRC) \
|
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
EXAMPLE_SOURCE = \
|
EXAMPLE_SOURCE = \
|
||||||
@@ -17,21 +12,4 @@ EXAMPLE_SOURCE = \
|
|||||||
|
|
||||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||||
|
|
||||||
# FreeRTOS source, all files in port folder
|
|
||||||
SRC_C += \
|
|
||||||
$(FREERTOS_SRC)/list.c \
|
|
||||||
$(FREERTOS_SRC)/queue.c \
|
|
||||||
$(FREERTOS_SRC)/tasks.c \
|
|
||||||
$(FREERTOS_SRC)/timers.c \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c))
|
|
||||||
|
|
||||||
SRC_S += \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
|
|
||||||
|
|
||||||
# Suppress FreeRTOS warnings
|
|
||||||
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
|
|
||||||
|
|
||||||
# FreeRTOS (lto + Os) linker issue
|
|
||||||
LDFLAGS += -Wl,--undefined=vTaskSwitchContext
|
|
||||||
|
|
||||||
include ../../build_system/make/rules.mk
|
include ../../build_system/make/rules.mk
|
||||||
|
|||||||
@@ -1,191 +0,0 @@
|
|||||||
/*
|
|
||||||
* FreeRTOS Kernel V10.0.0
|
|
||||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software. If you wish to use our Amazon
|
|
||||||
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* http://www.FreeRTOS.org
|
|
||||||
* http://aws.amazon.com/freertos
|
|
||||||
*
|
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FREERTOS_CONFIG_H
|
|
||||||
#define FREERTOS_CONFIG_H
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
|
||||||
* Application specific definitions.
|
|
||||||
*
|
|
||||||
* These definitions should be adjusted for your particular hardware and
|
|
||||||
* application requirements.
|
|
||||||
*
|
|
||||||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
|
|
||||||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
|
|
||||||
*
|
|
||||||
* See http://www.freertos.org/a00110.html.
|
|
||||||
*----------------------------------------------------------*/
|
|
||||||
|
|
||||||
// skip if included from IAR assembler
|
|
||||||
#ifndef __IASMARM__
|
|
||||||
|
|
||||||
// Include MCU header
|
|
||||||
#include "bsp/board_mcu.h"
|
|
||||||
|
|
||||||
#if TUSB_MCU_VENDOR_ESPRESSIF
|
|
||||||
#error "ESP32-Sx should use IDF's FreeRTOSConfig.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO fix later
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_MM32F327X
|
|
||||||
extern u32 SystemCoreClock;
|
|
||||||
#else
|
|
||||||
// FIXME cause redundant-decls warnings
|
|
||||||
extern uint32_t SystemCoreClock;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Cortex M23/M33 port configuration. */
|
|
||||||
#define configENABLE_MPU 0
|
|
||||||
#define configENABLE_FPU 1
|
|
||||||
#define configENABLE_TRUSTZONE 0
|
|
||||||
#define configMINIMAL_SECURE_STACK_SIZE ( 1024 )
|
|
||||||
#define configRUN_FREERTOS_SECURE_ONLY 1
|
|
||||||
|
|
||||||
#define configUSE_PREEMPTION 1
|
|
||||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
|
||||||
#define configCPU_CLOCK_HZ SystemCoreClock
|
|
||||||
#define configTICK_RATE_HZ ( 1000 )
|
|
||||||
#define configMAX_PRIORITIES ( 5 )
|
|
||||||
#define configMINIMAL_STACK_SIZE ( 128 )
|
|
||||||
#define configTOTAL_HEAP_SIZE ( configSUPPORT_DYNAMIC_ALLOCATION*4*1024 )
|
|
||||||
#define configMAX_TASK_NAME_LEN 16
|
|
||||||
#define configUSE_16_BIT_TICKS 0
|
|
||||||
#define configIDLE_SHOULD_YIELD 1
|
|
||||||
#define configUSE_MUTEXES 1
|
|
||||||
#define configUSE_RECURSIVE_MUTEXES 1
|
|
||||||
#define configUSE_COUNTING_SEMAPHORES 1
|
|
||||||
#define configQUEUE_REGISTRY_SIZE 4
|
|
||||||
#define configUSE_QUEUE_SETS 0
|
|
||||||
#define configUSE_TIME_SLICING 0
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 0
|
|
||||||
#define configENABLE_BACKWARD_COMPATIBILITY 1
|
|
||||||
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
|
||||||
|
|
||||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
|
||||||
#define configSUPPORT_DYNAMIC_ALLOCATION 0
|
|
||||||
|
|
||||||
/* Hook function related definitions. */
|
|
||||||
#define configUSE_IDLE_HOOK 0
|
|
||||||
#define configUSE_TICK_HOOK 0
|
|
||||||
#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
|
|
||||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
|
||||||
#define configCHECK_HANDLER_INSTALLATION 0
|
|
||||||
|
|
||||||
/* Run time and task stats gathering related definitions. */
|
|
||||||
#define configGENERATE_RUN_TIME_STATS 0
|
|
||||||
#define configUSE_TRACE_FACILITY 1 // legacy trace
|
|
||||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
|
|
||||||
|
|
||||||
/* Co-routine definitions. */
|
|
||||||
#define configUSE_CO_ROUTINES 0
|
|
||||||
#define configMAX_CO_ROUTINE_PRIORITIES 2
|
|
||||||
|
|
||||||
/* Software timer related definitions. */
|
|
||||||
#define configUSE_TIMERS 1
|
|
||||||
#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
|
|
||||||
#define configTIMER_QUEUE_LENGTH 32
|
|
||||||
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
|
|
||||||
|
|
||||||
/* Optional functions - most linkers will remove unused functions anyway. */
|
|
||||||
#define INCLUDE_vTaskPrioritySet 0
|
|
||||||
#define INCLUDE_uxTaskPriorityGet 0
|
|
||||||
#define INCLUDE_vTaskDelete 0
|
|
||||||
#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
|
|
||||||
#define INCLUDE_xResumeFromISR 0
|
|
||||||
#define INCLUDE_vTaskDelayUntil 1
|
|
||||||
#define INCLUDE_vTaskDelay 1
|
|
||||||
#define INCLUDE_xTaskGetSchedulerState 0
|
|
||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 0
|
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark 0
|
|
||||||
#define INCLUDE_xTaskGetIdleTaskHandle 0
|
|
||||||
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
|
|
||||||
#define INCLUDE_pcTaskGetTaskName 0
|
|
||||||
#define INCLUDE_eTaskGetState 0
|
|
||||||
#define INCLUDE_xEventGroupSetBitFromISR 0
|
|
||||||
#define INCLUDE_xTimerPendFunctionCall 0
|
|
||||||
|
|
||||||
#ifdef __RX__
|
|
||||||
/* Renesas RX series */
|
|
||||||
#define vSoftwareInterruptISR INT_Excep_ICU_SWINT
|
|
||||||
#define vTickISR INT_Excep_CMT0_CMI0
|
|
||||||
#define configPERIPHERAL_CLOCK_HZ (configCPU_CLOCK_HZ/2)
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY 1
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* FreeRTOS hooks to NVIC vectors */
|
|
||||||
#define xPortPendSVHandler PendSV_Handler
|
|
||||||
#define xPortSysTickHandler SysTick_Handler
|
|
||||||
#define vPortSVCHandler SVC_Handler
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
// Interrupt nesting behavior configuration.
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
#if defined(__NVIC_PRIO_BITS)
|
|
||||||
// For Cortex-M specific: __NVIC_PRIO_BITS is defined in core_cmx.h
|
|
||||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
|
||||||
|
|
||||||
#elif defined(__ECLIC_INTCTLBITS)
|
|
||||||
// RISC-V Bumblebee core from nuclei
|
|
||||||
#define configPRIO_BITS __ECLIC_INTCTLBITS
|
|
||||||
|
|
||||||
#elif defined(__IASMARM__)
|
|
||||||
// FIXME: IAR Assembler cannot include mcu header directly to get __NVIC_PRIO_BITS.
|
|
||||||
// Therefore we will hard coded it to minimum value of 2 to get pass ci build.
|
|
||||||
// IAR user must update this to correct value of the target MCU
|
|
||||||
#message "configPRIO_BITS is hard coded to 2 to pass IAR build only. User should update it per MCU"
|
|
||||||
#define configPRIO_BITS 2
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error "FreeRTOS configPRIO_BITS to be defined"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
|
|
||||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
|
|
||||||
|
|
||||||
/* The highest interrupt priority that can be used by any interrupt service
|
|
||||||
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
|
||||||
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
|
||||||
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
|
||||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
|
|
||||||
|
|
||||||
/* Interrupt priorities used by the kernel port layer itself. These are generic
|
|
||||||
to all Cortex-M ports, and do not rely on any particular library functions. */
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
|
||||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __FREERTOS_CONFIG__H */
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/audio_test_multi_rate/CMakePresets.json
Normal file
6
examples/device/audio_test_multi_rate/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
@@ -15,18 +15,23 @@ if(FAMILY STREQUAL "espressif")
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${PROJECT})
|
if (RTOS STREQUAL zephyr)
|
||||||
|
set(EXE_NAME app)
|
||||||
|
else()
|
||||||
|
set(EXE_NAME ${PROJECT})
|
||||||
|
add_executable(${EXE_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
target_sources(${PROJECT} PUBLIC
|
target_sources(${EXE_NAME} PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Example include
|
# Example include
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_include_directories(${EXE_NAME} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
# Configure compilation flags and libraries for the example without RTOS.
|
# Configure compilation flags and libraries for the example without RTOS.
|
||||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||||
family_configure_device_example(${PROJECT} noos)
|
family_configure_device_example(${EXE_NAME} ${RTOS})
|
||||||
|
|||||||
6
examples/device/board_test/CMakePresets.json
Normal file
6
examples/device/board_test/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/cdc_dual_ports/CMakePresets.json
Normal file
6
examples/device/cdc_dual_ports/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
#set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
#set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
@@ -16,20 +16,25 @@ if(FAMILY STREQUAL "espressif")
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${PROJECT})
|
if (RTOS STREQUAL zephyr)
|
||||||
|
set(EXE_NAME app)
|
||||||
|
else()
|
||||||
|
set(EXE_NAME ${PROJECT})
|
||||||
|
add_executable(${EXE_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
target_sources(${PROJECT} PUBLIC
|
target_sources(${EXE_NAME} PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Example include
|
# Example include
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_include_directories(${EXE_NAME} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
# Configure compilation flags and libraries for the example... see the corresponding function
|
# Configure compilation flags and libraries for the example without RTOS.
|
||||||
# in hw/bsp/FAMILY/family.cmake for details.
|
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||||
family_configure_device_example(${PROJECT} noos)
|
family_configure_device_example(${EXE_NAME} ${RTOS})
|
||||||
|
|||||||
6
examples/device/cdc_msc/CMakePresets.json
Normal file
6
examples/device/cdc_msc/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
6
examples/device/cdc_msc/prj.conf
Normal file
6
examples/device/cdc_msc/prj.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
CONFIG_GPIO=y
|
||||||
|
CONFIG_FPU=y
|
||||||
|
CONFIG_NO_OPTIMIZATIONS=y
|
||||||
|
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||||
|
CONFIG_NRFX_POWER=y
|
||||||
|
CONFIG_NRFX_UARTE0=y
|
||||||
@@ -190,7 +190,14 @@ int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buff
|
|||||||
(void) lun;
|
(void) lun;
|
||||||
|
|
||||||
// out of ramdisk
|
// out of ramdisk
|
||||||
if ( lba >= DISK_BLOCK_NUM ) return -1;
|
if ( lba >= DISK_BLOCK_NUM ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for overflow of offset + bufsize
|
||||||
|
if ( offset + bufsize > DISK_BLOCK_SIZE ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t const* addr = msc_disk[lba] + offset;
|
uint8_t const* addr = msc_disk[lba] + offset;
|
||||||
memcpy(buffer, addr, bufsize);
|
memcpy(buffer, addr, bufsize);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/cdc_msc_freertos/CMakePresets.json
Normal file
6
examples/device/cdc_msc_freertos/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
|
RTOS = freertos
|
||||||
include ../../build_system/make/make.mk
|
include ../../build_system/make/make.mk
|
||||||
|
|
||||||
FREERTOS_SRC = lib/FreeRTOS-Kernel
|
|
||||||
FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
|
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
src \
|
src \
|
||||||
src/FreeRTOSConfig \
|
|
||||||
$(TOP)/hw \
|
$(TOP)/hw \
|
||||||
$(TOP)/$(FREERTOS_SRC)/include \
|
|
||||||
$(TOP)/$(FREERTOS_PORTABLE_SRC) \
|
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
EXAMPLE_SOURCE = \
|
EXAMPLE_SOURCE = \
|
||||||
@@ -18,28 +13,4 @@ EXAMPLE_SOURCE = \
|
|||||||
|
|
||||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||||
|
|
||||||
# FreeRTOS source, all files in port folder
|
|
||||||
SRC_C += \
|
|
||||||
$(FREERTOS_SRC)/list.c \
|
|
||||||
$(FREERTOS_SRC)/queue.c \
|
|
||||||
$(FREERTOS_SRC)/tasks.c \
|
|
||||||
$(FREERTOS_SRC)/timers.c \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c))
|
|
||||||
|
|
||||||
SRC_S += \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
|
|
||||||
|
|
||||||
# include heap manage if configSUPPORT_DYNAMIC_ALLOCATION = 1
|
|
||||||
# SRC_C += $(FREERTOS_SRC)/portable/MemMang/heap_1.c
|
|
||||||
# CFLAGS += -Wno-error=sign-compare
|
|
||||||
|
|
||||||
# Suppress FreeRTOSConfig.h warnings
|
|
||||||
CFLAGS_GCC += -Wno-error=redundant-decls
|
|
||||||
|
|
||||||
# Suppress FreeRTOS source warnings
|
|
||||||
CFLAGS_GCC += -Wno-error=cast-qual
|
|
||||||
|
|
||||||
# FreeRTOS (lto + Os) linker issue
|
|
||||||
LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
|
|
||||||
|
|
||||||
include ../../build_system/make/rules.mk
|
include ../../build_system/make/rules.mk
|
||||||
|
|||||||
@@ -1,191 +0,0 @@
|
|||||||
/*
|
|
||||||
* FreeRTOS Kernel V10.0.0
|
|
||||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software. If you wish to use our Amazon
|
|
||||||
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* http://www.FreeRTOS.org
|
|
||||||
* http://aws.amazon.com/freertos
|
|
||||||
*
|
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FREERTOS_CONFIG_H
|
|
||||||
#define FREERTOS_CONFIG_H
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
|
||||||
* Application specific definitions.
|
|
||||||
*
|
|
||||||
* These definitions should be adjusted for your particular hardware and
|
|
||||||
* application requirements.
|
|
||||||
*
|
|
||||||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
|
|
||||||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
|
|
||||||
*
|
|
||||||
* See http://www.freertos.org/a00110.html.
|
|
||||||
*----------------------------------------------------------*/
|
|
||||||
|
|
||||||
// skip if included from IAR assembler
|
|
||||||
#ifndef __IASMARM__
|
|
||||||
|
|
||||||
// Include MCU header
|
|
||||||
#include "bsp/board_mcu.h"
|
|
||||||
|
|
||||||
#if TUSB_MCU_VENDOR_ESPRESSIF
|
|
||||||
#error "ESP32-Sx should use IDF's FreeRTOSConfig.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO fix later
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_MM32F327X
|
|
||||||
extern u32 SystemCoreClock;
|
|
||||||
#else
|
|
||||||
// FIXME cause redundant-decls warnings
|
|
||||||
extern uint32_t SystemCoreClock;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Cortex M23/M33 port configuration. */
|
|
||||||
#define configENABLE_MPU 0
|
|
||||||
#define configENABLE_FPU 1
|
|
||||||
#define configENABLE_TRUSTZONE 0
|
|
||||||
#define configMINIMAL_SECURE_STACK_SIZE ( 1024 )
|
|
||||||
#define configRUN_FREERTOS_SECURE_ONLY 1
|
|
||||||
|
|
||||||
#define configUSE_PREEMPTION 1
|
|
||||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
|
||||||
#define configCPU_CLOCK_HZ SystemCoreClock
|
|
||||||
#define configTICK_RATE_HZ ( 1000 )
|
|
||||||
#define configMAX_PRIORITIES ( 5 )
|
|
||||||
#define configMINIMAL_STACK_SIZE ( 128 )
|
|
||||||
#define configTOTAL_HEAP_SIZE ( configSUPPORT_DYNAMIC_ALLOCATION*4*1024 )
|
|
||||||
#define configMAX_TASK_NAME_LEN 16
|
|
||||||
#define configUSE_16_BIT_TICKS 0
|
|
||||||
#define configIDLE_SHOULD_YIELD 1
|
|
||||||
#define configUSE_MUTEXES 1
|
|
||||||
#define configUSE_RECURSIVE_MUTEXES 1
|
|
||||||
#define configUSE_COUNTING_SEMAPHORES 1
|
|
||||||
#define configQUEUE_REGISTRY_SIZE 4
|
|
||||||
#define configUSE_QUEUE_SETS 0
|
|
||||||
#define configUSE_TIME_SLICING 0
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 0
|
|
||||||
#define configENABLE_BACKWARD_COMPATIBILITY 1
|
|
||||||
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
|
||||||
|
|
||||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
|
||||||
#define configSUPPORT_DYNAMIC_ALLOCATION 0
|
|
||||||
|
|
||||||
/* Hook function related definitions. */
|
|
||||||
#define configUSE_IDLE_HOOK 0
|
|
||||||
#define configUSE_TICK_HOOK 0
|
|
||||||
#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
|
|
||||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
|
||||||
#define configCHECK_HANDLER_INSTALLATION 0
|
|
||||||
|
|
||||||
/* Run time and task stats gathering related definitions. */
|
|
||||||
#define configGENERATE_RUN_TIME_STATS 0
|
|
||||||
#define configUSE_TRACE_FACILITY 1 // legacy trace
|
|
||||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
|
|
||||||
|
|
||||||
/* Co-routine definitions. */
|
|
||||||
#define configUSE_CO_ROUTINES 0
|
|
||||||
#define configMAX_CO_ROUTINE_PRIORITIES 2
|
|
||||||
|
|
||||||
/* Software timer related definitions. */
|
|
||||||
#define configUSE_TIMERS 1
|
|
||||||
#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
|
|
||||||
#define configTIMER_QUEUE_LENGTH 32
|
|
||||||
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
|
|
||||||
|
|
||||||
/* Optional functions - most linkers will remove unused functions anyway. */
|
|
||||||
#define INCLUDE_vTaskPrioritySet 0
|
|
||||||
#define INCLUDE_uxTaskPriorityGet 0
|
|
||||||
#define INCLUDE_vTaskDelete 0
|
|
||||||
#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
|
|
||||||
#define INCLUDE_xResumeFromISR 0
|
|
||||||
#define INCLUDE_vTaskDelayUntil 1
|
|
||||||
#define INCLUDE_vTaskDelay 1
|
|
||||||
#define INCLUDE_xTaskGetSchedulerState 0
|
|
||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 0
|
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark 0
|
|
||||||
#define INCLUDE_xTaskGetIdleTaskHandle 0
|
|
||||||
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
|
|
||||||
#define INCLUDE_pcTaskGetTaskName 0
|
|
||||||
#define INCLUDE_eTaskGetState 0
|
|
||||||
#define INCLUDE_xEventGroupSetBitFromISR 0
|
|
||||||
#define INCLUDE_xTimerPendFunctionCall 0
|
|
||||||
|
|
||||||
#ifdef __RX__
|
|
||||||
/* Renesas RX series */
|
|
||||||
#define vSoftwareInterruptISR INT_Excep_ICU_SWINT
|
|
||||||
#define vTickISR INT_Excep_CMT0_CMI0
|
|
||||||
#define configPERIPHERAL_CLOCK_HZ (configCPU_CLOCK_HZ/2)
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY 1
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* FreeRTOS hooks to NVIC vectors */
|
|
||||||
#define xPortPendSVHandler PendSV_Handler
|
|
||||||
#define xPortSysTickHandler SysTick_Handler
|
|
||||||
#define vPortSVCHandler SVC_Handler
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
// Interrupt nesting behavior configuration.
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
#if defined(__NVIC_PRIO_BITS)
|
|
||||||
// For Cortex-M specific: __NVIC_PRIO_BITS is defined in core_cmx.h
|
|
||||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
|
||||||
|
|
||||||
#elif defined(__ECLIC_INTCTLBITS)
|
|
||||||
// RISC-V Bumblebee core from nuclei
|
|
||||||
#define configPRIO_BITS __ECLIC_INTCTLBITS
|
|
||||||
|
|
||||||
#elif defined(__IASMARM__)
|
|
||||||
// FIXME: IAR Assembler cannot include mcu header directly to get __NVIC_PRIO_BITS.
|
|
||||||
// Therefore we will hard coded it to minimum value of 2 to get pass ci build.
|
|
||||||
// IAR user must update this to correct value of the target MCU
|
|
||||||
#message "configPRIO_BITS is hard coded to 2 to pass IAR build only. User should update it per MCU"
|
|
||||||
#define configPRIO_BITS 2
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error "FreeRTOS configPRIO_BITS to be defined"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
|
|
||||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
|
|
||||||
|
|
||||||
/* The highest interrupt priority that can be used by any interrupt service
|
|
||||||
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
|
||||||
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
|
||||||
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
|
||||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
|
|
||||||
|
|
||||||
/* Interrupt priorities used by the kernel port layer itself. These are generic
|
|
||||||
to all Cortex-M ports, and do not rely on any particular library functions. */
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
|
||||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __FREERTOS_CONFIG__H */
|
|
||||||
@@ -190,7 +190,14 @@ int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buff
|
|||||||
(void) lun;
|
(void) lun;
|
||||||
|
|
||||||
// out of ramdisk
|
// out of ramdisk
|
||||||
if ( lba >= DISK_BLOCK_NUM ) return -1;
|
if ( lba >= DISK_BLOCK_NUM ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for overflow of offset + bufsize
|
||||||
|
if ( offset + bufsize > DISK_BLOCK_SIZE ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t const* addr = msc_disk[lba] + offset;
|
uint8_t const* addr = msc_disk[lba] + offset;
|
||||||
memcpy(buffer, addr, bufsize);
|
memcpy(buffer, addr, bufsize);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/cdc_uac2/CMakePresets.json
Normal file
6
examples/device/cdc_uac2/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/dfu/CMakePresets.json
Normal file
6
examples/device/dfu/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/dfu_runtime/CMakePresets.json
Normal file
6
examples/device/dfu_runtime/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/dynamic_configuration/CMakePresets.json
Normal file
6
examples/device/dynamic_configuration/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/hid_boot_interface/CMakePresets.json
Normal file
6
examples/device/hid_boot_interface/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/hid_composite/CMakePresets.json
Normal file
6
examples/device/hid_composite/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -197,11 +197,43 @@ static void send_hid_report(uint8_t report_id, uint32_t btn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* use this to send stylus touch signal through USB. */
|
||||||
|
static void send_stylus_touch(uint16_t x, uint16_t y, bool state)
|
||||||
|
{
|
||||||
|
// skip if hid is not ready yet
|
||||||
|
if ( !tud_hid_ready() ) return;
|
||||||
|
|
||||||
|
static bool has_stylus_pen = false;
|
||||||
|
|
||||||
|
hid_stylus_report_t report =
|
||||||
|
{
|
||||||
|
.attr = 0,
|
||||||
|
.x = 0,
|
||||||
|
.y = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
report.x = x;
|
||||||
|
report.y = y;
|
||||||
|
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
report.attr = STYLUS_ATTR_TIP_SWITCH | STYLUS_ATTR_IN_RANGE;
|
||||||
|
tud_hid_report(REPORT_ID_STYLUS_PEN, &report, sizeof(report));
|
||||||
|
|
||||||
|
has_stylus_pen = true;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
report.attr = 0;
|
||||||
|
if (has_stylus_pen) tud_hid_report(REPORT_ID_STYLUS_PEN, &report, sizeof(report));
|
||||||
|
has_stylus_pen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Every 10ms, we will sent 1 report for each HID profile (keyboard, mouse etc ..)
|
// Every 10ms, we will sent 1 report for each HID profile (keyboard, mouse etc ..)
|
||||||
// tud_hid_report_complete_cb() is used to send the next report after previous one is complete
|
// tud_hid_report_complete_cb() is used to send the next report after previous one is complete
|
||||||
void hid_task(void)
|
void hid_task(void)
|
||||||
@@ -209,6 +241,14 @@ void hid_task(void)
|
|||||||
// Poll every 10ms
|
// Poll every 10ms
|
||||||
const uint32_t interval_ms = 10;
|
const uint32_t interval_ms = 10;
|
||||||
static uint32_t start_ms = 0;
|
static uint32_t start_ms = 0;
|
||||||
|
static uint32_t touch_ms = 0;
|
||||||
|
static bool touch_state = false;
|
||||||
|
|
||||||
|
if (board_millis() - touch_ms < 100) {
|
||||||
|
touch_ms = board_millis();
|
||||||
|
send_stylus_touch(0, 0, touch_state = !touch_state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( board_millis() - start_ms < interval_ms) return; // not enough time
|
if ( board_millis() - start_ms < interval_ms) return; // not enough time
|
||||||
start_ms += interval_ms;
|
start_ms += interval_ms;
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ uint8_t const desc_hid_report[] =
|
|||||||
{
|
{
|
||||||
TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(REPORT_ID_KEYBOARD )),
|
TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(REPORT_ID_KEYBOARD )),
|
||||||
TUD_HID_REPORT_DESC_MOUSE ( HID_REPORT_ID(REPORT_ID_MOUSE )),
|
TUD_HID_REPORT_DESC_MOUSE ( HID_REPORT_ID(REPORT_ID_MOUSE )),
|
||||||
|
TUD_HID_REPORT_DESC_STYLUS_PEN( HID_REPORT_ID(REPORT_ID_STYLUS_PEN )),
|
||||||
TUD_HID_REPORT_DESC_CONSUMER( HID_REPORT_ID(REPORT_ID_CONSUMER_CONTROL )),
|
TUD_HID_REPORT_DESC_CONSUMER( HID_REPORT_ID(REPORT_ID_CONSUMER_CONTROL )),
|
||||||
TUD_HID_REPORT_DESC_GAMEPAD ( HID_REPORT_ID(REPORT_ID_GAMEPAD ))
|
TUD_HID_REPORT_DESC_GAMEPAD ( HID_REPORT_ID(REPORT_ID_GAMEPAD ))
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ enum
|
|||||||
{
|
{
|
||||||
REPORT_ID_KEYBOARD = 1,
|
REPORT_ID_KEYBOARD = 1,
|
||||||
REPORT_ID_MOUSE,
|
REPORT_ID_MOUSE,
|
||||||
|
REPORT_ID_STYLUS_PEN,
|
||||||
REPORT_ID_CONSUMER_CONTROL,
|
REPORT_ID_CONSUMER_CONTROL,
|
||||||
REPORT_ID_GAMEPAD,
|
REPORT_ID_GAMEPAD,
|
||||||
REPORT_ID_COUNT
|
REPORT_ID_COUNT
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/hid_composite_freertos/CMakePresets.json
Normal file
6
examples/device/hid_composite_freertos/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,16 +1,9 @@
|
|||||||
DEPS_SUBMODULES += lib/FreeRTOS-Kernel
|
RTOS = freertos
|
||||||
|
|
||||||
include ../../build_system/make/make.mk
|
include ../../build_system/make/make.mk
|
||||||
|
|
||||||
FREERTOS_SRC = lib/FreeRTOS-Kernel
|
|
||||||
FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
|
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
src \
|
src \
|
||||||
src/FreeRTOSConfig \
|
|
||||||
$(TOP)/hw \
|
$(TOP)/hw \
|
||||||
$(TOP)/$(FREERTOS_SRC)/include \
|
|
||||||
$(TOP)/$(FREERTOS_PORTABLE_SRC)
|
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
EXAMPLE_SOURCE = \
|
EXAMPLE_SOURCE = \
|
||||||
@@ -19,28 +12,4 @@ EXAMPLE_SOURCE = \
|
|||||||
|
|
||||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||||
|
|
||||||
# FreeRTOS source, all files in port folder
|
|
||||||
SRC_C += \
|
|
||||||
$(FREERTOS_SRC)/list.c \
|
|
||||||
$(FREERTOS_SRC)/queue.c \
|
|
||||||
$(FREERTOS_SRC)/tasks.c \
|
|
||||||
$(FREERTOS_SRC)/timers.c \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c))
|
|
||||||
|
|
||||||
SRC_S += \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
|
|
||||||
|
|
||||||
# include heap manage if configSUPPORT_DYNAMIC_ALLOCATION = 1
|
|
||||||
# SRC_C += $(FREERTOS_SRC)/portable/MemMang/heap_1.c
|
|
||||||
# CFLAGS += -Wno-error=sign-compare
|
|
||||||
|
|
||||||
# Suppress FreeRTOSConfig.h warnings
|
|
||||||
CFLAGS_GCC += -Wno-error=redundant-decls
|
|
||||||
|
|
||||||
# Suppress FreeRTOS source warnings
|
|
||||||
CFLAGS_GCC += -Wno-error=cast-qual
|
|
||||||
|
|
||||||
# FreeRTOS (lto + Os) linker issue
|
|
||||||
LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
|
|
||||||
|
|
||||||
include ../../build_system/make/rules.mk
|
include ../../build_system/make/rules.mk
|
||||||
|
|||||||
@@ -1,191 +0,0 @@
|
|||||||
/*
|
|
||||||
* FreeRTOS Kernel V10.0.0
|
|
||||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software. If you wish to use our Amazon
|
|
||||||
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* http://www.FreeRTOS.org
|
|
||||||
* http://aws.amazon.com/freertos
|
|
||||||
*
|
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FREERTOS_CONFIG_H
|
|
||||||
#define FREERTOS_CONFIG_H
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
|
||||||
* Application specific definitions.
|
|
||||||
*
|
|
||||||
* These definitions should be adjusted for your particular hardware and
|
|
||||||
* application requirements.
|
|
||||||
*
|
|
||||||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
|
|
||||||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
|
|
||||||
*
|
|
||||||
* See http://www.freertos.org/a00110.html.
|
|
||||||
*----------------------------------------------------------*/
|
|
||||||
|
|
||||||
// skip if included from IAR assembler
|
|
||||||
#ifndef __IASMARM__
|
|
||||||
|
|
||||||
// Include MCU header
|
|
||||||
#include "bsp/board_mcu.h"
|
|
||||||
|
|
||||||
#if TUSB_MCU_VENDOR_ESPRESSIF
|
|
||||||
#error "ESP32-Sx should use IDF's FreeRTOSConfig.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO fix later
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_MM32F327X
|
|
||||||
extern u32 SystemCoreClock;
|
|
||||||
#else
|
|
||||||
// FIXME cause redundant-decls warnings
|
|
||||||
extern uint32_t SystemCoreClock;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Cortex M23/M33 port configuration. */
|
|
||||||
#define configENABLE_MPU 0
|
|
||||||
#define configENABLE_FPU 1
|
|
||||||
#define configENABLE_TRUSTZONE 0
|
|
||||||
#define configMINIMAL_SECURE_STACK_SIZE ( 1024 )
|
|
||||||
#define configRUN_FREERTOS_SECURE_ONLY 1
|
|
||||||
|
|
||||||
#define configUSE_PREEMPTION 1
|
|
||||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
|
||||||
#define configCPU_CLOCK_HZ SystemCoreClock
|
|
||||||
#define configTICK_RATE_HZ ( 1000 )
|
|
||||||
#define configMAX_PRIORITIES ( 5 )
|
|
||||||
#define configMINIMAL_STACK_SIZE ( 128 )
|
|
||||||
#define configTOTAL_HEAP_SIZE ( configSUPPORT_DYNAMIC_ALLOCATION*4*1024 )
|
|
||||||
#define configMAX_TASK_NAME_LEN 16
|
|
||||||
#define configUSE_16_BIT_TICKS 0
|
|
||||||
#define configIDLE_SHOULD_YIELD 1
|
|
||||||
#define configUSE_MUTEXES 1
|
|
||||||
#define configUSE_RECURSIVE_MUTEXES 1
|
|
||||||
#define configUSE_COUNTING_SEMAPHORES 1
|
|
||||||
#define configQUEUE_REGISTRY_SIZE 4
|
|
||||||
#define configUSE_QUEUE_SETS 0
|
|
||||||
#define configUSE_TIME_SLICING 0
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 0
|
|
||||||
#define configENABLE_BACKWARD_COMPATIBILITY 1
|
|
||||||
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
|
||||||
|
|
||||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
|
||||||
#define configSUPPORT_DYNAMIC_ALLOCATION 0
|
|
||||||
|
|
||||||
/* Hook function related definitions. */
|
|
||||||
#define configUSE_IDLE_HOOK 0
|
|
||||||
#define configUSE_TICK_HOOK 0
|
|
||||||
#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
|
|
||||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
|
||||||
#define configCHECK_HANDLER_INSTALLATION 0
|
|
||||||
|
|
||||||
/* Run time and task stats gathering related definitions. */
|
|
||||||
#define configGENERATE_RUN_TIME_STATS 0
|
|
||||||
#define configUSE_TRACE_FACILITY 1 // legacy trace
|
|
||||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
|
|
||||||
|
|
||||||
/* Co-routine definitions. */
|
|
||||||
#define configUSE_CO_ROUTINES 0
|
|
||||||
#define configMAX_CO_ROUTINE_PRIORITIES 2
|
|
||||||
|
|
||||||
/* Software timer related definitions. */
|
|
||||||
#define configUSE_TIMERS 1
|
|
||||||
#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
|
|
||||||
#define configTIMER_QUEUE_LENGTH 32
|
|
||||||
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
|
|
||||||
|
|
||||||
/* Optional functions - most linkers will remove unused functions anyway. */
|
|
||||||
#define INCLUDE_vTaskPrioritySet 0
|
|
||||||
#define INCLUDE_uxTaskPriorityGet 0
|
|
||||||
#define INCLUDE_vTaskDelete 0
|
|
||||||
#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
|
|
||||||
#define INCLUDE_xResumeFromISR 0
|
|
||||||
#define INCLUDE_vTaskDelayUntil 1
|
|
||||||
#define INCLUDE_vTaskDelay 1
|
|
||||||
#define INCLUDE_xTaskGetSchedulerState 0
|
|
||||||
#define INCLUDE_xTaskGetCurrentTaskHandle 0
|
|
||||||
#define INCLUDE_uxTaskGetStackHighWaterMark 0
|
|
||||||
#define INCLUDE_xTaskGetIdleTaskHandle 0
|
|
||||||
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
|
|
||||||
#define INCLUDE_pcTaskGetTaskName 0
|
|
||||||
#define INCLUDE_eTaskGetState 0
|
|
||||||
#define INCLUDE_xEventGroupSetBitFromISR 0
|
|
||||||
#define INCLUDE_xTimerPendFunctionCall 0
|
|
||||||
|
|
||||||
#ifdef __RX__
|
|
||||||
/* Renesas RX series */
|
|
||||||
#define vSoftwareInterruptISR INT_Excep_ICU_SWINT
|
|
||||||
#define vTickISR INT_Excep_CMT0_CMI0
|
|
||||||
#define configPERIPHERAL_CLOCK_HZ (configCPU_CLOCK_HZ/2)
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY 1
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* FreeRTOS hooks to NVIC vectors */
|
|
||||||
#define xPortPendSVHandler PendSV_Handler
|
|
||||||
#define xPortSysTickHandler SysTick_Handler
|
|
||||||
#define vPortSVCHandler SVC_Handler
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
// Interrupt nesting behavior configuration.
|
|
||||||
//--------------------------------------------------------------------+
|
|
||||||
#if defined(__NVIC_PRIO_BITS)
|
|
||||||
// For Cortex-M specific: __NVIC_PRIO_BITS is defined in core_cmx.h
|
|
||||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
|
||||||
|
|
||||||
#elif defined(__ECLIC_INTCTLBITS)
|
|
||||||
// RISC-V Bumblebee core from nuclei
|
|
||||||
#define configPRIO_BITS __ECLIC_INTCTLBITS
|
|
||||||
|
|
||||||
#elif defined(__IASMARM__)
|
|
||||||
// FIXME: IAR Assembler cannot include mcu header directly to get __NVIC_PRIO_BITS.
|
|
||||||
// Therefore we will hard coded it to minimum value of 2 to get pass ci build.
|
|
||||||
// IAR user must update this to correct value of the target MCU
|
|
||||||
#message "configPRIO_BITS is hard coded to 2 to pass IAR build only. User should update it per MCU"
|
|
||||||
#define configPRIO_BITS 2
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error "FreeRTOS configPRIO_BITS to be defined"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
|
|
||||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
|
|
||||||
|
|
||||||
/* The highest interrupt priority that can be used by any interrupt service
|
|
||||||
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
|
||||||
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
|
||||||
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
|
||||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
|
|
||||||
|
|
||||||
/* Interrupt priorities used by the kernel port layer itself. These are generic
|
|
||||||
to all Cortex-M ports, and do not rely on any particular library functions. */
|
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
|
||||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __FREERTOS_CONFIG__H */
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/hid_generic_inout/CMakePresets.json
Normal file
6
examples/device/hid_generic_inout/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/hid_multiple_interface/CMakePresets.json
Normal file
6
examples/device/hid_multiple_interface/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/midi_test/CMakePresets.json
Normal file
6
examples/device/midi_test/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/midi_test_freertos/CMakePresets.json
Normal file
6
examples/device/midi_test_freertos/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
|
RTOS = freertos
|
||||||
include ../../build_system/make/make.mk
|
include ../../build_system/make/make.mk
|
||||||
|
|
||||||
FREERTOS_SRC = lib/FreeRTOS-Kernel
|
|
||||||
FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
|
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
src \
|
src \
|
||||||
$(TOP)/hw \
|
$(TOP)/hw \
|
||||||
${TOP}/${FAMILY_PATH}/FreeRTOSConfig \
|
|
||||||
$(TOP)/$(FREERTOS_SRC)/include \
|
|
||||||
$(TOP)/$(FREERTOS_PORTABLE_SRC) \
|
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
EXAMPLE_SOURCE += \
|
EXAMPLE_SOURCE += \
|
||||||
@@ -17,24 +12,4 @@ EXAMPLE_SOURCE += \
|
|||||||
|
|
||||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||||
|
|
||||||
# FreeRTOS source, all files in port folder
|
|
||||||
SRC_C += \
|
|
||||||
$(FREERTOS_SRC)/list.c \
|
|
||||||
$(FREERTOS_SRC)/queue.c \
|
|
||||||
$(FREERTOS_SRC)/tasks.c \
|
|
||||||
$(FREERTOS_SRC)/timers.c \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c))
|
|
||||||
|
|
||||||
SRC_S += \
|
|
||||||
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
|
|
||||||
|
|
||||||
# Suppress FreeRTOSConfig.h warnings
|
|
||||||
CFLAGS_GCC += -Wno-error=redundant-decls
|
|
||||||
|
|
||||||
# Suppress FreeRTOS source warnings
|
|
||||||
CFLAGS_GCC += -Wno-error=cast-qual
|
|
||||||
|
|
||||||
# FreeRTOS (lto + Os) linker issue
|
|
||||||
LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
|
|
||||||
|
|
||||||
include ../../build_system/make/rules.mk
|
include ../../build_system/make/rules.mk
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
@@ -15,20 +15,25 @@ if(FAMILY STREQUAL "espressif")
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${PROJECT})
|
if (RTOS STREQUAL zephyr)
|
||||||
|
set(EXE_NAME app)
|
||||||
|
else()
|
||||||
|
set(EXE_NAME ${PROJECT})
|
||||||
|
add_executable(${EXE_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
target_sources(${PROJECT} PUBLIC
|
target_sources(${EXE_NAME} PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk_dual.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk_dual.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Example include
|
# Example include
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_include_directories(${EXE_NAME} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
# Configure compilation flags and libraries for the example without RTOS.
|
# Configure compilation flags and libraries for the example without RTOS.
|
||||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||||
family_configure_device_example(${PROJECT} noos)
|
family_configure_device_example(${EXE_NAME} ${RTOS})
|
||||||
|
|||||||
6
examples/device/msc_dual_lun/CMakePresets.json
Normal file
6
examples/device/msc_dual_lun/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
6
examples/device/msc_dual_lun/prj.conf
Normal file
6
examples/device/msc_dual_lun/prj.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
CONFIG_GPIO=y
|
||||||
|
CONFIG_FPU=y
|
||||||
|
CONFIG_NO_OPTIMIZATIONS=y
|
||||||
|
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||||
|
CONFIG_NRFX_POWER=y
|
||||||
|
CONFIG_NRFX_UARTE0=y
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/net_lwip_webserver/CMakePresets.json
Normal file
6
examples/device/net_lwip_webserver/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/uac2_headset/CMakePresets.json
Normal file
6
examples/device/uac2_headset/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/uac2_speaker_fb/CMakePresets.json
Normal file
6
examples/device/uac2_speaker_fb/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/usbtmc/CMakePresets.json
Normal file
6
examples/device/usbtmc/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/video_capture/CMakePresets.json
Normal file
6
examples/device/video_capture/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -185,7 +185,7 @@ static void fill_color_bar(uint8_t* buffer, unsigned start_position) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void video_send_frame(void) {
|
static void video_send_frame(void) {
|
||||||
static unsigned start_ms = 0;
|
static unsigned start_ms = 0;
|
||||||
static unsigned already_sent = 0;
|
static unsigned already_sent = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/video_capture_2ch/CMakePresets.json
Normal file
6
examples/device/video_capture_2ch/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/device/webusb_serial/CMakePresets.json
Normal file
6
examples/device/webusb_serial/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/dual/CMakePresets.json
Normal file
6
examples/dual/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/dual/host_hid_to_device_cdc/CMakePresets.json
Normal file
6
examples/dual/host_hid_to_device_cdc/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/dual/host_info_to_device_cdc/CMakePresets.json
Normal file
6
examples/dual/host_info_to_device_cdc/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/host/CMakePresets.json
Normal file
6
examples/host/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
6
examples/host/bare_api/CMakePresets.json
Normal file
6
examples/host/bare_api/CMakePresets.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"include": [
|
||||||
|
"../../../hw/bsp/BoardPresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user