Merge remote-tracking branch 'upstream/edpt_ISO_xfer' into edpt_ISO_xfer

This commit is contained in:
Reinhard Panhuber 2021-03-10 19:33:11 +01:00
commit 8cb3bd3cd3
149 changed files with 2305 additions and 3085 deletions

4
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,4 @@
contact_links:
- name: TinyUSB Discussion
url: https://github.com/hathach/tinyusb/discussions
about: If you have other questions or need help, post it here.

View File

@ -1,11 +0,0 @@
---
name: Porting
about: Adding a new port for this project
title: ''
labels: Porting
assignees: ''
---
**Description**
Describe which API you want to port (DCD/HCD/OSAL/BSP). It is also helpful to go through [porting.md](docs/porting.md) first if you haven't yet.

View File

@ -9,7 +9,9 @@ on:
- created
jobs:
# ---------------------------------------
# Unit testing with Ceedling
# ---------------------------------------
unit-test:
runs-on: ubuntu-latest
steps:
@ -28,8 +30,10 @@ jobs:
cd test
ceedling test:all
# build all example for each family
build-family:
# ---------------------------------------
# Build ARM family
# ---------------------------------------
build-arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
@ -37,6 +41,8 @@ jobs:
family:
# Alphabetical order
- 'imxrt'
- 'lpc18'
- 'lpc55'
- 'nrf'
- 'rp2040'
- 'samd11'
@ -44,30 +50,36 @@ jobs:
- 'samd51'
- 'stm32f4'
- 'stm32f7'
- 'stm32h7'
steps:
- name: Setup Python
uses: actions/setup-python@v2
- name: Setup Node.js
uses: actions/setup-node@v1
- name: Install Toolchains
run: |
# ARM GCC from xpack
npm install --global xpm
xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest
echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH
- name: Checkout TinyUSB
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Checkout Sub-Submodules
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
- name: Cache Toolchain
uses: actions/cache@v2
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
# some submodule has it own submodules that need to be fetched as well
git submodule update --init --recursive hw/mcu/microchip
git submodule update --init --recursive lib/FreeRTOS
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
tar -C ~/cache/toolchain -xaf toolchain.tar.gz
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@ -94,84 +106,75 @@ jobs:
asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip
asset_content_type: application/zip
# Build all no-family (opharned) boards
build-board:
# ---------------------------------------
# Build RISC-V family
# ---------------------------------------
build-riscv:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
family:
# Alphabetical order
- 'device/audio_test'
- 'device/board_test'
- 'device/cdc_dual_ports'
- 'device/cdc_msc'
- 'device/cdc_msc_freertos'
- 'device/dfu_runtime'
- 'device/hid_composite'
- 'device/hid_composite_freertos'
- 'device/hid_generic_inout'
- 'device/hid_multiple_interface'
- 'device/midi_test'
- 'device/msc_dual_lun'
- 'device/net_lwip_webserver'
- 'device/uac2_headset'
- 'device/usbtmc'
- 'device/webusb_serial'
- 'host/cdc_msc_hid'
- 'fomu'
steps:
- name: Setup Python
uses: actions/setup-python@v2
- name: Setup Node.js
uses: actions/setup-node@v1
- name: Checkout TinyUSB
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Checkout Sub-Submodules
run: |
# some submodule has it own submodules that need to be fetched as well
git submodule update --init --recursive hw/mcu/microchip
git submodule update --init --recursive lib/FreeRTOS
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
# Add msp430-gcc url to env
echo >> $GITHUB_ENV MSP430_GCC_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
- name: Cache MSP430-GCC
- name: Cache Toolchain
uses: actions/cache@v2
id: cache-msp430
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-21-01-26-${{ env.MSP430_GCC_URL }}
key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
- name: Install MSP430-GCC
if: steps.cache-msp430.outputs.cache-hit != 'true'
- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
# MSP430 GCC
mkdir -p ~/cache/msp430-gcc
wget --progress=dot:mega $MSP430_GCC_URL -O msp430-gcc.tar.bz2
tar -C ~/cache/msp430-gcc -xaf msp430-gcc.tar.bz2
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
tar -C ~/cache/toolchain -xaf toolchain.tar.gz
- name: Install Toolchains
run: |
# ARM & RISC-V GCC from xpack
npm install --global xpm
xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest
xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest
echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH
echo `echo $HOME/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin` >> $GITHUB_PATH
# TI MSP430 GCC
echo >> $GITHUB_PATH `echo ~/cache/msp430-gcc/msp430-gcc-*/bin`
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Build
run: python3 tools/build_board.py ${{ matrix.example }}
run: python3 tools/build_family.py ${{ matrix.family }}
# Build ESP32S2
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.family }}-tinyusb-examples
path: _bin/
- name: Create Release Asset
if: ${{ github.event_name == 'release' }}
run: |
cd _bin/
zip -r ../${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip *
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'release' }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip
asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip
asset_content_type: application/zip
# ---------------------------------------
# Build ESP32S2 family
# ---------------------------------------
build-esp32s2:
runs-on: ubuntu-latest
strategy:
@ -194,8 +197,121 @@ jobs:
- name: Checkout TinyUSB
uses: actions/checkout@v2
with:
submodules: 'false'
- name: Build
run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s2.py ${{ matrix.board }}
# ---------------------------------------
# Build msp430 family
# ---------------------------------------
build-msp430:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'msp430'
steps:
- name: Setup Python
uses: actions/setup-python@v2
- name: Checkout TinyUSB
uses: actions/checkout@v2
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2
- name: Cache Toolchain
uses: actions/cache@v2
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.bz2
tar -C ~/cache/toolchain -xaf toolchain.tar.bz2
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.family }}-tinyusb-examples
path: _bin/
- name: Create Release Asset
if: ${{ github.event_name == 'release' }}
run: |
cd _bin/
zip -r ../${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip *
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'release' }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip
asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip
asset_content_type: application/zip
# ---------------------------------------
# Build all no-family (opharned) boards
# ---------------------------------------
build-board:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
# Alphabetical order, a group of 4
- 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
- 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
- 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
- 'device/net_lwip_webserver'
- 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
steps:
- name: Setup Python
uses: actions/setup-python@v2
- name: Checkout TinyUSB
uses: actions/checkout@v2
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
- name: Cache Toolchain
uses: actions/cache@v2
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
tar -C ~/cache/toolchain -xaf toolchain.tar.gz
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Build
run: python3 tools/build_board.py ${{ matrix.example }}

16
.gitmodules vendored
View File

@ -22,12 +22,6 @@
[submodule "lib/lwip"]
path = lib/lwip
url = https://github.com/lwip-tcpip/lwip.git
[submodule "lib/FreeRTOS"]
path = lib/FreeRTOS
url = https://github.com/FreeRTOS/FreeRTOS.git
[submodule "lib/CMSIS_4"]
path = lib/CMSIS_4
url = https://github.com/ARM-software/CMSIS.git
[submodule "hw/mcu/st/cmsis_device_f4"]
path = hw/mcu/st/cmsis_device_f4
url = https://github.com/STMicroelectronics/cmsis_device_f4.git
@ -106,9 +100,6 @@
[submodule "hw/mcu/st/stm32l5xx_hal_driver"]
path = hw/mcu/st/stm32l5xx_hal_driver
url = https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git
[submodule "lib/CMSIS_5"]
path = lib/CMSIS_5
url = https://github.com/ARM-software/CMSIS_5.git
[submodule "lib/sct_neopixel"]
path = lib/sct_neopixel
url = https://github.com/gsteiert/sct_neopixel
@ -116,4 +107,9 @@
path = hw/mcu/raspberrypi/pico-sdk
url = https://github.com/raspberrypi/pico-sdk.git
fetchRecurseSubmodules = false
[submodule "lib/FreeRTOS-Kernel"]
path = lib/FreeRTOS-Kernel
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
[submodule "lib/CMSIS_5"]
path = lib/CMSIS_5
url = https://github.com/ARM-software/CMSIS_5.git

View File

@ -94,9 +94,11 @@ This code base already had supported for a handful of following boards (sorted a
- [LPCXpresso 11u68](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc11u68:OM13058)
- [LPCXpresso 1347](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1347:OM13045)
- [LPCXpresso 1769](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1769:OM13000)
- [LPCXpresso18S37 Development Board](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc4000-cortex-m4/lpcxpresso18s37-development-board:OM13076)
- [LPCXpresso 51U68](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpcxpresso51u68-for-the-lpc51u68-mcus:OM40005)
- [LPCXpresso 54114](https://www.nxp.com/design/microcontrollers-developer-resources/lpcxpresso-boards/lpcxpresso54114-board:OM13089)
- [LPCXpresso 55s69 EVK](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc5500-cortex-m33/lpcxpresso55s69-development-board:LPC55S69-EVK)
- [LPCXpresso 55s28 EVK](https://www.nxp.com/design/software/development-software/lpcxpresso55s28-development-board:LPC55S28-EVK)
- [LPCXpresso 55s69 EVK](https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s69-development-board:LPC55S69-EVK)
- [NGX LPC4330-Xplorer](https://www.nxp.com/design/designs/lpc4330-xplorer-board:OM13027)
- [Double M33 Express](https://www.crowdsupply.com/steiert-solutions/double-m33-express)
@ -104,7 +106,7 @@ This code base already had supported for a handful of following boards (sorted a
- [Adafruit Feather RP2040](https://www.adafruit.com/product/4884)
- [Adafruit ItsyBitsy RP2040](https://www.adafruit.com/product/4888)
- Adafruit QT RP2040
- [Adafruit QT Py RP2040](https://www.adafruit.com/product/4900)
- [Raspberry Pi Pico](https://www.raspberrypi.org/products/raspberry-pi-pico/)
### Sony

View File

@ -10,9 +10,9 @@ It is relatively simple to incorporate tinyusb to your (existing) project
- Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as CFG_TUSB_MCU, CFG_TUSB_OS since they are passed by IDE/compiler to maintain a unique configure for all boards).
- If you use the device stack, make sure you have created/modified usb descriptors for your own need. Ultimately you need to implement all **tud_descriptor_** callbacks for the stack to work.
- Add tusb_init() call to your reset initialization code.
- Call `tud_int_handler()` (device stack) and/or `tuh_int_handler()` in your USB IRQ Handler
- Call `tud_int_handler()` (device) and/or `tuh_int_handler()` (host) in your USB IRQ Handler
- Implement all enabled classes's callbacks.
- If you don't use any RTOSes at all, you need to continuously and/or periodically call tud_task()/tuh_task() function. All of the callbacks and functionality are handled and invoke within the call of that task runner.
- If you don't use any RTOSes at all, you need to continuously and/or periodically call tud_task()/tuh_task() function. All of the callbacks and functionality are handled and invoked within the call of that task runner.
~~~{.c}
int main(void)
@ -39,13 +39,15 @@ $ git clone https://github.com/hathach/tinyusb tinyusb
$ cd tinyusb
```
TinyUSB examples includes external repos aka submodules to provide low-level MCU peripheral's driver as well as external libraries such as FreeRTOS to compile with. Therefore we will firstly fetch those mcu driver repo by running this command in the top folder repo
Some TinyUSB examples also requires external submodule libraries in `/lib` such as FreeRTOS, Lightweight IP to build. Run following command to fetch them
```
$ git submodule update --init --recursive
$ git submodule update --init lib
```
It will takes a bit of time due to the number of supported MCUs, luckily we only need to do this once. Or if you only want to test with a specific mcu, you could only fetch its driver submodule.
In addition, MCU driver submodule is also needed to provide low-level MCU peripheral's driver. Luckily, it will be fetched if needed when you run the `make` to build your board.
Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy `/examples/device/99-tinyusb.rules` file to /etc/udev/rules.d/ then run `sudo udevadm control --reload-rules && sudo udevadm trigger` is good enough.
### Build
@ -61,6 +63,8 @@ Then compile with `make BOARD=[board_name] all`, for example
$ make BOARD=feather_nrf52840_express all
```
Note: `BOARD` can be found as directory name in `hw/bsp`, either in its family/boards or directly under bsp (no family).
#### Port Selection
If a board has several ports, one port is chosen by default in the individual board.mk file. Use option `PORT=x` To choose another port. For example to select the HS port of a STM32F746Disco board, use:

View File

@ -12,7 +12,3 @@ ATTRS{idVendor}=="cafe", MODE="0666", GROUP="dialout"
# Rule to blacklist TinyUSB example from being manipulated by ModemManager.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="cafe", ENV{ID_MM_DEVICE_IGNORE}="1"
# Xplained Pro SamG55 Device
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="0666", GROUP="users", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEMS=="tty", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="0666", GROUP="users", ENV{ID_MM_DEVICE_IGNORE}="1"

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -37,9 +37,6 @@ elseif(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -39,9 +39,6 @@ elseif(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -21,7 +21,7 @@
build_treat_warnings_as_errors="Yes"
c_additional_options="-Wno-error=undef;-Wno-error=unused-parameter;-Wno-error=cast-align;-Wno-error=cast-function-type"
c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;CFG_TUSB_MCU=OPT_MCU_NRF5X;CFG_TUSB_DEBUG=1"
c_user_include_directories="../../src;$(rootDir)/lib/CMSIS_4/CMSIS/Include;$(rootDir)/hw;$(rootDir)/src;$(nrfxDir)/..;$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include;$(nrfxDir)/drivers/src"
c_user_include_directories="../../src;$(rootDir)/lib/CMSIS_5/CMSIS/Core/Include;$(rootDir)/hw;$(rootDir)/src;$(nrfxDir)/..;$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include;$(nrfxDir)/drivers/src"
debug_register_definition_file="nrf52840_Registers.xml"
debug_target_connection="J-Link"
gcc_enable_all_warnings="Yes"

View File

@ -1,7 +1,7 @@
include ../../../tools/top.mk
include ../../make.mk
FREERTOS_SRC = lib/FreeRTOS/FreeRTOS/Source
FREERTOS_SRC = lib/FreeRTOS-Kernel
INC += \
src \

View File

@ -20,7 +20,7 @@
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="No"
c_preprocessor_definitions="LPC175x_6x;__LPC1700_FAMILY;__LPC176x_SUBFAMILY;ARM_MATH_CM3;FLASH_PLACEMENT=1;CORE_M3;CFG_TUSB_MCU=OPT_MCU_LPC175X_6X"
c_user_include_directories=".;../../src;$(rootDir)/hw;$(rootDir)/src;$(rootDir)/hw/mcu/nxp/lpc_driver/lpc_chip_175x_6x/inc;$(rootDir)/lib/FreeRTOS/Source/include;$(rootDir)/lib/FreeRTOS/Source/portable/GCC/ARM_CM3"
c_user_include_directories=".;../../src;$(rootDir)/hw;$(rootDir)/src;$(rootDir)/hw/mcu/nxp/lpc_driver/lpc_chip_175x_6x/inc;$(rootDir)/lib/FreeRTOS-Kernel/include;$(rootDir)/lib/FreeRTOS-Kernel/portable/GCC/ARM_CM3"
debug_register_definition_file="LPC176x5x_Registers.xml"
debug_target_connection="J-Link"
gcc_enable_all_warnings="Yes"
@ -92,39 +92,39 @@
<folder Name="FreeRTOS">
<folder Name="Source">
<folder Name="include">
<file file_name="../../../../../lib/FreeRTOS/Source/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/timers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/timers.h" />
</folder>
<folder Name="portable">
<folder Name="GCC">
<folder Name="ARM_CM3">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM3/port.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM3/portmacro.h" />
</folder>
</folder>
<folder Name="MemMang">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/MemMang/heap_4.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/MemMang/heap_4.c" />
</folder>
</folder>
<file file_name="../../../../../lib/FreeRTOS/Source/list.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/queue.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/timers.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/list.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/queue.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/timers.c" />
</folder>
<file file_name="../../../../../lib/FreeRTOS/freertos_hook.c" />
</folder>

View File

@ -107,39 +107,39 @@
<folder Name="FreeRTOS">
<folder Name="Source">
<folder Name="include">
<file file_name="../../../../../lib/FreeRTOS/Source/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/timers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/timers.h" />
</folder>
<folder Name="portable">
<folder Name="GCC">
<folder Name="ARM_CM4F">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM4F/port.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM4F/portmacro.h" />
</folder>
</folder>
<folder Name="MemMang">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/MemMang/heap_4.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/MemMang/heap_4.c" />
</folder>
</folder>
<file file_name="../../../../../lib/FreeRTOS/Source/list.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/queue.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/timers.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/list.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/queue.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/timers.c" />
</folder>
</folder>
</folder>

View File

@ -100,39 +100,39 @@
<folder Name="FreeRTOS">
<folder Name="Source">
<folder Name="include">
<file file_name="../../../../../lib/FreeRTOS/Source/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/timers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/timers.h" />
</folder>
<folder Name="portable">
<folder Name="GCC">
<folder Name="ARM_CM0">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM0/portmacro.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM0/port.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM0/portmacro.h" />
</folder>
</folder>
<folder Name="MemMang">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/MemMang/heap_4.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/MemMang/heap_4.c" />
</folder>
</folder>
<file file_name="../../../../../lib/FreeRTOS/Source/list.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/queue.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/timers.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/list.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/queue.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/timers.c" />
</folder>
<file file_name="../../../../../lib/FreeRTOS/freertos_hook.c" />
</folder>

View File

@ -104,39 +104,39 @@
<folder Name="FreeRTOS">
<folder Name="Source">
<folder Name="include">
<file file_name="../../../../../lib/FreeRTOS/Source/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS/Source/include/timers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/croutine.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/deprecated_definitions.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/event_groups.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/FreeRTOS.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/list.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/message_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_prototypes.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/mpu_wrappers.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/portable.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/projdefs.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/queue.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/semphr.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stack_macros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/StackMacros.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/stream_buffer.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/task.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/include/timers.h" />
</folder>
<folder Name="portable">
<folder Name="GCC">
<folder Name="ARM_CM4F">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM4F/port.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/GCC/ARM_CM4F/portmacro.h" />
</folder>
</folder>
<folder Name="MemMang">
<file file_name="../../../../../lib/FreeRTOS/Source/portable/MemMang/heap_4.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/portable/MemMang/heap_4.c" />
</folder>
</folder>
<file file_name="../../../../../lib/FreeRTOS/Source/list.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/queue.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/timers.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/list.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/queue.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS-Kernel/timers.c" />
</folder>
<file file_name="../../../../../lib/FreeRTOS/freertos_hook.c" />
</folder>

View File

@ -71,6 +71,7 @@ extern uint32_t SystemCoreClock;
#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

View File

@ -37,7 +37,7 @@ void vApplicationMallocFailedHook(void)
TU_ASSERT(false, );
}
void vApplicationStackOverflowHook(xTaskHandle pxTask, signed char *pcTaskName)
void vApplicationStackOverflowHook(xTaskHandle pxTask, char *pcTaskName)
{
(void) pxTask;
(void) pcTaskName;

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -34,9 +34,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -1,7 +1,7 @@
include ../../../tools/top.mk
include ../../make.mk
FREERTOS_SRC = lib/FreeRTOS/FreeRTOS/Source
FREERTOS_SRC = lib/FreeRTOS-Kernel
INC += \
src \

View File

@ -71,6 +71,7 @@ extern uint32_t SystemCoreClock;
#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

View File

@ -37,7 +37,7 @@ void vApplicationMallocFailedHook(void)
TU_ASSERT(false, );
}
void vApplicationStackOverflowHook(xTaskHandle pxTask, signed char *pcTaskName)
void vApplicationStackOverflowHook(xTaskHandle pxTask, char *pcTaskName)
{
(void) pxTask;
(void) pcTaskName;

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -34,9 +34,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -80,9 +80,6 @@ if(FAMILY STREQUAL "rp2040")
HTTPD_USE_CUSTOM_FSDATA=0
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -34,9 +34,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -33,9 +33,6 @@ if(FAMILY STREQUAL "rp2040")
CFG_TUSB_OS=OPT_OS_PICO
)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration)
pico_add_extra_outputs(${PROJECT})
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -23,6 +23,26 @@
*
*/
/* This example demonstrates WebUSB as web serial with browser with WebUSB support (e.g Chrome).
* After enumerated successfully, browser will pop-up notification
* with URL to landing page, click on it to test
* - Click "Connect" and select device, When connected the on-board LED will litted up.
* - Any charters received from either webusb/Serial will be echo back to webusb and Serial
*
* Note:
* - The WebUSB landing page notification is currently disabled in Chrome
* on Windows due to Chromium issue 656702 (https://crbug.com/656702). You have to
* go to landing page (below) to test
*
* - On Windows 7 and prior: You need to use Zadig tool to manually bind the
* WebUSB interface with the WinUSB driver for Chrome to access. From windows 8 and 10, this
* is done automatically by firmware.
*
* - On Linux/macOS, udev permission may need to be updated by
* - copying '/examples/device/99-tinyusb.rules' file to /etc/udev/rules.d/ then
* - run 'sudo udevadm control --reload-rules && sudo udevadm trigger'
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@ -149,52 +169,59 @@ void tud_resume_cb(void)
bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
{
// nothing to with DATA & ACK stage
if (stage != CONTROL_STAGE_SETUP ) return true;
if (stage != CONTROL_STAGE_SETUP) return true;
if (request->bmRequestType_bit.type == TUSB_REQ_TYPE_VENDOR) {
switch (request->bRequest)
{
case VENDOR_REQUEST_WEBUSB:
// match vendor request in BOS descriptor
// Get landing page url
return tud_control_xfer(rhport, request, (void*) &desc_url, desc_url.bLength);
switch (request->bmRequestType_bit.type)
{
case TUSB_REQ_TYPE_VENDOR:
switch (request->bRequest)
{
case VENDOR_REQUEST_WEBUSB:
// match vendor request in BOS descriptor
// Get landing page url
return tud_control_xfer(rhport, request, (void*) &desc_url, desc_url.bLength);
case VENDOR_REQUEST_MICROSOFT:
if ( request->wIndex == 7 )
case VENDOR_REQUEST_MICROSOFT:
if ( request->wIndex == 7 )
{
// Get Microsoft OS 2.0 compatible descriptor
uint16_t total_len;
memcpy(&total_len, desc_ms_os_20+8, 2);
return tud_control_xfer(rhport, request, (void*) desc_ms_os_20, total_len);
}else
{
return false;
}
default: break;
}
break;
case TUSB_REQ_TYPE_CLASS:
if (request->bRequest == 0x22)
{
// Webserial simulate the CDC_REQUEST_SET_CONTROL_LINE_STATE (0x22) to connect and disconnect.
web_serial_connected = (request->wValue != 0);
// Always lit LED if connected
if ( web_serial_connected )
{
// Get Microsoft OS 2.0 compatible descriptor
uint16_t total_len;
memcpy(&total_len, desc_ms_os_20+8, 2);
board_led_write(true);
blink_interval_ms = BLINK_ALWAYS_ON;
return tud_control_xfer(rhport, request, (void*) desc_ms_os_20, total_len);
tud_vendor_write_str("\r\nTinyUSB WebUSB device example\r\n");
}else
{
return false;
blink_interval_ms = BLINK_MOUNTED;
}
default:
return false;
}
} else if (
request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS &&
request->bRequest == 0x22) {
// Webserial simulate the CDC_REQUEST_SET_CONTROL_LINE_STATE (0x22) to
// connect and disconnect.
web_serial_connected = (request->wValue != 0);
// response with status OK
return tud_control_status(rhport, request);
}
break;
// Always lit LED if connected
if ( web_serial_connected ) {
board_led_write(true);
blink_interval_ms = BLINK_ALWAYS_ON;
tud_vendor_write_str("\r\nTinyUSB WebUSB device example\r\n");
}else
{
blink_interval_ms = BLINK_MOUNTED;
}
// response with status OK
return tud_control_status(rhport, request);
default: break;
}
// stall unknown request

View File

@ -0,0 +1,43 @@
# use directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})
# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
# Check for -DFAMILY=
if(FAMILY STREQUAL "esp32s2")
cmake_minimum_required(VERSION 3.5)
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
project(${PROJECT})
elseif(FAMILY STREQUAL "rp2040")
cmake_minimum_required(VERSION 3.12)
set(PICO_SDK_PATH ${TOP}/hw/mcu/raspberrypi/pico-sdk)
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
project(${PROJECT})
pico_sdk_init()
add_executable(${PROJECT})
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_app.c
)
# Example include
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Example defines
target_compile_definitions(${PROJECT} PUBLIC
CFG_TUSB_OS=OPT_OS_PICO
)
else()
message(FATAL_ERROR "Invalid FAMILY specified")
endif()

View File

@ -15,24 +15,14 @@ check_defined = \
__check_defined = \
$(if $(value $1),, \
$(error Undefined make flag: $1$(if $2, ($2))))
# TODO Check if submodule haven't checkout yet
fetch_submodule_if_empty = \
ifeq ($(wildcard $(TOP)/$1/*),) \
$(info $(shell git -C $(TOP) submodule update --init)) \
endif
#-------------- Select the board to build for. ------------
#BOARD_LIST = $(sort $(subst /.,,$(subst $(TOP)/hw/bsp/,,$(wildcard $(TOP)/hw/bsp/*/.))))
#ifeq ($(filter $(BOARD),$(BOARD_LIST)),)
# $(info You must provide a BOARD parameter with 'BOARD=', supported boards are:)
# $(foreach b,$(BOARD_LIST),$(info - $(b)))
# $(error Invalid BOARD specified)
#endif
# Board without family
BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/$(BOARD)))
ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),)
BOARD_PATH := hw/bsp/$(BOARD)
FAMILY :=
endif
# Board within family
ifeq ($(BOARD_PATH),)
@ -42,6 +32,7 @@ ifeq ($(BOARD_PATH),)
endif
ifeq ($(BOARD_PATH),)
$(info You must provide a BOARD parameter with 'BOARD=')
$(error Invalid BOARD specified)
endif
@ -56,6 +47,16 @@ endif
#TODO $(call fetch_submodule_if_empty,lib/sct_neopixel)
# Fetch submodules depended by family
fetch_submodule_if_empty = \
ifeq ($(wildcard $(TOP)/$1/*),) \
$(info $(shell git -C $(TOP) submodule update --init $1)) \
endif
ifdef DEPS_SUBMODULES
$(foreach s,$(DEPS_SUBMODULES),:$(call fetch_submodule_if_empty,$(s)))
endif
#-------------- Cross Compiler ------------
# Can be set by board, default to ARM GCC
CROSS_COMPILE ?= arm-none-eabi-
@ -65,13 +66,14 @@ CXX = $(CROSS_COMPILE)g++
OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
MKDIR = mkdir
ifeq ($(CMDEXE),1)
CP = copy
RM = del
CP = copy
RM = del
else
SED = sed
CP = cp
RM = rm
SED = sed
CP = cp
RM = rm
endif
#-------------- Source files and compiler flags --------------
@ -80,6 +82,8 @@ endif
SRC_C += hw/bsp/board.c
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c))
INC += $(TOP)/$(FAMILY_PATH)
# Compiler Flags
CFLAGS += \
-ggdb \

View File

@ -6,7 +6,9 @@
.DEFAULT_GOAL := all
ifeq ($(FAMILY),esp32s2)
# ---------------------------------------
# Espressif IDF use CMake build system, this add wrapper target to call idf.py
# ---------------------------------------
.PHONY: all clean flash
@ -44,6 +46,9 @@ $(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin
$(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^
else ifeq ($(FAMILY),rp2040)
# ---------------------------------------
# RP2040 CMake
# ---------------------------------------
ifeq ($(DEBUG), 1)
CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
@ -58,11 +63,14 @@ all: $(BUILD)
clean:
$(RM) -rf $(BUILD)
#flash: flash-pyocd
flash:
@$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2
else
# ---------------------------------------
# GNU Make build system
# ---------------------------------------
# libc
LIBS += -lgcc -lm -lnosys
@ -93,12 +101,11 @@ INC += $(TOP)/src
CFLAGS += $(addprefix -I,$(INC))
# TODO Skip nanolib for MSP430
ifeq ($(BOARD), msp_exp430f5529lp)
LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections
else
LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nosys.specs -specs=nano.specs
LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections
ifneq ($(SKIP_NANOLIB), 1)
LDFLAGS += -specs=nosys.specs -specs=nano.specs
endif
ASFLAGS += $(CFLAGS)
# Assembly files can be name with upper case .S, convert it to .s
@ -188,6 +195,8 @@ else
$(RM) -rf $(BUILD)
endif
endif # GNU Make
# Print out the value of a make variable.
# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
print-%:
@ -221,7 +230,6 @@ flash-pyocd: $(BUILD)/$(PROJECT).hex
pyocd flash -t $(PYOCD_TARGET) $<
pyocd reset -t $(PYOCD_TARGET)
endif # GNU Make
#-------------- Artifacts --------------

View File

@ -1,3 +1,4 @@
DEPS_SUBMODULES = hw/mcu/microchip
HWREV ?= 1
CFLAGS += \
@ -21,30 +22,30 @@ CFLAGS += \
LD_FILE = hw/bsp/$(BOARD)/same51j19a_flash.ld
SRC_C += \
hw/mcu/microchip/asf4/same51/gcc/gcc/startup_same51.c \
hw/mcu/microchip/asf4/same51/gcc/system_same51.c \
hw/mcu/microchip/same51/gcc/gcc/startup_same51.c \
hw/mcu/microchip/same51/gcc/system_same51.c \
ifdef SYSCALLS
ifneq ($(SYSCALLS),0)
SRC_C += hw/mcu/microchip/asf4/same51/hal/utils/src/utils_syscalls.c
SRC_C += hw/mcu/microchip/same51/hal/utils/src/utils_syscalls.c
endif
endif
ifdef LOG
ifneq ($(LOG),0)
SRC_C += hw/mcu/microchip/asf4/same51/hal/utils/src/utils_syscalls.c
SRC_C += hw/mcu/microchip/same51/hal/utils/src/utils_syscalls.c
endif
endif
INC += \
$(TOP)/hw/mcu/microchip/asf4/same51/ \
$(TOP)/hw/mcu/microchip/asf4/same51/config \
$(TOP)/hw/mcu/microchip/asf4/same51/include \
$(TOP)/hw/mcu/microchip/asf4/same51/hal/include \
$(TOP)/hw/mcu/microchip/asf4/same51/hal/utils/include \
$(TOP)/hw/mcu/microchip/asf4/same51/hpl/port \
$(TOP)/hw/mcu/microchip/asf4/same51/hri \
$(TOP)/hw/mcu/microchip/asf4/same51/CMSIS/Include
$(TOP)/hw/mcu/microchip/same51/ \
$(TOP)/hw/mcu/microchip/same51/config \
$(TOP)/hw/mcu/microchip/same51/include \
$(TOP)/hw/mcu/microchip/same51/hal/include \
$(TOP)/hw/mcu/microchip/same51/hal/utils/include \
$(TOP)/hw/mcu/microchip/same51/hpl/port \
$(TOP)/hw/mcu/microchip/same51/hri \
$(TOP)/hw/mcu/microchip/same51/CMSIS/Include
# For TinyUSB port source
VENDOR = microchip

View File

@ -1,4 +1,4 @@
CFLAGS += \
CFLAGS += \
-flto \
-mthumb \
-mthumb-interwork \

View File

@ -1,4 +1,4 @@
CFLAGS += \
CFLAGS += \
-flto \
-mthumb \
-mthumb-interwork \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -0,0 +1,40 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021, Ha Thach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#ifndef BOARD_H_
#define BOARD_H_
#ifdef __cplusplus
extern "C" {
#endif
// Place holder only
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1 @@
# place holder

View File

@ -8,16 +8,13 @@ CFLAGS += \
# Cross Compiler for RISC-V
CROSS_COMPILE = riscv-none-embed-
MCU_DIR = hw/mcu/fomu
BSP_DIR = hw/bsp/fomu
# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/fomu.ld
LD_FILE = $(FAMILY_PATH)/fomu.ld
SRC_S += hw/bsp/$(BOARD)/crt0-vexriscv.S
SRC_S += $(FAMILY_PATH)/crt0-vexriscv.S
INC += \
$(TOP)/$(BSP_DIR)/include
$(TOP)/$(FAMILY_PATH)/include
# For TinyUSB port source
VENDOR = valentyusb

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-mthumb \
-mabi=aapcs \

View File

@ -1,4 +1,5 @@
UF2_FAMILY_ID = 0x4fb2d5bd
DEPS_SUBMODULES = hw/mcu/nxp
include $(TOP)/$(BOARD_PATH)/board.mk

View File

@ -0,0 +1,77 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021, Ha Thach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#ifndef BOARD_H_
#define BOARD_H_
// Note: For USB Host demo, install JP4
// WARNING: don't install JP4 when running as device
#ifdef __cplusplus
extern "C" {
#endif
// LED Red
#define LED_PORT 3
#define LED_PIN 7
// ISP Button
#define BUTTON_PORT 0
#define BUTTON_PIN 7
#define UART_DEV LPC_USART0
static inline void board_lpc18_pinmux(void)
{
const PINMUX_GRP_T pinmuxing[] =
{
// LEDs
{ 0x6, 9 , SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0 },
{ 0x6, 11, SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0 },
// Button
{ 0x2, 7, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC0 },
// UART
{ 0x06, 4, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 },
{ 0x02, 1, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC1 },
// USB0
//{ 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function
//{ 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function
//{ 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION
{0x2, 5, SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC4 },
};
Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,6 @@
LD_FILE = $(BOARD_PATH)/lpc1837.ld
# For flash-jlink target
JLINK_DEVICE = LPC18S37
flash: flash-jlink

View File

@ -0,0 +1,404 @@
/*
* GENERATED FILE - DO NOT EDIT
* Copyright (c) 2008-2013 Code Red Technologies Ltd,
* Copyright 2015, 2018-2019 NXP
* (c) NXP Semiconductors 2013-2021
* Generated linker script file for LPC1837
* Created from linkscript.ldt by FMCreateLinkLibraries
* Using Freemarker v2.3.23
* MCUXpresso IDE v11.2.0 [Build 4120] [2020-07-09] on Mar 3, 2021 4:22:49 PM
*/
MEMORY
{
/* Define each memory region */
MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
MFlashB512 (rx) : ORIGIN = 0x1b000000, LENGTH = 0x80000 /* 512K bytes (alias Flash2) */
RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
RamLoc40 (rwx) : ORIGIN = 0x10080000, LENGTH = 0xa000 /* 40K bytes (alias RAM2) */
RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM3) */
RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */
RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */
}
/* Define a symbol for the top of each memory region */
__base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */
__base_Flash = 0x1a000000 ; /* Flash */
__top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */
__top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */
__base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */
__base_Flash2 = 0x1b000000 ; /* Flash2 */
__top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */
__top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */
__base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
__base_RAM = 0x10000000 ; /* RAM */
__top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
__top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
__base_RamLoc40 = 0x10080000 ; /* RamLoc40 */
__base_RAM2 = 0x10080000 ; /* RAM2 */
__top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */
__top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */
__base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
__base_RAM3 = 0x20000000 ; /* RAM3 */
__top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
__top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
__base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
__base_RAM4 = 0x20008000 ; /* RAM4 */
__top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
__top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
__base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
__base_RAM5 = 0x2000c000 ; /* RAM5 */
__top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
__top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
ENTRY(ResetISR)
SECTIONS
{
.text_Flash2 : ALIGN(4)
{
FILL(0xff)
*(.text_Flash2) /* for compatibility with previous releases */
*(.text_MFlashB512) /* for compatibility with previous releases */
*(.text.$Flash2)
*(.text.$MFlashB512)
*(.text_Flash2.*) /* for compatibility with previous releases */
*(.text_MFlashB512.*) /* for compatibility with previous releases */
*(.text.$Flash2.*)
*(.text.$MFlashB512.*)
*(.rodata.$Flash2)
*(.rodata.$MFlashB512)
*(.rodata.$Flash2.*)
*(.rodata.$MFlashB512.*) } > MFlashB512
/* MAIN TEXT SECTION */
.text : ALIGN(4)
{
FILL(0xff)
__vectors_start__ = ABSOLUTE(.) ;
KEEP(*(.isr_vector))
/* Global Section Table */
. = ALIGN(4) ;
__section_table_start = .;
__data_section_table = .;
LONG(LOADADDR(.data));
LONG( ADDR(.data));
LONG( SIZEOF(.data));
LONG(LOADADDR(.data_RAM2));
LONG( ADDR(.data_RAM2));
LONG( SIZEOF(.data_RAM2));
LONG(LOADADDR(.data_RAM3));
LONG( ADDR(.data_RAM3));
LONG( SIZEOF(.data_RAM3));
LONG(LOADADDR(.data_RAM4));
LONG( ADDR(.data_RAM4));
LONG( SIZEOF(.data_RAM4));
LONG(LOADADDR(.data_RAM5));
LONG( ADDR(.data_RAM5));
LONG( SIZEOF(.data_RAM5));
__data_section_table_end = .;
__bss_section_table = .;
LONG( ADDR(.bss));
LONG( SIZEOF(.bss));
LONG( ADDR(.bss_RAM2));
LONG( SIZEOF(.bss_RAM2));
LONG( ADDR(.bss_RAM3));
LONG( SIZEOF(.bss_RAM3));
LONG( ADDR(.bss_RAM4));
LONG( SIZEOF(.bss_RAM4));
LONG( ADDR(.bss_RAM5));
LONG( SIZEOF(.bss_RAM5));
__bss_section_table_end = .;
__section_table_end = . ;
/* End of Global Section Table */
*(.after_vectors*)
} > MFlashA512
.text : ALIGN(4)
{
*(.text*)
*(.rodata .rodata.* .constdata .constdata.*)
. = ALIGN(4);
} > MFlashA512
/*
* for exception handling/unwind - some Newlib functions (in common
* with C++ and STDC++) use this.
*/
.ARM.extab : ALIGN(4)
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > MFlashA512
.ARM.exidx : ALIGN(4)
{
__exidx_start = .;
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} > MFlashA512
_etext = .;
/* DATA section for RamLoc40 */
.data_RAM2 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM2 = .) ;
PROVIDE(__start_data_RamLoc40 = .) ;
*(.ramfunc.$RAM2)
*(.ramfunc.$RamLoc40)
*(.data.$RAM2)
*(.data.$RamLoc40)
*(.data.$RAM2.*)
*(.data.$RamLoc40.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM2 = .) ;
PROVIDE(__end_data_RamLoc40 = .) ;
} > RamLoc40 AT>MFlashA512
/* DATA section for RamAHB32 */
.data_RAM3 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM3 = .) ;
PROVIDE(__start_data_RamAHB32 = .) ;
*(.ramfunc.$RAM3)
*(.ramfunc.$RamAHB32)
*(.data.$RAM3)
*(.data.$RamAHB32)
*(.data.$RAM3.*)
*(.data.$RamAHB32.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM3 = .) ;
PROVIDE(__end_data_RamAHB32 = .) ;
} > RamAHB32 AT>MFlashA512
/* DATA section for RamAHB16 */
.data_RAM4 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM4 = .) ;
PROVIDE(__start_data_RamAHB16 = .) ;
*(.ramfunc.$RAM4)
*(.ramfunc.$RamAHB16)
*(.data.$RAM4)
*(.data.$RamAHB16)
*(.data.$RAM4.*)
*(.data.$RamAHB16.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM4 = .) ;
PROVIDE(__end_data_RamAHB16 = .) ;
} > RamAHB16 AT>MFlashA512
/* DATA section for RamAHB_ETB16 */
.data_RAM5 : ALIGN(4)
{
FILL(0xff)
PROVIDE(__start_data_RAM5 = .) ;
PROVIDE(__start_data_RamAHB_ETB16 = .) ;
*(.ramfunc.$RAM5)
*(.ramfunc.$RamAHB_ETB16)
*(.data.$RAM5)
*(.data.$RamAHB_ETB16)
*(.data.$RAM5.*)
*(.data.$RamAHB_ETB16.*)
. = ALIGN(4) ;
PROVIDE(__end_data_RAM5 = .) ;
PROVIDE(__end_data_RamAHB_ETB16 = .) ;
} > RamAHB_ETB16 AT>MFlashA512
/* MAIN DATA SECTION */
.uninit_RESERVED (NOLOAD) : ALIGN(4)
{
_start_uninit_RESERVED = .;
KEEP(*(.bss.$RESERVED*))
. = ALIGN(4) ;
_end_uninit_RESERVED = .;
} > RamLoc32 AT> RamLoc32
/* Main DATA section (RamLoc32) */
.data : ALIGN(4)
{
FILL(0xff)
_data = . ;
PROVIDE(__start_data_RAM = .) ;
PROVIDE(__start_data_RamLoc32 = .) ;
*(vtable)
*(.ramfunc*)
KEEP(*(CodeQuickAccess))
KEEP(*(DataQuickAccess))
*(RamFunction)
*(.data*)
. = ALIGN(4) ;
_edata = . ;
PROVIDE(__end_data_RAM = .) ;
PROVIDE(__end_data_RamLoc32 = .) ;
} > RamLoc32 AT>MFlashA512
/* BSS section for RamLoc40 */
.bss_RAM2 : ALIGN(4)
{
PROVIDE(__start_bss_RAM2 = .) ;
PROVIDE(__start_bss_RamLoc40 = .) ;
*(.bss.$RAM2)
*(.bss.$RamLoc40)
*(.bss.$RAM2.*)
*(.bss.$RamLoc40.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM2 = .) ;
PROVIDE(__end_bss_RamLoc40 = .) ;
} > RamLoc40 AT> RamLoc40
/* BSS section for RamAHB32 */
.bss_RAM3 : ALIGN(4)
{
PROVIDE(__start_bss_RAM3 = .) ;
PROVIDE(__start_bss_RamAHB32 = .) ;
*(.bss.$RAM3)
*(.bss.$RamAHB32)
*(.bss.$RAM3.*)
*(.bss.$RamAHB32.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM3 = .) ;
PROVIDE(__end_bss_RamAHB32 = .) ;
} > RamAHB32 AT> RamAHB32
/* BSS section for RamAHB16 */
.bss_RAM4 : ALIGN(4)
{
PROVIDE(__start_bss_RAM4 = .) ;
PROVIDE(__start_bss_RamAHB16 = .) ;
*(.bss.$RAM4)
*(.bss.$RamAHB16)
*(.bss.$RAM4.*)
*(.bss.$RamAHB16.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM4 = .) ;
PROVIDE(__end_bss_RamAHB16 = .) ;
} > RamAHB16 AT> RamAHB16
/* BSS section for RamAHB_ETB16 */
.bss_RAM5 : ALIGN(4)
{
PROVIDE(__start_bss_RAM5 = .) ;
PROVIDE(__start_bss_RamAHB_ETB16 = .) ;
*(.bss.$RAM5)
*(.bss.$RamAHB_ETB16)
*(.bss.$RAM5.*)
*(.bss.$RamAHB_ETB16.*)
. = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
PROVIDE(__end_bss_RAM5 = .) ;
PROVIDE(__end_bss_RamAHB_ETB16 = .) ;
} > RamAHB_ETB16 AT> RamAHB_ETB16
/* MAIN BSS SECTION */
.bss : ALIGN(4)
{
_bss = .;
PROVIDE(__start_bss_RAM = .) ;
PROVIDE(__start_bss_RamLoc32 = .) ;
*(.bss*)
*(COMMON)
. = ALIGN(4) ;
_ebss = .;
PROVIDE(__end_bss_RAM = .) ;
PROVIDE(__end_bss_RamLoc32 = .) ;
PROVIDE(end = .);
} > RamLoc32 AT> RamLoc32
/* NOINIT section for RamLoc40 */
.noinit_RAM2 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM2 = .) ;
PROVIDE(__start_noinit_RamLoc40 = .) ;
*(.noinit.$RAM2)
*(.noinit.$RamLoc40)
*(.noinit.$RAM2.*)
*(.noinit.$RamLoc40.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM2 = .) ;
PROVIDE(__end_noinit_RamLoc40 = .) ;
} > RamLoc40 AT> RamLoc40
/* NOINIT section for RamAHB32 */
.noinit_RAM3 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM3 = .) ;
PROVIDE(__start_noinit_RamAHB32 = .) ;
*(.noinit.$RAM3)
*(.noinit.$RamAHB32)
*(.noinit.$RAM3.*)
*(.noinit.$RamAHB32.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM3 = .) ;
PROVIDE(__end_noinit_RamAHB32 = .) ;
} > RamAHB32 AT> RamAHB32
/* NOINIT section for RamAHB16 */
.noinit_RAM4 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM4 = .) ;
PROVIDE(__start_noinit_RamAHB16 = .) ;
*(.noinit.$RAM4)
*(.noinit.$RamAHB16)
*(.noinit.$RAM4.*)
*(.noinit.$RamAHB16.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM4 = .) ;
PROVIDE(__end_noinit_RamAHB16 = .) ;
} > RamAHB16 AT> RamAHB16
/* NOINIT section for RamAHB_ETB16 */
.noinit_RAM5 (NOLOAD) : ALIGN(4)
{
PROVIDE(__start_noinit_RAM5 = .) ;
PROVIDE(__start_noinit_RamAHB_ETB16 = .) ;
*(.noinit.$RAM5)
*(.noinit.$RamAHB_ETB16)
*(.noinit.$RAM5.*)
*(.noinit.$RamAHB_ETB16.*)
. = ALIGN(4) ;
PROVIDE(__end_noinit_RAM5 = .) ;
PROVIDE(__end_noinit_RamAHB_ETB16 = .) ;
} > RamAHB_ETB16 AT> RamAHB_ETB16
/* DEFAULT NOINIT SECTION */
.noinit (NOLOAD): ALIGN(4)
{
_noinit = .;
PROVIDE(__start_noinit_RAM = .) ;
PROVIDE(__start_noinit_RamLoc32 = .) ;
*(.noinit*)
. = ALIGN(4) ;
_end_noinit = .;
PROVIDE(__end_noinit_RAM = .) ;
PROVIDE(__end_noinit_RamLoc32 = .) ;
} > RamLoc32 AT> RamLoc32
PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
/* ## Create checksum value (used in startup) ## */
PROVIDE(__valid_user_code_checksum = 0 -
(_vStackTop
+ (ResetISR + 1)
+ (NMI_Handler + 1)
+ (HardFault_Handler + 1)
+ (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
+ (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
+ (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
) );
/* Provide basic symbols giving location and size of main text
* block, including initial values of RW data sections. Note that
* these will need extending to give a complete picture with
* complex images (e.g multiple Flash banks).
*/
_image_start = LOADADDR(.text);
_image_end = LOADADDR(.data) + SIZEOF(.data);
_image_size = _image_end - _image_start;
}

View File

@ -0,0 +1,94 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021, Ha Thach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#ifndef BOARD_H_
#define BOARD_H_
#ifdef __cplusplus
extern "C" {
#endif
// PD_10
#define LED_PORT 6
#define LED_PIN 24
// P4_0
#define BUTTON_PORT 2
#define BUTTON_PIN 0
#define UART_DEV LPC_USART3
static inline void board_lpc18_pinmux(void)
{
const PINMUX_GRP_T pinmuxing[] =
{
// LEDs
{ 0xD, 10, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4) },
{ 0xD, 11, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0xD, 12, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0xD, 13, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0xD, 14, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0x9, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
{ 0x9, 1, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
{ 0x9, 2, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
// Button
{ 0x4, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLUP) },
// UART
{ 2, 3, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 },
{ 2, 4, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 },
// USB0
{ 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function
{ 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function
{ 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION
};
Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
/* Pin clock mux values, re-used structure, value in first index is meaningless */
const PINMUX_GRP_T pinclockmuxing[] =
{
{ 0, 0, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{ 0, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{ 0, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{ 0, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
};
/* Clock pins only, group field not used */
for (uint32_t i = 0; i < (sizeof(pinclockmuxing) / sizeof(pinclockmuxing[0])); i++)
{
Chip_SCU_ClockPinMuxSet(pinclockmuxing[i].pinnum, pinclockmuxing[i].modefunc);
}
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,7 @@
LD_FILE = $(BOARD_PATH)/lpc1857.ld
# For flash-jlink target
JLINK_DEVICE = LPC1857
# flash using jlink
flash: flash-jlink

View File

@ -20,35 +20,35 @@ MEMORY
RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */
}
/* Define a symbol for the top of each memory region */
__base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */
__base_Flash = 0x1a000000 ; /* Flash */
__top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */
__top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */
__base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */
__base_Flash2 = 0x1b000000 ; /* Flash2 */
__top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */
__top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */
__base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
__base_RAM = 0x10000000 ; /* RAM */
__top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
__top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
__base_RamLoc40 = 0x10080000 ; /* RamLoc40 */
__base_RAM2 = 0x10080000 ; /* RAM2 */
__top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */
__top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */
__base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
__base_RAM3 = 0x20000000 ; /* RAM3 */
__top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
__top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
__base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
__base_RAM4 = 0x20008000 ; /* RAM4 */
__top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
__top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
__base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
__base_RAM5 = 0x2000c000 ; /* RAM5 */
__top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
__top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
/* Define a symbol for the top of each memory region */
__base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */
__base_Flash = 0x1a000000 ; /* Flash */
__top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */
__top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */
__base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */
__base_Flash2 = 0x1b000000 ; /* Flash2 */
__top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */
__top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */
__base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
__base_RAM = 0x10000000 ; /* RAM */
__top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
__top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
__base_RamLoc40 = 0x10080000 ; /* RamLoc40 */
__base_RAM2 = 0x10080000 ; /* RAM2 */
__top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */
__top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */
__base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
__base_RAM3 = 0x20000000 ; /* RAM3 */
__top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
__top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
__base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
__base_RAM4 = 0x20008000 ; /* RAM4 */
__top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
__top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
__base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
__base_RAM5 = 0x2000c000 ; /* RAM5 */
__top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
__top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
ENTRY(ResetISR)

View File

@ -25,7 +25,8 @@
*/
#include "chip.h"
#include "../board.h"
#include "bsp/board.h"
#include "board.h"
//--------------------------------------------------------------------+
// USB Interrupt Handler
@ -56,59 +57,11 @@ void USB1_IRQHandler(void)
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
//--------------------------------------------------------------------+
// PD_10
#define LED_PORT 6
#define LED_PIN 24
// P4_0
#define BUTTON_PORT 2
#define BUTTON_PIN 0
#define UART_DEV LPC_USART3
#define UART_PORT 0x02
#define UART_PIN_TX 3
#define UART_PIN_RX 4
/* System configuration variables used by chip driver */
const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;
static const PINMUX_GRP_T pinmuxing[] =
{
// LEDs
{ 0xD, 10, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4) },
{ 0xD, 11, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0xD, 12, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0xD, 13, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0xD, 14, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
{ 0x9, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
{ 0x9, 1, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
{ 0x9, 2, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
// Button
{ 0x4, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLUP) },
// UART
{ UART_PORT, UART_PIN_TX, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 },
{ UART_PORT, UART_PIN_RX, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 },
// USB0
{ 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function
{ 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function
{ 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION
};
/* Pin clock mux values, re-used structure, value in first index is meaningless */
static const PINMUX_GRP_T pinclockmuxing[] =
{
{ 0, 0, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{ 0, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{ 0, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{ 0, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
};
// Invoked by startup code
void SystemInit(void)
{
@ -118,15 +71,7 @@ void SystemInit(void)
*pSCB_VTOR = (unsigned int) g_pfnVectors;
#endif
/* Setup system level pin muxing */
Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
/* Clock pins only, group field not used */
for (uint32_t i = 0; i < (sizeof(pinclockmuxing) / sizeof(pinclockmuxing[0])); i++)
{
Chip_SCU_ClockPinMuxSet(pinclockmuxing[i].pinnum, pinclockmuxing[i].modefunc);
}
board_lpc18_pinmux();
Chip_SetupXtalClocking();
}

View File

@ -1,3 +1,7 @@
DEPS_SUBMODULES = hw/mcu/nxp
include $(TOP)/$(BOARD_PATH)/board.mk
CFLAGS += \
-flto \
-mthumb \
@ -13,9 +17,6 @@ CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes
MCU_DIR = hw/mcu/nxp/lpcopen/lpc18xx/lpc_chip_18xx
# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/lpc1857.ld
SRC_C += \
$(MCU_DIR)/../gcc/cr_startup_lpc18xx.c \
$(MCU_DIR)/src/chip_18xx_43xx.c \
@ -25,6 +26,7 @@ SRC_C += \
$(MCU_DIR)/src/uart_18xx_43xx.c
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/$(MCU_DIR)/inc \
$(TOP)/$(MCU_DIR)/inc/config_18xx
@ -34,9 +36,3 @@ CHIP_FAMILY = transdimension
# For freeRTOS port source
FREERTOS_PORT = ARM_CM3
# For flash-jlink target
JLINK_DEVICE = LPC1857
# flash using jlink
flash: flash-jlink

View File

@ -0,0 +1,60 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021, Ha Thach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#ifndef BOARD_H_
#define BOARD_H_
#ifdef __cplusplus
extern "C" {
#endif
// LED
#define LED_PORT 0
#define LED_PIN 1
#define LED_STATE_ON 1
// WAKE button
#define BUTTON_PORT 0
#define BUTTON_PIN 5
#define BUTTON_STATE_ACTIVE 0
// Number of neopixels
#define NEOPIXEL_NUMBER 2
#define NEOPIXEL_PORT 0
#define NEOPIXEL_PIN 27
#define NEOPIXEL_CH 6
#define NEOPIXEL_TYPE 0
// UART
#define UART_DEV USART0
#define UART_RX_PINMUX 0U, 29U, IOCON_PIO_DIG_FUNC1_EN
#define UART_TX_PINMUX 0U, 30U, IOCON_PIO_DIG_FUNC1_EN
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,11 @@
MCU_VARIANT = LPC55S69
MCU_CORE = LPC55S69_cm33_core0
CFLAGS += -DCPU_LPC55S69JBD100_cm33_core0
LD_FILE = $(BOARD_PATH)/LPC55S69_cm33_core0_uf2.ld
JLINK_DEVICE = LPC55S69
PYOCD_TARGET = LPC55S69
# flash using pyocd
flash: flash-pyocd

View File

@ -0,0 +1,53 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021, Ha Thach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#ifndef BOARD_H_
#define BOARD_H_
#ifdef __cplusplus
extern "C" {
#endif
// LED
#define LED_PORT 1
#define LED_PIN 6
#define LED_STATE_ON 0
// WAKE button
#define BUTTON_PORT 1
#define BUTTON_PIN 18
#define BUTTON_STATE_ACTIVE 0
// UART
//#define UART_DEV USART0
//#define UART_RX_PINMUX 0U, 29U, IOCON_PIO_DIG_FUNC1_EN
//#define UART_TX_PINMUX 0U, 30U, IOCON_PIO_DIG_FUNC1_EN
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,10 @@
MCU_VARIANT = LPC55S28
MCU_CORE = LPC55S28
CFLAGS += -DCPU_LPC55S28JBD100
JLINK_DEVICE = LPC55S28
PYOCD_TARGET = LPC55S28
# flash using pyocd
flash: flash-pyocd

View File

@ -0,0 +1,53 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021, Ha Thach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#ifndef BOARD_H_
#define BOARD_H_
#ifdef __cplusplus
extern "C" {
#endif
// LED
#define LED_PORT 1
#define LED_PIN 6
#define LED_STATE_ON 0
// WAKE button
#define BUTTON_PORT 1
#define BUTTON_PIN 18
#define BUTTON_STATE_ACTIVE 0
// UART
//#define UART_DEV USART0
//#define UART_RX_PINMUX 0U, 29U, IOCON_PIO_DIG_FUNC1_EN
//#define UART_TX_PINMUX 0U, 30U, IOCON_PIO_DIG_FUNC1_EN
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,10 @@
MCU_VARIANT = LPC55S69
MCU_CORE = LPC55S69_cm33_core0
CFLAGS += -DCPU_LPC55S69JBD100_cm33_core0
JLINK_DEVICE = LPC55S69
PYOCD_TARGET = LPC55S69
# flash using pyocd
flash: flash-pyocd

View File

@ -24,7 +24,8 @@
* This file is part of the TinyUSB stack.
*/
#include "../board.h"
#include "bsp/board.h"
#include "board.h"
#include "fsl_device_registers.h"
#include "fsl_gpio.h"
#include "fsl_power.h"
@ -49,45 +50,23 @@ void USB1_IRQHandler(void)
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM
//--------------------------------------------------------------------+
#define LED_PORT 0
#define LED_PIN 1
#define LED_STATE_ON 1
// WAKE button
#define BUTTON_PORT 0
#define BUTTON_PIN 5
#define BUTTON_STATE_ACTIVE 0
// Number of neopixels
#define NEOPIXEL_NUMBER 2
#define NEOPIXEL_PORT 0
#define NEOPIXEL_PIN 27
#define NEOPIXEL_CH 6
#define NEOPIXEL_TYPE 0
// UART
#define UART_DEV USART0
// IOCON pin mux
#define IOCON_PIO_DIGITAL_EN 0x0100u /*!<@brief Enables digital function */
#define IOCON_PIO_FUNC0 0x00u /*!<@brief Selects pin function 0 */
#define IOCON_PIO_FUNC1 0x01u /*!<@brief Selects pin function 1 */
#define IOCON_PIO_FUNC4 0x04u /*!<@brief Selects pin function 4 */
#define IOCON_PIO_FUNC7 0x07u /*!<@brief Selects pin function 7 */
#define IOCON_PIO_INV_DI 0x00u /*!<@brief Input function is not inverted */
#define IOCON_PIO_MODE_INACT 0x00u /*!<@brief No addition pin function */
#define IOCON_PIO_OPENDRAIN_DI 0x00u /*!<@brief Open drain is disabled */
#define IOCON_PIO_SLEW_STANDARD 0x00u /*!<@brief Standard mode, output slew rate control is enabled */
#define IOCON_PIO_DIGITAL_EN 0x0100u /*!<@brief Enables digital function */
#define IOCON_PIO_FUNC0 0x00u /*!<@brief Selects pin function 0 */
#define IOCON_PIO_FUNC1 0x01u /*!<@brief Selects pin function 1 */
#define IOCON_PIO_FUNC4 0x04u /*!<@brief Selects pin function 4 */
#define IOCON_PIO_FUNC7 0x07u /*!<@brief Selects pin function 7 */
#define IOCON_PIO_INV_DI 0x00u /*!<@brief Input function is not inverted */
#define IOCON_PIO_MODE_INACT 0x00u /*!<@brief No addition pin function */
#define IOCON_PIO_OPENDRAIN_DI 0x00u /*!<@brief Open drain is disabled */
#define IOCON_PIO_SLEW_STANDARD 0x00u /*!<@brief Standard mode, output slew rate control is enabled */
#define IOCON_PIO_DIG_FUNC0_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC0) /*!<@brief Digital pin function 0 enabled */
#define IOCON_PIO_DIG_FUNC1_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC1) /*!<@brief Digital pin function 1 enabled */
#define IOCON_PIO_DIG_FUNC4_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC4) /*!<@brief Digital pin function 2 enabled */
#define IOCON_PIO_DIG_FUNC7_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC7) /*!<@brief Digital pin function 2 enabled */
// Global Variables
uint32_t pixelData[NEOPIXEL_NUMBER];
/****************************************************************
name: BOARD_BootClockFROHF96M
outputs:
@ -138,18 +117,20 @@ void board_init(void)
NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
#endif
// Init all GPIO ports
GPIO_PortInit(GPIO, 0);
GPIO_PortInit(GPIO, 1);
// LED
/* PORT0 PIN1 configured as PIO0_1 */
IOCON_PinMuxSet(IOCON, 0U, 1U, IOCON_PIO_DIG_FUNC0_EN);
IOCON_PinMuxSet(IOCON, LED_PORT, LED_PIN, IOCON_PIO_DIG_FUNC0_EN);
gpio_pin_config_t const led_config = { kGPIO_DigitalOutput, 1};
GPIO_PinInit(GPIO, LED_PORT, LED_PIN, &led_config);
board_led_write(0);
#ifdef NEOPIXEL_PIN
// Neopixel
/* PORT0 PIN27 configured as SCT0_OUT6 */
static uint32_t pixelData[NEOPIXEL_NUMBER];
IOCON_PinMuxSet(IOCON, NEOPIXEL_PORT, NEOPIXEL_PIN, IOCON_PIO_DIG_FUNC4_EN);
sctpix_init(NEOPIXEL_TYPE);
@ -157,22 +138,18 @@ void board_init(void)
sctpix_setPixel(NEOPIXEL_CH, 0, 0x100010);
sctpix_setPixel(NEOPIXEL_CH, 1, 0x100010);
sctpix_show();
#endif
// Button
/* PORT0 PIN5 configured as PIO0_5 */
IOCON_PinMuxSet(IOCON, BUTTON_PORT, BUTTON_PIN, IOCON_PIO_DIG_FUNC0_EN);
gpio_pin_config_t const button_config = { kGPIO_DigitalInput, 0};
GPIO_PinInit(GPIO, BUTTON_PORT, BUTTON_PIN, &button_config);
#if defined(UART_DEV)
// UART
/* PORT0 PIN29 (coords: 92) is configured as FC0_RXD_SDA_MOSI_DATA */
IOCON_PinMuxSet(IOCON, 0U, 29U, IOCON_PIO_DIG_FUNC1_EN);
/* PORT0 PIN30 (coords: 94) is configured as FC0_TXD_SCL_MISO_WS */
IOCON_PinMuxSet(IOCON, 0U, 30U, IOCON_PIO_DIG_FUNC1_EN);
IOCON_PinMuxSet(IOCON, UART_RX_PINMUX);
IOCON_PinMuxSet(IOCON, UART_TX_PINMUX);
#if defined(UART_DEV) && CFG_TUSB_DEBUG
// Enable UART when debug log is on
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0);
usart_config_t uart_config;
@ -200,7 +177,7 @@ void board_init(void)
RESET_PeripheralReset(kUSB1_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSB1RAM_RST_SHIFT_RSTn);
#if (defined CFG_TUSB_RHPORT1_MODE) && (CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE)
#if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
CLOCK_EnableClock(kCLOCK_Usbh1);
/* Put PHY powerdown under software control */
USBHSH->PORTMODE = USBHSH_PORTMODE_SW_PDCOM_MASK;
@ -210,7 +187,7 @@ void board_init(void)
CLOCK_DisableClock(kCLOCK_Usbh1);
#endif
#if (defined CFG_TUSB_RHPORT0_MODE) && (CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE)
#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
// Enable USB Clock Adjustments to trim the FRO for the full speed controller
ANACTRL->FRO192M_CTRL |= ANACTRL_FRO192M_CTRL_USBCLKADJ_MASK;
CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);
@ -233,6 +210,8 @@ void board_init(void)
void board_led_write(bool state)
{
GPIO_PinWrite(GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
#ifdef NEOPIXEL_PIN
if (state) {
sctpix_setPixel(NEOPIXEL_CH, 0, 0x100000);
sctpix_setPixel(NEOPIXEL_CH, 1, 0x101010);
@ -241,6 +220,7 @@ void board_led_write(bool state)
sctpix_setPixel(NEOPIXEL_CH, 1, 0x000010);
}
sctpix_show();
#endif
}
uint32_t board_button_read(void)

View File

@ -1,3 +1,11 @@
UF2_FAMILY_ID = 0x2abc77ec
DEPS_SUBMODULES = lib/sct_neopixel hw/mcu/nxp
include $(TOP)/$(BOARD_PATH)/board.mk
# TODO change Default to Highspeed PORT1
PORT ?= 0
CFLAGS += \
-flto \
-mthumb \
@ -5,38 +13,44 @@ CFLAGS += \
-mcpu=cortex-m33 \
-mfloat-abi=hard \
-mfpu=fpv5-sp-d16 \
-DCPU_LPC55S69JBD100_cm33_core0 \
-DCFG_TUSB_MCU=OPT_MCU_LPC55XX \
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data")))' \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
-DBOARD_DEVICE_RHPORT_NUM=$(PORT)
ifeq ($(PORT), 1)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "PORT1 High Speed")
else
$(info "PORT0 Full Speed")
endif
# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal
MCU_DIR = hw/mcu/nxp/sdk/devices/LPC55S69
MCU_DIR = hw/mcu/nxp/sdk/devices/$(MCU_VARIANT)
# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/LPC55S69_cm33_core0_uf2.ld
LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld
SRC_C += \
$(MCU_DIR)/system_LPC55S69_cm33_core0.c \
$(MCU_DIR)/system_$(MCU_CORE).c \
$(MCU_DIR)/drivers/fsl_clock.c \
$(MCU_DIR)/drivers/fsl_gpio.c \
$(MCU_DIR)/drivers/fsl_power.c \
$(MCU_DIR)/drivers/fsl_reset.c \
$(MCU_DIR)/drivers/fsl_usart.c \
$(MCU_DIR)/drivers/fsl_flexcomm.c \
lib/sct_neopixel/sct_neopixel.c
lib/sct_neopixel/sct_neopixel.c
INC += \
$(TOP)/hw/bsp/ \
$(TOP)/hw/bsp/$(BOARD) \
$(TOP)/$(BOARD_PATH) \
$(TOP)/lib/sct_neopixel \
$(TOP)/$(MCU_DIR)/../../CMSIS/Include \
$(TOP)/$(MCU_DIR) \
$(TOP)/$(MCU_DIR)/drivers
SRC_S += $(MCU_DIR)/gcc/startup_LPC55S69_cm33_core0.S
SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_hardabi.a
@ -46,10 +60,3 @@ CHIP_FAMILY = lpc_ip3511
# For freeRTOS port source
FREERTOS_PORT = ARM_CM33_NTZ/non_secure
# For flash-jlink target
JLINK_DEVICE = LPC55S69
# flash using pyocd
flash: $(BUILD)/$(PROJECT).hex
pyocd flash -t LPC55S69 $<

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,49 +0,0 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m33 \
-mfloat-abi=hard \
-mfpu=fpv5-sp-d16 \
-DCPU_LPC55S69JBD100_cm33_core0 \
-DCFG_TUSB_MCU=OPT_MCU_LPC55XX \
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data")))' \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal
MCU_DIR = hw/mcu/nxp/sdk/devices/LPC55S69
# All source paths should be relative to the top level.
LD_FILE = $(MCU_DIR)/gcc/LPC55S69_cm33_core0_flash.ld
SRC_C += \
$(MCU_DIR)/system_LPC55S69_cm33_core0.c \
$(MCU_DIR)/drivers/fsl_clock.c \
$(MCU_DIR)/drivers/fsl_gpio.c \
$(MCU_DIR)/drivers/fsl_power.c \
$(MCU_DIR)/drivers/fsl_reset.c
INC += \
$(TOP)/$(MCU_DIR)/../../CMSIS/Include \
$(TOP)/$(MCU_DIR) \
$(TOP)/$(MCU_DIR)/drivers
SRC_S += $(MCU_DIR)/gcc/startup_LPC55S69_cm33_core0.S
LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_hardabi.a
# For TinyUSB port source
VENDOR = nxp
CHIP_FAMILY = lpc_ip3511
# For freeRTOS port source
FREERTOS_PORT = ARM_CM33_NTZ/non_secure
# For flash-jlink target
JLINK_DEVICE = LPC55S69
# flash using pyocd
flash: $(BUILD)/$(PROJECT).hex
pyocd flash -t LPC55S69 $<

View File

@ -1,227 +0,0 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2018, hathach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#include "../board.h"
#include "fsl_device_registers.h"
#include "fsl_gpio.h"
#include "fsl_power.h"
#include "fsl_iocon.h"
//--------------------------------------------------------------------+
// Forward USB interrupt events to TinyUSB IRQ Handler
//--------------------------------------------------------------------+
void USB0_IRQHandler(void)
{
tud_int_handler(0);
}
void USB1_IRQHandler(void)
{
tud_int_handler(1);
}
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM
//--------------------------------------------------------------------+
#define LED_PORT 1
#define LED_PIN 6
#define LED_STATE_ON 0
// WAKE button
#define BUTTON_PORT 1
#define BUTTON_PIN 18
#define BUTTON_STATE_ACTIVE 0
// IOCON pin mux
#define IOCON_PIO_DIGITAL_EN 0x0100u /*!<@brief Enables digital function */
#define IOCON_PIO_FUNC0 0x00u /*!<@brief Selects pin function 0 */
#define IOCON_PIO_FUNC1 0x01u /*!<@brief Selects pin function 1 */
#define IOCON_PIO_FUNC7 0x07u /*!<@brief Selects pin function 7 */
#define IOCON_PIO_INV_DI 0x00u /*!<@brief Input function is not inverted */
#define IOCON_PIO_MODE_INACT 0x00u /*!<@brief No addition pin function */
#define IOCON_PIO_OPENDRAIN_DI 0x00u /*!<@brief Open drain is disabled */
#define IOCON_PIO_SLEW_STANDARD 0x00u /*!<@brief Standard mode, output slew rate control is enabled */
/****************************************************************
name: BOARD_BootClockFROHF96M
outputs:
- {id: SYSTICK_clock.outFreq, value: 96 MHz}
- {id: System_clock.outFreq, value: 96 MHz}
settings:
- {id: SYSCON.MAINCLKSELA.sel, value: SYSCON.fro_hf}
sources:
- {id: SYSCON.fro_hf.outFreq, value: 96 MHz}
******************************************************************/
void BootClockFROHF96M(void)
{
/*!< Set up the clock sources */
/*!< Set up FRO */
POWER_DisablePD(kPDRUNCFG_PD_FRO192M); /*!< Ensure FRO is on */
CLOCK_SetupFROClocking(12000000U); /*!< Set up FRO to the 12 MHz, just for sure */
CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change voltage without
accidentally being below the voltage for current speed */
CLOCK_SetupFROClocking(96000000U); /*!< Set up high frequency FRO output to selected frequency */
POWER_SetVoltageForFreq(96000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
CLOCK_SetFLASHAccessCyclesForFreq(96000000U); /*!< Set FLASH wait states for core */
/*!< Set up dividers */
CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
/*!< Set up clock selectors - Attach clocks to the peripheries */
CLOCK_AttachClk(kFRO_HF_to_MAIN_CLK); /*!< Switch MAIN_CLK to FRO_HF */
/*!< Set SystemCoreClock variable. */
SystemCoreClock = 96000000U;
}
void board_init(void)
{
// Enable IOCON clock
CLOCK_EnableClock(kCLOCK_Iocon);
// Init 96 MHz clock
BootClockFROHF96M();
#if CFG_TUSB_OS == OPT_OS_NONE
// 1ms tick timer
SysTick_Config(SystemCoreClock / 1000);
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
#endif
GPIO_PortInit(GPIO, LED_PORT);
GPIO_PortInit(GPIO, BUTTON_PORT);
// LED
gpio_pin_config_t const led_config = { kGPIO_DigitalOutput, 0};
GPIO_PinInit(GPIO, LED_PORT, LED_PIN, &led_config);
board_led_write(true);
// Button
const uint32_t port1_pin18_config = (
IOCON_PIO_FUNC0 | /* Pin is configured as PIO1_18 */
IOCON_PIO_MODE_INACT | /* No addition pin function */
IOCON_PIO_SLEW_STANDARD | /* Standard mode, output slew rate control is enabled */
IOCON_PIO_INV_DI | /* Input function is not inverted */
IOCON_PIO_DIGITAL_EN | /* Enables digital function */
IOCON_PIO_OPENDRAIN_DI /* Open drain is disabled */
);
/* PORT1 PIN18 (coords: 64) is configured as PIO1_18 */
IOCON_PinMuxSet(IOCON, 1U, 18U, port1_pin18_config);
gpio_pin_config_t const button_config = { kGPIO_DigitalInput, 0};
GPIO_PinInit(GPIO, BUTTON_PORT, BUTTON_PIN, &button_config);
// USB VBUS
const uint32_t port0_pin22_config = (
IOCON_PIO_FUNC7 | /* Pin is configured as USB0_VBUS */
IOCON_PIO_MODE_INACT | /* No addition pin function */
IOCON_PIO_SLEW_STANDARD | /* Standard mode, output slew rate control is enabled */
IOCON_PIO_INV_DI | /* Input function is not inverted */
IOCON_PIO_DIGITAL_EN | /* Enables digital function */
IOCON_PIO_OPENDRAIN_DI /* Open drain is disabled */
);
/* PORT0 PIN22 (coords: 78) is configured as USB0_VBUS */
IOCON_PinMuxSet(IOCON, 0U, 22U, port0_pin22_config);
// USB Controller
POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*Turn on USB0 Phy */
POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY); /*< Turn on USB1 Phy */
/* reset the IP to make sure it's in reset state. */
RESET_PeripheralReset(kUSB0D_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSB0HSL_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSB0HMR_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSB1H_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSB1D_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSB1_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSB1RAM_RST_SHIFT_RSTn);
#if (defined USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS)
CLOCK_EnableClock(kCLOCK_Usbh1);
/* Put PHY powerdown under software control */
*((uint32_t *)(USBHSH_BASE + 0x50)) = USBHSH_PORTMODE_SW_PDCOM_MASK;
/* According to reference mannual, device mode setting has to be set by access usb host register */
*((uint32_t *)(USBHSH_BASE + 0x50)) |= USBHSH_PORTMODE_DEV_ENABLE_MASK;
/* enable usb1 host clock */
CLOCK_DisableClock(kCLOCK_Usbh1);
#endif
#if 1 || (defined USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS)
CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);
CLOCK_AttachClk(kFRO_HF_to_USB0_CLK);
/* enable usb0 host clock */
CLOCK_EnableClock(kCLOCK_Usbhsl0);
/*According to reference mannual, device mode setting has to be set by access usb host register */
*((uint32_t *)(USBFSH_BASE + 0x5C)) |= USBFSH_PORTMODE_DEV_ENABLE_MASK;
/* disable usb0 host clock */
CLOCK_DisableClock(kCLOCK_Usbhsl0);
CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbfsSrcFro, CLOCK_GetFreq(kCLOCK_FroHf)); /* enable USB Device clock */
#endif
}
//--------------------------------------------------------------------+
// Board porting API
//--------------------------------------------------------------------+
void board_led_write(bool state)
{
GPIO_PinWrite(GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
}
uint32_t board_button_read(void)
{
// active low
return BUTTON_STATE_ACTIVE == GPIO_PinRead(GPIO, BUTTON_PORT, BUTTON_PIN);
}
int board_uart_read(uint8_t* buf, int len)
{
(void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
(void) buf; (void) len;
return 0;
}
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler(void)
{
system_ticks++;
}
uint32_t board_millis(void)
{
return system_ticks;
}
#endif

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -0,0 +1,46 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021, Ha Thach (tinyusb.org)
*
* 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.
*
* 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.
*
* This file is part of the TinyUSB stack.
*/
#ifndef BOARD_H_
#define BOARD_H_
#ifdef __cplusplus
extern "C" {
#endif
#define LED_PORT P1OUT
#define LED_PIN BIT0
#define LED_STATE_ON 1
#define BUTTON_PORT P1IN
#define BUTTON_PIN BIT1
#define BUTTON_STATE_ACTIVE 0
#ifdef __cplusplus
}
#endif
#endif

View File

@ -24,8 +24,8 @@
* This file is part of the TinyUSB stack.
*/
#include "../board.h"
#include "bsp/board.h"
#include "board.h"
#include "msp430.h"
//--------------------------------------------------------------------+
@ -39,13 +39,6 @@ void __attribute__ ((interrupt(USB_UBM_VECTOR))) USB_UBM_ISR(void)
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM
//--------------------------------------------------------------------+
#define LED_PORT P1OUT
#define LED_PIN BIT0
#define LED_STATE_ON 1
#define BUTTON_PORT P1IN
#define BUTTON_PIN BIT1
#define BUTTON_STATE_ACTIVE 0
uint32_t cnt = 0;

View File

@ -1,3 +1,7 @@
CROSS_COMPILE = msp430-elf-
DEPS_SUBMODULES = hw/mcu/ti
SKIP_NANOLIB = 1
CFLAGS += \
-D__MSP430F5529__ \
-DCFG_TUSB_MCU=OPT_MCU_MSP430x5xx \
@ -6,15 +10,16 @@ CFLAGS += \
#-mmcu=msp430f5529
# Cross Compiler for MSP430
CROSS_COMPILE = msp430-elf-
# All source paths should be relative to the top level.
LD_FILE = hw/mcu/ti/msp430/msp430-gcc-support-files/include/msp430f5529.ld
LDINC += $(TOP)/hw/mcu/ti/msp430/msp430-gcc-support-files/include
LDFLAGS += $(addprefix -L,$(LDINC))
INC += $(TOP)/hw/mcu/ti/msp430/msp430-gcc-support-files/include
INC += \
$(TOP)/hw/mcu/ti/msp430/msp430-gcc-support-files/include \
$(TOP)/$(BOARD_PATH)
# For TinyUSB port source
VENDOR = ti

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nxp
CFLAGS += \
-flto \
-mthumb \

View File

@ -25,7 +25,6 @@
*/
#include "bsp/board.h"
#include "board.h"
#include "nrfx.h"

View File

@ -1,4 +1,5 @@
UF2_FAMILY_ID = 0xADA52840
DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/nordic/nrfx
include $(TOP)/$(BOARD_PATH)/board.mk
@ -39,7 +40,7 @@ SRC_C += \
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/lib/CMSIS_4/CMSIS/Include \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
$(TOP)/hw/mcu/nordic \
$(TOP)/hw/mcu/nordic/nrfx \
$(TOP)/hw/mcu/nordic/nrfx/mdk \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nuvoton
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nuvoton
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nuvoton
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nuvoton
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/nuvoton
CFLAGS += \
-flto \
-mthumb \

View File

@ -78,7 +78,10 @@ bool __no_inline_not_in_flash_func(get_bootsel_button)() {
//------------- Segger RTT retarget -------------//
#if defined(LOGGER_RTT)
// Logging with RTT
// - If RTT Control Block is not found by 'Auto Detection` try to use 'Search Range` with '0x20000000 0x10000'
// - SWD speed is rather slow around 1000Khz
#include "pico/stdio/driver.h"
#include "SEGGER_RTT.h"

View File

@ -1,3 +1,12 @@
target_link_libraries(${PROJECT}
pico_stdlib
pico_bootsel_via_double_reset
pico_fix_rp2040_usb_device_enumeration
)
pico_add_extra_outputs(${PROJECT})
pico_enable_stdio_uart(${PROJECT} 1)
# TinyUSB Stack source
set(SRC_TINYUSB
${TOP}/src/tusb.c
@ -13,8 +22,15 @@ set(SRC_TINYUSB
${TOP}/src/class/net/net_device.c
${TOP}/src/class/usbtmc/usbtmc_device.c
${TOP}/src/class/vendor/vendor_device.c
${TOP}/src/portable/raspberrypi/${FAMILY}/dcd_rp2040.c
${TOP}/src/host/hub.c
${TOP}/src/host/usbh.c
${TOP}/src/host/usbh_control.c
${TOP}/src/class/cdc/cdc_host.c
${TOP}/src/class/hid/hid_host.c
${TOP}/src/class/msc/msc_host.c
${TOP}/src/portable/raspberrypi/${FAMILY}/rp2040_usb.c
${TOP}/src/portable/raspberrypi/${FAMILY}/dcd_rp2040.c
${TOP}/src/portable/raspberrypi/${FAMILY}/hcd_rp2040.c
)
target_sources(${PROJECT} PUBLIC
@ -35,12 +51,9 @@ target_compile_definitions(${PROJECT} PUBLIC
if(DEFINED LOG)
target_compile_definitions(${PROJECT} PUBLIC CFG_TUSB_DEBUG=${LOG} )
pico_enable_stdio_uart(${PROJECT} 1)
endif()
if(LOGGER STREQUAL "rtt")
pico_enable_stdio_uart(${PROJECT} 0)
target_compile_definitions(${PROJECT} PUBLIC
LOGGER_RTT
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL

4
hw/bsp/rp2040/family.mk Normal file
View File

@ -0,0 +1,4 @@
DEPS_SUBMODULES = hw/mcu/raspberrypi/pico-sdk
JLINK_DEVICE = rp2040_m0_0
PYOCD_TARGET = rp2040

View File

@ -1,3 +1,4 @@
DEPS_SUBMODULES = hw/mcu/microchip
include $(TOP)/$(BOARD_PATH)/board.mk

View File

@ -1,4 +1,5 @@
UF2_FAMILY_ID = 0x68ed2b88
DEPS_SUBMODULES = hw/mcu/microchip
include $(TOP)/$(BOARD_PATH)/board.mk
@ -12,24 +13,24 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
SRC_C += \
hw/mcu/microchip/asf4/samd21/gcc/gcc/startup_samd21.c \
hw/mcu/microchip/asf4/samd21/gcc/system_samd21.c \
hw/mcu/microchip/asf4/samd21/hpl/gclk/hpl_gclk.c \
hw/mcu/microchip/asf4/samd21/hpl/pm/hpl_pm.c \
hw/mcu/microchip/asf4/samd21/hpl/sysctrl/hpl_sysctrl.c \
hw/mcu/microchip/asf4/samd21/hal/src/hal_atomic.c
hw/mcu/microchip/samd21/gcc/gcc/startup_samd21.c \
hw/mcu/microchip/samd21/gcc/system_samd21.c \
hw/mcu/microchip/samd21/hpl/gclk/hpl_gclk.c \
hw/mcu/microchip/samd21/hpl/pm/hpl_pm.c \
hw/mcu/microchip/samd21/hpl/sysctrl/hpl_sysctrl.c \
hw/mcu/microchip/samd21/hal/src/hal_atomic.c
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/hw/mcu/microchip/asf4/samd21/ \
$(TOP)/hw/mcu/microchip/asf4/samd21/config \
$(TOP)/hw/mcu/microchip/asf4/samd21/include \
$(TOP)/hw/mcu/microchip/asf4/samd21/hal/include \
$(TOP)/hw/mcu/microchip/asf4/samd21/hal/utils/include \
$(TOP)/hw/mcu/microchip/asf4/samd21/hpl/pm/ \
$(TOP)/hw/mcu/microchip/asf4/samd21/hpl/port \
$(TOP)/hw/mcu/microchip/asf4/samd21/hri \
$(TOP)/hw/mcu/microchip/asf4/samd21/CMSIS/Include
$(TOP)/hw/mcu/microchip/samd21/ \
$(TOP)/hw/mcu/microchip/samd21/config \
$(TOP)/hw/mcu/microchip/samd21/include \
$(TOP)/hw/mcu/microchip/samd21/hal/include \
$(TOP)/hw/mcu/microchip/samd21/hal/utils/include \
$(TOP)/hw/mcu/microchip/samd21/hpl/pm/ \
$(TOP)/hw/mcu/microchip/samd21/hpl/port \
$(TOP)/hw/mcu/microchip/samd21/hri \
$(TOP)/hw/mcu/microchip/samd21/CMSIS/Include
# For TinyUSB port source
VENDOR = microchip

View File

@ -1,4 +1,5 @@
UF2_FAMILY_ID = 0x55114460
DEPS_SUBMODULES = hw/mcu/microchip
include $(TOP)/$(BOARD_PATH)/board.mk
@ -15,24 +16,24 @@ CFLAGS += \
CFLAGS += -Wno-error=undef
SRC_C += \
hw/mcu/microchip/asf4/samd51/gcc/gcc/startup_samd51.c \
hw/mcu/microchip/asf4/samd51/gcc/system_samd51.c \
hw/mcu/microchip/asf4/samd51/hpl/gclk/hpl_gclk.c \
hw/mcu/microchip/asf4/samd51/hpl/mclk/hpl_mclk.c \
hw/mcu/microchip/asf4/samd51/hpl/osc32kctrl/hpl_osc32kctrl.c \
hw/mcu/microchip/asf4/samd51/hpl/oscctrl/hpl_oscctrl.c \
hw/mcu/microchip/asf4/samd51/hal/src/hal_atomic.c
hw/mcu/microchip/samd51/gcc/gcc/startup_samd51.c \
hw/mcu/microchip/samd51/gcc/system_samd51.c \
hw/mcu/microchip/samd51/hpl/gclk/hpl_gclk.c \
hw/mcu/microchip/samd51/hpl/mclk/hpl_mclk.c \
hw/mcu/microchip/samd51/hpl/osc32kctrl/hpl_osc32kctrl.c \
hw/mcu/microchip/samd51/hpl/oscctrl/hpl_oscctrl.c \
hw/mcu/microchip/samd51/hal/src/hal_atomic.c
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/hw/mcu/microchip/asf4/samd51/ \
$(TOP)/hw/mcu/microchip/asf4/samd51/config \
$(TOP)/hw/mcu/microchip/asf4/samd51/include \
$(TOP)/hw/mcu/microchip/asf4/samd51/hal/include \
$(TOP)/hw/mcu/microchip/asf4/samd51/hal/utils/include \
$(TOP)/hw/mcu/microchip/asf4/samd51/hpl/port \
$(TOP)/hw/mcu/microchip/asf4/samd51/hri \
$(TOP)/hw/mcu/microchip/asf4/samd51/CMSIS/Include
$(TOP)/hw/mcu/microchip/samd51/ \
$(TOP)/hw/mcu/microchip/samd51/config \
$(TOP)/hw/mcu/microchip/samd51/include \
$(TOP)/hw/mcu/microchip/samd51/hal/include \
$(TOP)/hw/mcu/microchip/samd51/hal/utils/include \
$(TOP)/hw/mcu/microchip/samd51/hpl/port \
$(TOP)/hw/mcu/microchip/samd51/hri \
$(TOP)/hw/mcu/microchip/samd51/CMSIS/Include
# For TinyUSB port source
VENDOR = microchip

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/microchip
CONF_CPU_FREQUENCY ?= 120000000
CFLAGS += \
@ -20,19 +22,19 @@ CFLAGS += \
LD_FILE = hw/bsp/$(BOARD)/same54p20a_flash.ld
SRC_C += \
hw/mcu/microchip/asf4/same54/gcc/gcc/startup_same54.c \
hw/mcu/microchip/asf4/same54/gcc/system_same54.c \
hw/mcu/microchip/asf4/same54/hal/utils/src/utils_syscalls.c
hw/mcu/microchip/same54/gcc/gcc/startup_same54.c \
hw/mcu/microchip/same54/gcc/system_same54.c \
hw/mcu/microchip/same54/hal/utils/src/utils_syscalls.c
INC += \
$(TOP)/hw/mcu/microchip/asf4/same54/ \
$(TOP)/hw/mcu/microchip/asf4/same54/config \
$(TOP)/hw/mcu/microchip/asf4/same54/include \
$(TOP)/hw/mcu/microchip/asf4/same54/hal/include \
$(TOP)/hw/mcu/microchip/asf4/same54/hal/utils/include \
$(TOP)/hw/mcu/microchip/asf4/same54/hpl/port \
$(TOP)/hw/mcu/microchip/asf4/same54/hri \
$(TOP)/hw/mcu/microchip/asf4/same54/CMSIS/Include
$(TOP)/hw/mcu/microchip/same54/ \
$(TOP)/hw/mcu/microchip/same54/config \
$(TOP)/hw/mcu/microchip/same54/include \
$(TOP)/hw/mcu/microchip/same54/hal/include \
$(TOP)/hw/mcu/microchip/same54/hal/utils/include \
$(TOP)/hw/mcu/microchip/same54/hpl/port \
$(TOP)/hw/mcu/microchip/same54/hri \
$(TOP)/hw/mcu/microchip/same54/CMSIS/Include
# For TinyUSB port source
VENDOR = microchip

View File

@ -166,15 +166,16 @@ void board_init(void)
#endif
// LED0 init
gpio_set_pin_function(LED_PIN, GPIO_PIN_FUNCTION_OFF);
gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
gpio_set_pin_level(LED_PIN, 0);
board_led_write(0);
#if CFG_TUSB_DEBUG >= 2
uart_send_str(BOARD_NAME " LED pin configured\n");
#endif
// BTN0 init
gpio_set_pin_function(BUTTON_PIN, GPIO_DIRECTION_IN);
gpio_set_pin_function(BUTTON_PIN, GPIO_PIN_FUNCTION_OFF);
gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
@ -228,7 +229,7 @@ void board_init(void)
void board_led_write(bool state)
{
gpio_set_pin_level(LED_PIN, state);
gpio_set_pin_level(LED_PIN, !state);
}
uint32_t board_button_read(void)

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/microchip
CFLAGS += \
-mthumb \
-mabi=aapcs \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/microchip
CFLAGS += \
-flto \
-mthumb \

View File

@ -1,3 +1,5 @@
DEPS_SUBMODULES = hw/mcu/sony/cxd56/spresense-exported-sdk
# Platforms are: Linux, Darwin, MSYS, CYGWIN
PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null)))

View File

@ -1,3 +1,9 @@
ST_FAMILY = f0
DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
CFLAGS += \
-flto \
-mthumb \
@ -12,9 +18,6 @@ CFLAGS += \
# suppress warning caused by vendor mcu driver
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
ST_FAMILY = f0
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/stm32F070rbtx_flash.ld

View File

@ -1,3 +1,9 @@
ST_FAMILY = f0
DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
CFLAGS += \
-flto \
-mthumb \
@ -12,10 +18,6 @@ CFLAGS += \
# suppress warning caused by vendor mcu driver
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
ST_FAMILY = f0
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/STM32F072RBTx_FLASH.ld

View File

@ -1,3 +1,9 @@
ST_FAMILY = f1
DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
CFLAGS += \
-flto \
-mthumb \
@ -11,10 +17,6 @@ CFLAGS += \
# mcu driver cause following warnings
#CFLAGS += -Wno-error=unused-parameter
ST_FAMILY = f1
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/STM32F103XB_FLASH.ld

Some files were not shown because too many files have changed in this diff Show More