Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ CTestTestfile.cmake
*.log
shared/lib/netxduo/*
shared/lib/threadx/*
STMicroelectronics/STM32F767ZI-Nucleo/lib/stm32cubef7/
STMicroelectronics/STM32F767ZI-Nucleo/lib/netxduo/

38 changes: 28 additions & 10 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
# Security Policy

## Supported Versions
This Eclipse Foundation Project adheres to the [Eclipse Foundation Vulnerability Reporting Policy](https://www.eclipse.org/security/policy/).

For the time being, the contents of this repository are not in scope for quarterly releases. New versions will be published as needed to address bugs, vulnerabilities, or integrated updated third-party components.
## How To Report a Vulnerability

## Reporting a Vulnerability
If you think you have found a vulnerability in this repository, please report it to us through coordinated disclosure.

If you think you have found a vulnerability in Eclipse ThreadX or one of its companion components, you can report it using one of the following ways:
**Please do not report security vulnerabilities through public issues, discussions, or change requests.**

* Contact the [Eclipse Foundation Security Team](mailto:security@eclipse-foundation.org)
* [Report a Vulnerability](https://github.com/eclipse-threadx/threadx/security/advisories/new)
Instead, [report it privately here](https://github.com/eclipse-threadx/samplex/security/advisories/new) on GitHub

You can find more information about reporting and disclosure at the [Eclipse Foundation Security page](https://www.eclipse.org/security/).

## Security Policy
Please include as much of the information listed below as you can to help us better understand and resolve the issue:

* The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
* Affected version(s)
* Impact of the issue, including how an attacker might exploit the issue
* Step-by-step instructions to reproduce the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Full paths of source file(s) related to the manifestation of the issue
* Configuration required to reproduce the issue
* Log files that are related to this issue (if possible)
* Proof-of-concept or exploit code (if possible)

This information will help us triage your report more quickly.

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 6.5.x | :white_check_mark: |

Eclipse ThreadX publishes a release every quarter. There are no long-term support branches or backports to older releases.

This project follows [Eclipse Foundation Vulnerability Reporting Policy](https://www.eclipse.org/security/policy/).
Normally, fixes for non-critical vulnerabilities will ship in a regularly scheduled quarterly release. If fixes for an urgent or critical vulnerability must ship quickly, then the project will publish a hotfix release of the affected component(s) without waiting for the next quarterly release.

## About this repository
This repository contains only sample code for learning and evaluation purposes. It is not part of the core Eclipse ThreadX release process.
You can learn more about the [project's release cadence in this blog post](https://blogs.eclipse.org/post/fr%C3%A9d%C3%A9ric-desbiens/eclipse-threadx-more-predictable-more-open).
112 changes: 81 additions & 31 deletions STMicroelectronics/STM32F767ZI-Nucleo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
# Contributors:
# Ali Eissa - 2026 version.

cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
set(CMAKE_C_STANDARD 99)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Set the toolchain if not defined
if(NOT CMAKE_TOOLCHAIN_FILE)
Expand All @@ -24,17 +25,16 @@ include(utilities)
# Define the Project
project(stm32f767_threadx C CXX ASM)

# Define ThreadX User Configurations
set(TX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/lib/threadx/tx_user.h" CACHE STRING "Enable TX user configuration")
set(TX_USER_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}/lib/threadx")
# Select the active demo to build (threadx_basic)
set(ACTIVE_DEMO "threadx_basic" CACHE STRING "Active demo name to build: threadx_basic")

# Set up standard paths for find modules
set(STM32_FAMILY "F7")
set(STM32Cube_DIR "${CMAKE_CURRENT_LIST_DIR}/lib/stm32cubef7")

# Find CMSIS and HAL driver packages
find_package(CMSIS REQUIRED)
find_package(STM32HAL REQUIRED COMPONENTS cortex pwr rcc gpio uart dma eth)
find_package(STM32HAL REQUIRED COMPONENTS cortex pwr rcc gpio uart dma eth i2c)

# Compile the STM32F7xx HAL Driver Library as an Object Library
set(HAL_TARGET stm32cubef7)
Expand All @@ -54,52 +54,102 @@ target_include_directories(${HAL_TARGET}
${CMAKE_CURRENT_LIST_DIR}/app
)

# Dynamic Middleware Auto-Detection
# Check if the active demo uses NetX Duo by looking for nx_user.h
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/app/demos/${ACTIVE_DEMO}/nx_user.h")
set(USE_NETXDUO ON)
set(NX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/app/demos/${ACTIVE_DEMO}/nx_user.h" CACHE STRING "Enable NetX Duo user configuration" FORCE)
else()
set(USE_NETXDUO OFF)
endif()

# Check if the active demo has custom tx_user.h; otherwise fallback to app/tx_user.h
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/app/demos/${ACTIVE_DEMO}/tx_user.h")
set(TX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/app/demos/${ACTIVE_DEMO}/tx_user.h" CACHE STRING "Enable TX user configuration" FORCE)
set(TX_USER_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}/app/demos/${ACTIVE_DEMO}")
else()
set(TX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/lib/threadx/tx_user.h" CACHE STRING "Enable TX user configuration" FORCE)
set(TX_USER_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}/lib/threadx")
endif()

# Compile ThreadX Kernel from root shared libs submodule
set(THREADX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../libs/threadx")
add_subdirectory(${THREADX_DIR} threadx)

# Create the Main Executable
set(EXE_TARGET stm32f767_threadx)
# Compile FileX Filesystem from root shared libs submodule
set(FILEX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../libs/filex")
add_subdirectory(${FILEX_DIR} filex)

if(USE_NETXDUO)
# Compile NetX Duo TCP/IP Stack from root shared libs submodule
set(NXD_ENABLE_FILE_SERVERS OFF CACHE BOOL "Disable FileX dependency in NetX Duo" FORCE)
set(NETXDUO_DIR "${CMAKE_CURRENT_LIST_DIR}/../../libs/netxduo")
add_subdirectory(${NETXDUO_DIR} netxduo)
endif()

add_executable(${EXE_TARGET}
# 1. Define the Board BSP static library
add_library(board_bsp OBJECT
app/startup/startup_stm32f767zitx.s
app/startup/system_stm32f7xx.c
app/startup/tx_initialize_low_level.S
app/board_init.c
app/console.c
app/ethernet_phy.c
app/main.c
app/stm32f7xx_hal_msp.c
app/sysmem.c
app/syscalls.c
)

# Set compile definitions for our executable
target_compile_definitions(${EXE_TARGET}
PRIVATE
STM32F767xx
USE_HAL_DRIVER
STM32F7
# Include paths for BSP
target_include_directories(board_bsp PUBLIC
${CMAKE_CURRENT_LIST_DIR}/app
${CMSIS_INCLUDE_DIRS}
${STM32HAL_INCLUDE_DIR}
${TX_USER_FILE_DIR}
)

# Compile definitions for BSP
target_compile_definitions(board_bsp PRIVATE
STM32F767xx
USE_HAL_DRIVER
STM32F7
)

# Include paths
target_include_directories(${EXE_TARGET}
PRIVATE
# Link libraries for BSP (HAL and CMSIS)
target_link_libraries(board_bsp PUBLIC
stm32cubef7
threadx
)


# 2. Define conditional NetX Duo driver library target
if(USE_NETXDUO)
add_library(netx_stm32_driver OBJECT
lib/netxduo/nx_stm32_eth_driver.c
lib/netxduo/nx_stm32_phy_driver.c
lib/netxduo/lan8742.c
)

# NetX driver needs its local files, HAL, CMSIS, ThreadX, NetX Duo and the active demo folder (for nx_stm32_eth_config.h and nx_user.h)
target_include_directories(netx_stm32_driver PUBLIC
${CMAKE_CURRENT_LIST_DIR}/lib/netxduo
${CMAKE_CURRENT_LIST_DIR}/app/demos/${ACTIVE_DEMO}
${CMAKE_CURRENT_LIST_DIR}/app
${CMSIS_INCLUDE_DIRS}
${STM32HAL_INCLUDE_DIR}
${TX_USER_FILE_DIR}
)

# Link libraries (includes ThreadX kernel and HAL object libraries)
target_link_libraries(${EXE_TARGET}
PRIVATE
threadx
)

target_compile_definitions(netx_stm32_driver PRIVATE
STM32F767xx
USE_HAL_DRIVER
STM32F7
)

target_link_libraries(netx_stm32_driver PUBLIC
netxduo
stm32cubef7
)
)
endif()

# Apply GCC linker script and print memory usage (utilities.cmake function)
set_target_linker(${EXE_TARGET} "${CMAKE_CURRENT_LIST_DIR}/app/startup/STM32F767ZITx_FLASH.ld")
# 3. Add the active demo subdirectory to build the executable target
add_subdirectory(app/demos/${ACTIVE_DEMO})

# Post-build commands to generate raw .bin and .hex files
post_build(${EXE_TARGET})
Loading