Skip to content

Commit

Permalink
Update ot-ifx to support Thread 1.3 Certification.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsusid committed Apr 2, 2024
1 parent 7cc2cf0 commit 2f7a132
Show file tree
Hide file tree
Showing 55 changed files with 2,786 additions and 2,655 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
30 changes: 3 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@
name: Build

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/ot-ifx' && github.run_id) || github.ref }}
Expand Down Expand Up @@ -67,33 +63,13 @@ jobs:
use-verbose-mode: 'yes'

arm-gcc:
name: arm-gcc-${{ matrix.gcc_ver }}
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- gcc_ver: 9
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-9-2020-q2-update
- gcc_ver: 10
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-10-2020-q4-major
container:
image: ghcr.io/project-chip/chip-build-infineon:1
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Bootstrap
run: |
cd /tmp
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get --no-install-recommends install -y lib32z1 ninja-build
wget ${{ matrix.gcc_download_url }} -O gcc-arm.tar.bz2
tar xjf gcc-arm.tar.bz2
# use the minimal required cmake version
sudo pip3 install -U scikit-build
sudo pip3 install -U cmake==3.15.3
cmake --version | grep 3.15.3
- name: Build
run: |
export PATH=/tmp/${{ matrix.gcc_extract_dir }}/bin:$PATH
script/test
36 changes: 30 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
[submodule "openthread"]
path = openthread
url = https://github.com/openthread/openthread.git
[submodule "third_party/infineon/platform/cyw30739/30739a0"]
path = third_party/infineon/platform/cyw30739/30739a0
url = https://github.com/Infineon/OT-Matter-30739A0.git
[submodule "third_party/infineon/platform/cyw30739/bsp/cyw930739m2evb-01/TARGET_CYW930739M2EVB-01"]
path = third_party/infineon/platform/cyw30739/bsp/cyw930739m2evb-01/TARGET_CYW930739M2EVB-01
url = https://github.com/Infineon/OT-Matter-TARGET_CYW930739M2EVB-01.git
[submodule "third_party/infineon/btsdk-tools"]
path = third_party/infineon/btsdk-tools
url = https://github.com/Infineon/btsdk-tools.git
[submodule "third_party/infineon/btsdk-include"]
path = third_party/infineon/btsdk-include
url = https://github.com/Infineon/btsdk-include.git
branch = master
[submodule "third_party/infineon/wpan-sdk"]
path = third_party/infineon/wpan-sdk
url = https://github.com/Infineon/wpan-sdk.git
[submodule "third_party/infineon/platform/cyw30739/30739a0"]
path = third_party/infineon/platform/cyw30739/30739a0
url = https://github.com/Infineon/OT-Matter-30739A0.git
[submodule "third_party/infineon/platform/cyw30739/30739b2"]
path = third_party/infineon/platform/cyw30739/30739b2
url = https://github.com/Infineon/OT-Matter-30739B2.git
[submodule "third_party/infineon/platform/cyw30739/bsp/cyw30739b2-p5-evk-01/TARGET_CYW30739B2-P5-EVK-01"]
path = third_party/infineon/platform/cyw30739/bsp/cyw30739b2-p5-evk-01/TARGET_CYW30739B2-P5-EVK-01
url = https://github.com/Infineon/OT-Matter-BSP.git
branch = CYW30739A0-P5-EVK-01
[submodule "third_party/infineon/platform/cyw30739/bsp/cyw30739b2-p5-evk-02/TARGET_CYW30739B2-P5-EVK-02"]
path = third_party/infineon/platform/cyw30739/bsp/cyw30739b2-p5-evk-02/TARGET_CYW30739B2-P5-EVK-02
url = https://github.com/Infineon/OT-Matter-BSP.git
branch = CYW30739A0-P5-EVK-02
[submodule "third_party/infineon/platform/cyw30739/bsp/cyw30739b2-p5-evk-03/TARGET_CYW30739B2-P5-EVK-03"]
path = third_party/infineon/platform/cyw30739/bsp/cyw30739b2-p5-evk-03/TARGET_CYW30739B2-P5-EVK-03
url = https://github.com/Infineon/OT-Matter-BSP.git
branch = CYW30739A0-P5-EVK-03
[submodule "third_party/infineon/platform/cyw30739/bsp/cyw930739m2evb-01/TARGET_CYW930739M2EVB-01"]
path = third_party/infineon/platform/cyw30739/bsp/cyw930739m2evb-01/TARGET_CYW930739M2EVB-01
url = https://github.com/Infineon/OT-Matter-BSP.git
branch = CYW930739M2EVB-01
[submodule "third_party/infineon/platform/cyw30739/bsp/cyw930739m2evb-02/TARGET_CYW930739M2EVB-02"]
path = third_party/infineon/platform/cyw30739/bsp/cyw930739m2evb-02/TARGET_CYW930739M2EVB-02
url = https://github.com/Infineon/OT-Matter-BSP.git
branch = CYW930739M2EVB-02
169 changes: 120 additions & 49 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@
cmake_minimum_required(VERSION 3.15.3)
project(ot-ifx VERSION 0.2.0)

message(STATUS "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}")
message(STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}")
message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "IFX_PLATFORM: ${IFX_PLATFORM}")
message(STATUS "IFX_CHIPSET: ${IFX_CHIPSET}")
message(STATUS "PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
message(STATUS "CMAKE_DEBUG_TARGET_PROPERTIES: ${CMAKE_DEBUG_TARGET_PROPERTIES}")

string(TOUPPER ${IFX_CHIPSET} IFX_CHIPSET_UPPERCASE)

# Set required platform library for openthread stack
set(OT_PLATFORM_LIB_FTD "openthread-${IFX_PLATFORM}")
set(OT_PLATFORM_LIB_MTD ${OT_PLATFORM_LIB_FTD})
Expand All @@ -46,21 +50,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)

option(VERBOSE "Enable verbose message" OFF)

# Add platform specific crypto files to openthread stack SDK
file(
GLOB
PLATFORM_CRYPTO_SETTING
LIST_DIRECTORIES
false
${PROJECT_SOURCE_DIR}/src/${IFX_PLATFORM}/crypto.cmake
)

list(LENGTH PLATFORM_CRYPTO_SETTING PLATFORM_CRYPTO_FILE)

if(PLATFORM_CRYPTO_FILE EQUAL 1)
include("${PROJECT_SOURCE_DIR}/src/${IFX_PLATFORM}/crypto.cmake")
endif()

# Add openthread SDK.
add_subdirectory(openthread)

Expand All @@ -69,6 +58,7 @@ target_compile_definitions(
ot-config
INTERFACE
OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT
OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS=3
)

# Add include directory for openthread stack
Expand All @@ -81,6 +71,9 @@ target_include_directories(
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -fno-exceptions")

# Add the target executable with the specified platform and board information
include("${PROJECT_SOURCE_DIR}/third_party/infineon/platform/${IFX_PLATFORM}/${IFX_PLATFORM}.cmake")

# Add Platform Abstraction Layer (used by OpenThread stack)
add_subdirectory(src/${IFX_PLATFORM})

Expand All @@ -90,47 +83,125 @@ add_subdirectory(third_party)
# Disable building the default openthread executables
set(OT_BUILD_EXECUTABLES OFF)

# Add the target executable with the specified platform and board information
include("${PROJECT_SOURCE_DIR}/third_party/infineon/platform/${IFX_PLATFORM}/${IFX_PLATFORM}.cmake")

file(
GLOB
APP_SOURCES
LIST_DIRECTORIES
false
CONFIGURE_DEPENDS
${PROJECT_SOURCE_DIR}/openthread/examples/apps/cli/*.c
${PROJECT_SOURCE_DIR}/openthread/examples/apps/cli/*.cpp
)

set(APP_INC_DIRS ${PROJECT_SOURCE_DIR}/openthread/examples/platforms)

if(OT_FTD)
set(APP_LINK_LIBS
openthread-cli-ftd
openthread-ftd
${OT_PLATFORM_LIB_FTD}
${OT_MBEDTLS}
ot-config
if(OT_APP_CLI)
file(
GLOB
APP_SOURCES
LIST_DIRECTORIES
false
CONFIGURE_DEPENDS
${PROJECT_SOURCE_DIR}/openthread/examples/apps/cli/*.c
${PROJECT_SOURCE_DIR}/openthread/examples/apps/cli/*.cpp
)

add_example_target(infineon-ot-cli-ftd
"${APP_SOURCES}"
"${APP_INC_DIRS}"
"${APP_LINK_LIBS}")
endif()
if(OT_FTD)
set(APP_LINK_LIBS
openthread-cli-ftd
openthread-ftd
${OT_PLATFORM_LIB_FTD}
${OT_MBEDTLS}
ot-config
)

add_example_target(
"${APP_SOURCES}"
"${APP_INC_DIRS}"
"${APP_LINK_LIBS}"
cli
ftd
)
endif()

if(OT_MTD)
set(APP_LINK_LIBS
openthread-cli-mtd
openthread-mtd
${OT_PLATFORM_LIB_MTD}
${OT_MBEDTLS}
ot-config
)

add_example_target(
"${APP_SOURCES}"
"${APP_INC_DIRS}"
"${APP_LINK_LIBS}"
cli
mtd
)
endif()

elseif(OT_APP_NCP)
file(
GLOB
APP_SOURCES
LIST_DIRECTORIES
false
CONFIGURE_DEPENDS
${PROJECT_SOURCE_DIR}/openthread/examples/apps/ncp/*.c
${PROJECT_SOURCE_DIR}/openthread/examples/apps/ncp/*.cpp
)

if(OT_FTD)
set(APP_LINK_LIBS
openthread-ncp-ftd
openthread-ftd
${OT_PLATFORM_LIB_FTD}
${OT_MBEDTLS}
ot-config
)

add_example_target(
"${APP_SOURCES}"
"${APP_INC_DIRS}"
"${APP_LINK_LIBS}"
ncp
ftd
)
endif()

if(OT_MTD)
set(APP_LINK_LIBS
openthread-ncp-mtd
openthread-mtd
${OT_PLATFORM_LIB_MTD}
${OT_MBEDTLS}
ot-config
)

add_example_target(
"${APP_SOURCES}"
"${APP_INC_DIRS}"
"${APP_LINK_LIBS}"
ncp
mtd
)
endif()

elseif(OT_APP_RCP)
file(
GLOB
APP_SOURCES
LIST_DIRECTORIES
false
CONFIGURE_DEPENDS
${PROJECT_SOURCE_DIR}/openthread/examples/apps/ncp/*.c
${PROJECT_SOURCE_DIR}/openthread/examples/apps/ncp/*.cpp
)

if(OT_MTD)
set(APP_LINK_LIBS
openthread-cli-mtd
openthread-mtd
${OT_PLATFORM_LIB_MTD}
${OT_MBEDTLS}
openthread-rcp
openthread-radio
${OT_PLATFORM_LIB}
ot-config
)

add_example_target(infineon-ot-cli-mtd
"${APP_SOURCES}"
"${APP_INC_DIRS}"
"${APP_LINK_LIBS}")
add_example_target(
"${APP_SOURCES}"
"${APP_INC_DIRS}"
"${APP_LINK_LIBS}"
rcp
)

endif()
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,34 @@ This repo contains example platform drivers for the [Infineon CYW30739][30739].

The example platform drivers are intended to present the minimal code necessary to support OpenThread.

## Toolchain
## Toolchain and Dependencies

Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
### [ModusToolbox™ Software](https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software)

[gnu-toolchain]: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm
Follow the
[Installation Guide](https://www.infineon.com/ModusToolboxInstallguide)
to download and install the ModusToolbox Software.

#### ModusToolbox™ tools package

ModusToolbox™ tools package should be automatically installed in the default location if you followed the
[Installation Guide](https://www.infineon.com/ModusToolboxInstallguide).
Please refer to the Installation Guide for the default location for different operating systems.

If you need to install the ModusToolbox™ tools package in a custom location,
you must set the environment variable `CY_TOOLS_PATHS` to the
`/path/to/ModusToolbox/tools_x.x` to specify the location of tools.

```bash
export CY_TOOLS_PATHS="/path/to/ModusToolbox/tools_x.x"
```

#### Note for WSL (Windows Subsystem for Linux)

If you are using WSL, please ensure you have installed the ModusToolbox™ Software for Linux.
Running Windows tools directly from the WSL command line would cause path resolution failure in the build process.

### Other Dependencies

In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.

Expand Down
2 changes: 1 addition & 1 deletion openthread
Submodule openthread updated 185 files
Loading

0 comments on commit 2f7a132

Please sign in to comment.