Repository navigation
Port for Tricore tc1.6.2 #841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
s3neubauer
wants to merge
4
commits into
eclipse-threadx:dev
Choose a base branch
from
safecubed:tricore_tc1_6_2
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f897c86
Added the TriCore TC1.6.2 port for GNU with a TC375 Lite Kit example
s3neubauer 3aa5ded
Removed dependencies of iLLD from the TriCore TC1.6.2 port and its ex…
s3neubauer 96260ce
Added the ThreadX regression test for the TriCore TC1.6.2 port
s3neubauer 19ff7a3
Added Windows build scripts to the TriCore TC1.6.2 example and test
s3neubauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ CTestTestfile.cmake | |
| *.dep | ||
| *.o | ||
| *.axf | ||
| *.elf | ||
| *.map | ||
| *.a | ||
| *.htm | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Copyright (c) 2026 safecubed GmbH | ||
| # Copyright (c) 2026 Eclipse ThreadX contributors | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the MIT License which is available at | ||
| # https://opensource.org/licenses/MIT. | ||
| # | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| # Portions of this file were generated with AI assistance. | ||
|
|
||
| # Toolchain file for the TriCore TC1.6.2 port (Infineon AURIX TC3) with the | ||
| # AURIX GCC. | ||
| # | ||
| # The port uses no driver library. See | ||
| # ports/tricore_tc1_6_2/gnu/readme_threadx.txt. | ||
|
|
||
| set(CMAKE_SYSTEM_NAME Generic) | ||
| set(CMAKE_SYSTEM_PROCESSOR tricore) | ||
|
|
||
| set(THREADX_ARCH "tricore_tc1_6_2") | ||
| set(THREADX_TOOLCHAIN "gnu") | ||
|
|
||
| set(CMAKE_C_COMPILER tricore-elf-gcc) | ||
| set(CMAKE_CXX_COMPILER tricore-elf-g++) | ||
| set(AS tricore-elf-as) | ||
| set(AR tricore-elf-ar) | ||
| set(OBJCOPY tricore-elf-objcopy) | ||
| set(OBJDUMP tricore-elf-objdump) | ||
| set(SIZE tricore-elf-size) | ||
|
|
||
| set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
|
||
| set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) | ||
|
|
||
| set(CMAKE_C_FLAGS "-mcpu=tc38xx -std=c99 -fno-common -fstrict-volatile-bitfields -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags") | ||
| set(CMAKE_EXE_LINKER_FLAGS "-mcpu=tc38xx -Wl,--gc-sections" CACHE INTERNAL "exe link flags") | ||
| set(CMAKE_C_FLAGS_DEBUG "-O0 -g3" CACHE INTERNAL "c debug compiler flags") | ||
| set(CMAKE_C_FLAGS_RELEASE "-O0" CACHE INTERNAL "c release compiler flags") | ||
| set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 -g3" CACHE INTERNAL "c relwithdebinfo compiler flags") | ||
| set(CMAKE_C_FLAGS_MINSIZEREL "-O0" CACHE INTERNAL "c minsizerel compiler flags") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| target_sources(${PROJECT_NAME} | ||
| PRIVATE | ||
| # {{BEGIN_TARGET_SOURCES}} | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_restore.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_save.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_interrupt_control.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_schedule.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_stack_build.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_system_return.c | ||
| ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_interrupt.c | ||
| # {{END_TARGET_SOURCES}} | ||
| ) | ||
|
|
||
| target_include_directories(${PROJECT_NAME} | ||
| SYSTEM | ||
| PUBLIC | ||
| ${CMAKE_CURRENT_LIST_DIR}/inc | ||
| ) |
57 changes: 57 additions & 0 deletions
57
ports/tricore_tc1_6_2/gnu/example_build/build_threadx_sample.bat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| @echo off | ||
| rem ########################################################################## | ||
| rem Copyright (c) 2026 safecubed GmbH | ||
| rem Copyright (c) 2026 Eclipse ThreadX contributors | ||
| rem | ||
| rem This program and the accompanying materials are made available under the | ||
| rem terms of the MIT License which is available at | ||
| rem https://opensource.org/licenses/MIT. | ||
| rem | ||
| rem SPDX-License-Identifier: MIT | ||
| rem ########################################################################## | ||
|
|
||
| rem Portions of this file were generated with AI assistance. | ||
|
|
||
| rem Builds the ThreadX library tx.a and sample_threadx.elf for the AURIX TC375 | ||
| rem Lite Kit without a driver library, as build_threadx_sample.sh does. The | ||
| rem start-up code is crt0-tc38xx.o of the AURIX GCC: the compiler has no TC37x | ||
| rem device, and the TC38x start-up code applies to the TC375 unchanged. | ||
| rem sample_threadx.ld replaces the memory description of the TC38x. | ||
| rem | ||
| rem CROSS_COMPILE selects the toolchain prefix. The default is the AURIX GCC | ||
| rem (tricore-elf-), which shall be on PATH. | ||
|
|
||
| setlocal EnableExtensions | ||
| cd /d "%~dp0" | ||
|
|
||
| if not defined CROSS_COMPILE set "CROSS_COMPILE=tricore-elf-" | ||
| set "CC=%CROSS_COMPILE%gcc" | ||
| rem tricore-elf-ar loads lib\bfd-plugins\libdep.a, which is no DLL. | ||
| set "AR=%CROSS_COMPILE%gcc-ar" | ||
|
|
||
| set "THREADX_ROOT=..\..\..\.." | ||
| set "BUILD_DIR=build" | ||
|
|
||
| set "CFLAGS=-mcpu=tc38xx -std=c99 -O0 -g3 -Wall -fmessage-length=0 -fno-common -fdata-sections -ffunction-sections" | ||
| set "INCLUDES=-I%THREADX_ROOT%/common/inc -I../inc" | ||
|
|
||
| if exist "%BUILD_DIR%" rmdir /s /q "%BUILD_DIR%" | ||
| mkdir "%BUILD_DIR%\tx" "%BUILD_DIR%\sample" || exit /b 1 | ||
| del /q tx.a sample_threadx.elf sample_threadx.map 2>nul | ||
|
|
||
| rem The archiver reads the object list from a response file. The response file | ||
| rem uses forward slashes, because the archiver treats a backslash in it as an | ||
| rem escape character. | ||
| for %%f in (..\src\*.c %THREADX_ROOT%\common\src\*.c) do ( | ||
| "%CC%" %CFLAGS% %INCLUDES% -c "%%f" -o "%BUILD_DIR%/tx/%%~nf.o" || exit /b 1 | ||
| echo %BUILD_DIR%/tx/%%~nf.o>>"%BUILD_DIR%\tx.rsp" | ||
| ) | ||
| "%AR%" -r tx.a @%BUILD_DIR%/tx.rsp || exit /b 1 | ||
|
|
||
| for %%f in (sample_threadx.c tx_initialize_low_level.c) do ( | ||
| "%CC%" %CFLAGS% %INCLUDES% -c "%%f" -o "%BUILD_DIR%/sample/%%~nf.o" || exit /b 1 | ||
| ) | ||
|
|
||
| "%CC%" -mcpu=tc38xx -T sample_threadx.ld -Wl,--gc-sections -Wl,-Map=sample_threadx.map ^ | ||
| -o sample_threadx.elf %BUILD_DIR%/sample/sample_threadx.o ^ | ||
| %BUILD_DIR%/sample/tx_initialize_low_level.o tx.a || exit /b 1 |
53 changes: 53 additions & 0 deletions
53
ports/tricore_tc1_6_2/gnu/example_build/build_threadx_sample.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| #!/bin/bash | ||
| ############################################################################## | ||
| # Copyright (c) 2026 safecubed GmbH | ||
| # Copyright (c) 2026 Eclipse ThreadX contributors | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the MIT License which is available at | ||
| # https://opensource.org/licenses/MIT. | ||
| # | ||
| # SPDX-License-Identifier: MIT | ||
| ############################################################################## | ||
|
|
||
| # Portions of this file were generated with AI assistance. | ||
|
|
||
| # Builds the ThreadX library tx.a and sample_threadx.elf for the AURIX TC375 | ||
| # Lite Kit without a driver library. The start-up code is crt0-tc38xx.o of | ||
| # the AURIX GCC: the compiler has no TC37x device, and the TC38x start-up | ||
| # code applies to the TC375 unchanged. sample_threadx.ld replaces the memory | ||
| # description of the TC38x. | ||
| # | ||
| # CROSS_COMPILE selects the toolchain prefix. The default is the AURIX GCC | ||
| # (tricore-elf-), which shall be on PATH. | ||
|
|
||
| set -e | ||
| cd "$(dirname "$0")" | ||
|
|
||
| : "${CROSS_COMPILE:=tricore-elf-}" | ||
| CC="${CROSS_COMPILE}gcc" | ||
| AR="${CROSS_COMPILE}ar" | ||
|
|
||
| THREADX_ROOT="../../../.." | ||
| BUILD_DIR="build" | ||
|
|
||
| CFLAGS="-mcpu=tc38xx -std=c99 -O0 -g3 -Wall -fmessage-length=0 -fno-common \ | ||
| -fdata-sections -ffunction-sections" | ||
| INCLUDES="-I${THREADX_ROOT}/common/inc -I../inc" | ||
|
|
||
| rm -rf "${BUILD_DIR}" | ||
| mkdir -p "${BUILD_DIR}/tx" "${BUILD_DIR}/sample" | ||
| rm -f tx.a sample_threadx.elf sample_threadx.map | ||
|
|
||
| for src in ../src/*.c "${THREADX_ROOT}"/common/src/*.c; do | ||
| "${CC}" ${CFLAGS} ${INCLUDES} -c "${src}" -o "${BUILD_DIR}/tx/$(basename "${src%.c}").o" | ||
| done | ||
| "${AR}" -r tx.a "${BUILD_DIR}"/tx/*.o | ||
|
|
||
| for src in sample_threadx.c tx_initialize_low_level.c; do | ||
| obj="${BUILD_DIR}/sample/$(basename "${src%.c}").o" | ||
| "${CC}" ${CFLAGS} ${INCLUDES} -c "${src}" -o "${obj}" | ||
| done | ||
|
|
||
| "${CC}" -mcpu=tc38xx -T sample_threadx.ld -Wl,--gc-sections -Wl,-Map=sample_threadx.map \ | ||
| -o sample_threadx.elf "${BUILD_DIR}"/sample/*.o tx.a |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release, RelWithDebInfo, and MinSizeRel all use
-O0, so production builds are unoptimized. Please set appropriate optimization flags and verify the context-switch tests with those settings.