88 Commits
Author SHA1 Message Date
Frédéric DesbiensandGitHub 44d7c95c58 Updated SECURITY.md (#566)
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
2026-06-30 17:31:42 -04:00
Frédéric DesbiensandGitHub b91b03b9e7 Merge pull request #548 from eclipse-threadx/dev
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
Merge changes for the v6.5.1.202602a release
2026-06-08 17:08:34 +02:00
df30b8b96e Release 6.5.1.202602a preparation (#547)
* Updated version number constants

* Updated port version strings

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-08 16:59:04 +02:00
Frédéric DesbiensandGitHub 5a07bdac35 Fix/issue 545 basepri endif (#546)
* Fixed #else replaced with #endif in tx_port.h for cortex_m3/m4/m7 gnu/ac6/iar ports

In the __set_basepri_value/#ifdef TX_PORT_USE_BASEPRI block, an #else
directive was incorrectly replaced with #endif in a prior commit.
This caused the TX_PORT_USE_BASEPRI guard to close prematurely and
left __enable_interrupts unconditionally visible (or triggered an
orphaned #endif / missing #endif error at compile time).

Affected ports: cortex_m3/ac6, cortex_m3/iar, cortex_m4/ac6,
cortex_m4/gnu, cortex_m4/iar, cortex_m7/ac6, cortex_m7/gnu,
cortex_m7/iar.

For cortex_m3/gnu and cortex_m4/gnu the fix restores the #else and
the existing second #endif now correctly closes the block.
For the ac6/iar variants of m3/m4 and all m7 variants, the #else is
restored and a missing closing #endif is added after __enable_interrupts.

Also adds Linux shell build scripts (build_threadx.sh and
build_threadx_sample.sh) for the cortex_m3/gnu, cortex_m4/gnu, and
cortex_m7/gnu example_build directories as Linux equivalents of the
existing .bat files.


* Fixed missing linker script symbols in cortex_m4/gnu example_build

cortexm4_crt0.S references several symbols that were absent from
sample_threadx.ld, causing undefined-reference linker errors when
building the sample:

- __text_load_start__, __text_start__, __text_end__
- __rodata_load_start__, __rodata_start__, __rodata_end__
- __fast_load_start__, __fast_start__, __fast_end__
- __ctors_load_start__, __dtors_load_start__

Changes:
- Added __text_start__/__text_end__ bounds to the .text section and
  __text_load_start__ via LOADADDR(.text).
- Moved .rodata out of .text into its own section with start/end/load
  
- Added __ctors_load_start__ and __dtors_load_start__ markers within
  .text (load address == VMA since the section is XIP in FLASH; the
  crt0 copy call becomes a no-op).
- Added an empty .fast section in RAM with __fast_load_start__ pointing
  to __fast_start__ so the crt0 fast-copy call is a no-op.


* Added Linux build scripts and fixed path bug in cortex_m23 for all ports changed between v6.5.0 and v6.5.1

Added build_threadx.sh (and build_threadx_sample.sh where applicable)
as Linux equivalents of the Windows .bat scripts for all GNU-toolchain
ports touched between v6.5.0.202601_rel and v6.5.1.202602_rel:

  arm9, arm11, cortex_a5/a7/a8/a9/a12/a15/a17,
  cortex_m0, cortex_m23, cortex_r4, cortex_r5

For cortex_m33/m55/m85 (which had no .bat equivalent), build_threadx.sh
was written from scratch using the port CMakeLists.txt source lists and
the correct CPU flags (-mcpu=cortex-m33/m55/m85 -mthumb).

Also fixed a pre-existing bug in cortex_m23/gnu/example_build/
build_threadx.bat (and the generated .sh): tx_thread_stack_error_handler.c
and tx_thread_stack_error_notify.c were referenced as ../src/ (port
directory) instead of ../../../../common/src/ where they actually live.

All 16 newly added build_threadx.sh scripts were verified to compile
successfully with arm-none-eabi-gcc 13.2.1.

---------
Closes #545
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-08 16:51:08 +02:00
Frédéric DesbiensandGitHub 87ab09cce3 Merge pull request #544 from eclipse-threadx/dev
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
Merging changes for the v.6.5.1.202602 release
2026-06-08 10:01:32 +02:00
Frédéric DesbiensandCopilot 730b61874b Added copyright headers to files missing them
Applied the standard MIT license header to all project-owned C, header,
assembly, shell, and Python files that were missing a copyright notice.
Third-party, toolchain startup, and auto-generated files were excluded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-06 21:48:06 +02:00
de1c6e9bbe Release 6.5.1.202602 preparation (#543)
* Updated version number constants
* Updated port version strings

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-03 16:55:01 -04:00
e2834b3618 Added a release preparation script (#542)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-03 16:35:28 -04:00
518127b2e9 cmake: fixed THREADX_ARCH undefined when building as standalone library (#540)
CMake loads the toolchain file during the first project() call.
Variables set in the toolchain (THREADX_ARCH, THREADX_TOOLCHAIN) were
therefore not visible before project() was invoked.  Commit 2c16114a
moved project() after those checks to conditionally select LANGUAGES and
CMAKE_TRY_COMPILE_TARGET_TYPE for Windows, which broke standalone builds
that rely on the toolchain to supply THREADX_ARCH.

Fixed by calling project(threadx LANGUAGES C) first so the toolchain is
sourced, then checking THREADX_ARCH, then conditionally enabling ASM via
enable_language(ASM) for non-Windows ports.  The CMAKE_TRY_COMPILE_TARGET_TYPE
override was removed from CMakeLists.txt because every toolchain file in
cmake/ already sets it to STATIC_LIBRARY where needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-29 08:50:52 -04:00
d4b9448f84 Added riscv-none-elf-rv32imc toolchain file for xPack (risc-v32) (#539)
Add cmake/riscv-none-elf-rv32imc.cmake targeting the xPack
riscv-none-elf-gcc toolchain with rv32imc_zicsr/ilp32 ABI for
bare-metal CORE-V MCU builds.

Update cmake/riscv32-unknown-elf-rv32imc.cmake to correctly target
rv32gc/ilp32d (matching riscv-collab riscv32-elf ABI) for QEMU
regression tests.

Update cmake/riscv64-gcc-rv32imc.cmake compat alias to include
the new riscv-none-elf-rv32imc.cmake.

Update CORE-V MCU example_build: build.sh exports xPack PATH,
install_deps.sh downloads xPack 15.2.0-1, README.md reflects new
toolchain name/path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-27 17:06:37 -04:00
6061c43f96 Removed clz.c workaround; use riscv32-unknown-elf toolchain (#538)
bsp/clz.c provided a weak __clzsi2 fallback to work around the missing
rv32 multilib in the riscv-collab riscv64-unknown-elf toolchain.  Since
cmake/riscv32-unknown-elf-rv32imc.cmake now uses the dedicated riscv32-
unknown-elf-gcc toolchain (riscv-collab riscv32-elf release), which ships
a native rv32/ilp32 libgcc with all required helpers, the workaround is
no longer needed.

Remove bsp/clz.c and its entry in CMakeLists.txt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-27 12:00:47 -04:00
Frédéric Desbiens 4a7343159b Merge branch 'master' into dev 2026-05-27 11:50:17 -04:00
80cbaadfaf cmake: rename rv32 toolchain file to riscv32-unknown-elf-rv32imc.cmake (#537)
Renamed cmake/riscv64-gcc-rv32imc.cmake to the accurate name
cmake/riscv32-unknown-elf-rv32imc.cmake and switch the compiler
from riscv64-unknown-elf-gcc to riscv32-unknown-elf-gcc.

The riscv-collab riscv64-elf toolchain has no rv32 multilib and
will fail to link soft-float and integer helpers (__clzsi2, __muldf3,
etc.) when building for -march=rv32imc_zicsr -mabi=ilp32.  The
dedicated riscv32-unknown-elf-gcc (riscv-collab riscv32-elf release,
installed to /opt/riscv by scripts/install_riscv.sh) ships the correct
native rv32/ilp32 libgcc — analogous to arm-none-eabi-gcc for Cortex-M.

The old filename is kept as a two-line compatibility alias that includes
the new file, so any out-of-tree users who hardcode the old path still work.

Also update:
- core_v_mcu/build.sh: reference new cmake filename
- core_v_mcu/README.md: update prerequisites table and toolchain docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-27 11:33:28 -04:00
Frédéric DesbiensGitHubCopilot 223556219+Copilot@users.noreply.github.com
7486de06c8 Refactored, consolidated, and cleaned up RV32/RV64 ports (#536)
risc-v: refactor, consolidate, and fix RV32/RV64 ports

Consolidates the RISC-V 32-bit and 64-bit GNU/Clang port sources, fixes two
pre-existing assembly bugs discovered during testing, and hardens the build
infrastructure for both the regression suite and the CORE-V MCU example.

--- Port consolidation (RV32 GNU + Clang) ---

 - Delete ports/risc-v32/clang/src/ (8 .S files had no Clang-specific
 directives; diverged from GNU only due to missing bug fixes). The Clang
 port CMakeLists.txt now compiles from ../gnu/src/.
 - Change .global -> .weak for _tx_initialize_low_level in gnu/src/ to allow
 BSP-level override without a linker conflict (adopted from Clang port).
 - Create ports/risc-v32/common/tx_port_riscv32_common.h with all definitions
 shared between GNU and Clang ports. Reduce both tx_port.h files to thin
 wrappers.
 - Add a prominent comment in risc-v64/gnu/inc/tx_port.h explaining why
 LONG/ULONG are intentionally 32-bit on RV64 (ThreadX ABI requirement,
 mirrors win64/MSVC LLP64).

--- Shared CMake helper ---

 - Add cmake/threadx_riscv_port.cmake with threadx_add_riscv_port(). All
 three port CMakeLists.txt files are reduced to ~8 lines each. Include path
 is relative to CMAKE_CURRENT_LIST_DIR so the helper works whether ports
 are built standalone or as a subdirectory of the test framework.

--- Shared example-build drivers ---

 - Create canonical driver files under ports/risc-v_common/:
  inc/csr.h                  (uintptr_t-based; portable RV32 + RV64)
  example_build/plic/        (plic.c, plic.h)
  example_build/uart/        (uart_qemu_ns16550.c/h; static inline putc_nolock)
  example_build/trap/        (trap_qemu.c; XLEN-portable mcause constants)
 - Replace per-example copies with symlinks in all qemu_virt and cva6_ariane
 example directories.
 - Fix OS_IS_INTERRUPT typo (was OS_IS_INTERUPT) in shared trap_qemu.c.
 - Gate print_hex() behind TX_RISCV_TRAP_DEBUG.

--- Bug fixes in RV32 assembly ---

tx_thread_schedule.S:

 - Solicited-return FP path: reload t0 from the mepc stack slot before
 csrw mepc, t0. After the FP restore block, t0 held the fcsr value (0 for
 new threads), which caused mepc = 0 and an immediate instruction-address
 fault on the first context switch.
 - Same path: reload t0 from the mstatus stack slot before csrw mstatus, t0
 to avoid writing the stale fcsr value into mstatus.

tx_thread_system_return.S:

 - FP callee-saved registers were saved unconditionally before the mstatus.FS
 check, causing an illegal instruction trap (mcause=0x2) when a thread with
 FS=Off (lazy FPU, thread has never used FP) voluntarily yielded.
 - Apply the same FS guard pattern used in tx_thread_context_save.S: read
 mstatus first, isolate FS[1:0], and skip fsw/fsd if FS == Off.

Both bugs were pre-existing on origin/dev and are unrelated to the
consolidation changes.

--- RV64 64-bit pointer compatibility ---

 - Add TX_TIMER_INTERNAL_EXTENSION, TX_THREAD_CREATE_TIMEOUT_SETUP, and
 TX_THREAD_TIMEOUT_POINTER_SETUP to risc-v64/gnu/inc/tx_port.h to store the
 thread timeout pointer in a VOID
  * extension field rather than truncating it
 into a 32-bit ULONG. Mirrors the win64 port pattern.
 - Define TX_TIMER_EXTENSION_PTR_DEFINED as a portable sentinel.
 - Update threadx_thread_basic_execution_test.c guard from #if defined(_WIN64)
 to #if defined(_WIN64) || defined(TX_TIMER_EXTENSION_PTR_DEFINED).
 - Disable -Wconversion for the RV64 test build: ULONG = unsigned int (32-bit)
 is intentional for ThreadX ABI but triggers spurious warnings when sizeof()
 (8 bytes on RV64) appears in arithmetic with ULONG in common/src/.

--- Regression suite cmake fixes ---

test/tx/cmake/riscv/regression/CMakeLists.txt:

 - Build testcontrol_weak_defaults.c as a separate OBJECT library and include
 it in every test executable via $<TARGET_OBJECTS:>. GNU ld does not extract
 objects from a static archive to satisfy weak symbols, so bundling it in
 test_utility was insufficient for the standalone
 threadx_initialize_kernel_setup_test.

test/tx/cmake/regression/CMakeLists.txt,
test/smp/cmake/regression/CMakeLists.txt:

 - Same fix applied to the Linux and SMP regression builds. The symbols
 abort_all_threads_suspended_on_mutex, suspend_lowest_priority, and
 abort_and_resume_byte_allocating_thread were introduced by the win64 merge
 and left the standalone test unlinkable.

--- CORE-V MCU toolchain and build fixes ---

cmake/riscv64-gcc-rv32imc.cmake:

 - Resolve riscv64-unknown-elf-gcc via PATH so the riscv-collab toolchain in
 /opt/riscv/bin is preferred when it appears first.

ports/risc-v32/gnu/example_build/core_v_mcu/bsp/clz.c (new):

 - The riscv-collab toolchain is built without rv32 multilib, so its libgcc
 does not define __clzsi2 (the helper emitted for __builtin_clz() in fll.c).
 Add a weak __clzsi2 fallback so the build is self-contained with any
 riscv64-unknown-elf toolchain. The weak attribute yields to a
 libgcc-provided strong symbol when the Ubuntu multilib package is used.

core_v_mcu/CMakeLists.txt:

 - Add bsp/clz.c to sources.
 - Reference CMAKE_TOOLCHAIN_FILE via message(STATUS) to suppress the false-
 positive "Manually-specified variables were not used by the project" CMake
 warning and to show the active toolchain at configure time.

--- Housekeeping ---

 - Rename azrtos_test_* -> threadx_test_* (eliminate Azure RTOS branding).
 - Add RV64 QEMU CI test script:
  ports/risc-v64/gnu/example_build/qemu_virt/test/
  threadx_test_tx_gnu_riscv64_qemu.py
 - Normalize entry.s -> entry.S in all 4 example directories.
 - .gitignore: exclude build_m7/ and .codex local artifacts.
 - CI: comment out the riscv regression workflow job and remove it from the
 deploy job's needs list (preserved in-place for easy re-enablement).

--- Verified ---

 - 95/95 RV32 regression tests pass (QEMU virt)
 - 95/95 RV64 regression tests pass (QEMU virt)
 - All 5 Linux build configurations build cleanly (default_build_coverage,
 disable_notify_callbacks_build, stack_checking_build,
 stack_checking_rand_fill_build, trace_build)
 - CORE-V MCU example_build links cleanly with /opt/riscv toolchain

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
2026-05-27 10:30:57 -04:00
Frédéric DesbiensandGitHub 2c16114a45 Added win64 ports of ThreadX and ThreadX SMP (#529)
Windows x64 port and regression suite

 This PR adds the Windows x64 (Win64) simulation port for both the standalone
 and SMP variants of ThreadX, along with the full CMake build and test
 infrastructure needed to run the regression suite on Windows.


 New ports

 Win64 standalone (ports/win64/vs_2022): self-contained Windows simulation
 port using Win32 threading primitives as virtual cores. Includes CMake
 integration, build/test scripts, and MSVC project files.

 Win64 SMP (ports/win64_smp/vs_2022): multi-core Windows simulation port.
 Supports up to 4 virtual cores backed by Windows host threads.


 Scheduler and timer improvements

 The initial port used coarse polling and synchronous SuspendThread/ResumeThread
 pairs throughout the scheduler hot path. Several rounds of optimization reduced
 the SMP regression suite runtime from ~150 s to ~78 s (-48%), with no
 regressions:

 - Replaced scheduler polling with an event-driven wake path; switched the
   simulated timer to one-shot rearming to eliminate catch-up ticks.
 - Skip SuspendThread when _tx_thread_preempt_disable != 0 (new suspension
   type 3) -- the primary optimization, yielding up to 7.9x speedup on
   preemption-heavy tests.
 - Skip SuspendThread when a thread is spinning on the Win32 critical section
   (suspension type 4), and fix a stale-TLS bug in
   _tx_win32_critical_section_obtain that could stamp mutex_access on the
   wrong virtual core.
 - Added a 2 ms scheduler event timeout (matching the Linux SMP port) to
   prevent stalls on any missed SetEvent.
 - Enabled high-resolution waitable timers (SetWaitableTimerEx) for accurate
   100 Hz tick cadence.
 - Increased TX_WIN32_CONTENTION_PAUSE_COUNT from 64 to 256 to reduce
   SwitchToThread overhead under heavy CS contention.


 Build and test infrastructure

 - Hardened the Windows build wrapper (scripts/build_tx.ps1): invoke Ninja
   directly for Ninja build trees, fix timeout detection, add a default build
   timeout, and limit fallback replay to real timeout cases.
 - Added -Clean support to Windows test scripts to remove stale CTest state
   before each run.
 - Skip Visual Studio DevShell re-entry when the active MSVC environment
   already matches the requested architecture.
 - Fixed scripts/build_tx.sh (Linux) regression source generation: replaced
   brittle exact-string insertion with line-based matching so the interrupt
   dispatcher hook is inserted reliably for both simulator ports.


 Test suite updates

 - Introduced test/tx/regression/threadx_test_port.h with portable macros
   (TX_TEST_POINTER_WORD, TX_TEST_STORE_POINTER) for storing pointers in test
   arrays on 64-bit targets where ULONG remains 32-bit.
 - Adjusted pool-capacity and pointer-storage patterns in regression tests to
   use ALIGN_TYPE-sized slots, making the suite correct on 64-bit hosts.
 - Restored stricter event flag, sleep, and timer expectations now that
   port-level fixes make prior Windows accommodations unnecessary.
 - Tightened SMP watchdog and clean-build timeout defaults.


 Version metadata

 Updated Win32, Win64, and Win64 SMP port version strings to 6.5.1.202602.

 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
 Co-authored-by: Codex (gpt 5.5) <codex@openai.com>
2026-05-26 17:17:40 -04:00
Frédéric DesbiensandGitHub 5513b1724a Added port for the OpenHW CORE-V MCU platform (#535)
Adds a complete ThreadX port for the OpenHW CORE-V MCU SoC, targeting the Digilent Nexys A7 FPGA board with an Ashling Opella-LD debug probe.

 New files
 ---------
 cmake/riscv64-gcc-rv32imc.cmake
   CMake toolchain file for riscv64-unknown-elf-gcc targeting rv32imc_zicsr/ilp32.

 ports/risc-v32/gnu/example_build/core_v_mcu/ -- Full BSP + demo application:

Assembly
     crt0.S                     C runtime startup (BSS clear, GP/SP init, call main)
     vectors.S                  32-entry vectored interrupt table at 0x1c000800
     tx_initialize_low_level.S  mtvec setup (vectored mode), stack/free-mem pointers

BSP drivers (bsp/)
     system_core_v_mcu.c  Top-level init and ISR dispatcher (isr_table[32])
     irq.c                PULP APB interrupt controller (enable/disable/mask)
     timer_irq.c          PULP FC Timer -- 100 Hz tick from 10 MHz SOC clock
     fll.c                Frequency Locked Loop -- 5 MHz to 50 MHz (FPGA)
     uart_driver.c        UDMA UART channel 0 -- polled TX, non-blocking RX (8-bit transfer width)
     gpio.c               PULP apb_gpiov2 driver: set/clear/toggle/direction by pin index;
                          pad-mux via per-pad indexed registers at APB_SOC_CTRL + 0x400 + pad*4;
                          full pinmux API (gpio_setpinmux, gpio_getpinmux, gpio_pin_set_dir,
                          gpio_pin_read_status)
     i2c_master.c         Polled UDMA I2C master
     adt7420.c            ADT7420 temperature sensor driver
     string.c             Freestanding memset/memcpy shim (no newlib)

Headers (include/)
     Peripheral register maps, MMIO inlines, BSP API declarations, tx_user.h

Application
     demo_threadx.c   Two threads: LED[0] blink at 1 Hz (IO pad 11, GPIO pin 4, MUX=2)
                      + UART heartbeat with startup banner
                      ("Eclipse ThreadX for OpenHW CORE-V MCU vX.Y.Z.BBBBB")
     link.ld          Linker script: .vectors@0x1c000800, .text@0x1c000880
     CMakeLists.txt   Build definition (references THREADX_ROOT)
     build.sh         One-shot CMake+Ninja build script

Tooling
     install_deps.sh               Automates toolchain/OpenOCD dependency setup
     deploy.sh                      One-step GDB flashing via Ashling Opella-LD;
                                           gdb-multiarch fallback when riscv64-unknown-elf-gdb is absent;
                                           supports --wsl flag required by usbipd-win v5.x
     openocd-nexys-Ashling-Opella-LD.cfg   OpenOCD config for Opella-LD over JTAG

Tests (tests/)
     test_irq.c / test_timer.c   Host-compiled unit tests (2/2 pass)
     mock/mmio_mock.*             Software MMIO register map for host testing

Documentation
     README.md   Hardware overview, build, flash/debug, BSP API reference

 Architecture notes
 ------------------
 - CV32E40P uses the PULP/PULPissimo interrupt controller (not CLINT); IRQ lines
   are masked via APB registers, not the mie CSR.
 - mtvec must be 256-byte aligned; vectors placed at 0x1c000800 (vectored mode).
 - Timer IRQ = line 10; dispatch via isr_table[mcause & 0x1f].
 - Build: -march=rv32imc_zicsr -mabi=ilp32, -ffreestanding, -nodefaultlibs.
 - Verified: ELF 11 KB text, sections at correct addresses, unit tests pass.

 Third-party attributions
 ------------------------
 BSP files derived from core-v-freertos (Apache-2.0):
   (c) 2019-2020 ETH Zurich and University of Bologna
   (c) 2020 GreenWaves Technologies
   (c) 2011-2014 Wind River Systems, Inc.
   (c) 2017 SiFive Inc. (crt0.S, BSD-2-Clause portions)
 All original copyright notices retained; see individual file headers.
 SPDX: Apache-2.0 AND MIT (crt0.S: (Apache-2.0 OR BSD-2-Clause) AND MIT).

 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-25 11:28:55 -04:00
Frédéric DesbiensandGitHub 3c4d20285f Corrected typos in two test filenames (#527) 2026-04-29 13:22:15 -04:00
33efad3fee Fixed race condition and message loss in Cortex-M ports (#523)
* Fixed race condition and message loss in Cortex-M GNU, AC6, and IAR ports (#516)

- Added compiler memory barriers to BASEPRI management functions in tx_port.h.
- Added architectural barriers (DSB/ISB) to scheduler return paths in tx_port.h and tx_thread_system_return.S to prevent fall-through before context switch.
- These changes address spurious thread resumption and lost messages, especially when TX_NOT_INTERRUPTABLE is enabled.
- These changes ensure that pending interrupts (specifically PendSV) are recognised before subsequent instructions are executed, following Kairalite's feedback and ARM architectural guidelines.

 Assisted-by: Gemini (Gemini 2.0 Flash)

-----

* Added a comment in common/tx_queue_cleanup to document why the NI path omits revalidation guards

- In `TX_NOT_INTERRUPTABLE` mode, the caller keeps interrupts disabled across the entire cleanup call, so the race window that makes the guards necessary in the interruptable path cannot occur. Add a comment explaining this, and noting that all paths that resume a suspended thread clear tx_thread_suspend_cleanup before calling
_tx_thread_system_ni_resume, making double-cleanup impossible.

This prevents future false-positive suggestions (e.g. from AI tools) to add redundant checks to the NI path.

Relates to: eclipse-threadx/threadx#516

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-29 09:10:57 -04:00
Frédéric DesbiensandGitHub d5c75fd38f Merge pull request #361 from howjmay/typo
Fixed typos in several regression test files
2026-04-15 11:38:51 -04:00
Frédéric DesbiensandGitHub f81d1c9eb5 Merge branch 'dev' into typo 2026-04-15 11:36:53 -04:00
Frédéric DesbiensandGitHub 454ab56fce Merge pull request #278 from Polarisru/master
Fixed SysTick initialization problem in tx_initialize_low_level.s for Cortex-M0.
2026-04-15 11:23:57 -04:00
Frédéric DesbiensandGitHub 4f1b9bfdc1 Merge pull request #524 from fdesbiens/fix-pr-277
Added conditional CMake support for ThreadX SMP
2026-04-15 11:11:51 -04:00
Frédéric Desbiens 98e4754381 build: add conditional CMake support for ThreadX SMP
- Introduce THREADX_SMP option in root CMakeLists.txt.
- Implement conditional source and port directory selection for SMP builds.
- Add CMake support for common_smp and Cortex-A9 SMP port.
- Fix linker flags in Cortex-A9 SMP sample build script.
- Remove duplicate invalidateCaches_IS declarations in v7.h headers.

Assisted-by: Gemini (Experimental)
2026-04-15 10:52:14 -04:00
Frédéric DesbiensandGitHub 9dcb05cb78 Merge pull request #273 from hodcarrier/master
Fixed the link flag in the Cortex-A9 sample
2026-04-15 09:42:41 -04:00
Frédéric DesbiensandGitHub 12553eaf2c Merge pull request #270 from MrNetic/patch-1
Removed extra spaces in tx_port.h.
2026-04-15 09:38:15 -04:00
Frédéric DesbiensandGitHub a0dc185f66 Merge pull request #508 from goodnorning/feature/rv64_rvv_support
Added rv64 rvv support
2026-04-14 09:26:33 -04:00
Frédéric DesbiensandGitHub 57e317a7b5 Merge pull request #521 from jblanchard-jblopen/patch-2
Fixed TX_TIMER_TICKS_PER_SECOND default value in tx_user_sample.h
2026-04-14 09:12:31 -04:00
Frédéric DesbiensandGitHub 8c57362209 Merge pull request #512 from eclipse-threadx/master
Merge pull request #510 from eclipse-threadx/dev
2026-03-12 18:18:39 +01:00
Frédéric DesbiensandGitHub 3726d7906b Merge pull request #510 from eclipse-threadx/dev
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
Merge changes ahead of the v6.5.0.202601 release
2026-03-06 19:27:49 +01:00
Frédéric DesbiensandGitHub c3259a2160 Updated copyright headers and version number constants (#509)
* Updated version number constants

* Removed revision history from all files

* Added Eclipse ThreadX contributors' copyright header
2026-03-05 10:46:30 +01:00
Frédéric DesbiensandGitHub 385d39f421 Merge pull request #502 from quintauris-tech/riscv32-clang-port
Added a RV32 Clang port
2026-03-04 08:36:53 +01:00
Frédéric DesbiensandGitHub b3e8a9aa20 Merge pull request #500 from goodnorning/feature/support_xuantie_e906
Added support for the XuanTie E906 CPU.
2026-03-04 08:34:59 +01:00
Frédéric DesbiensandGitHub 0c92f48d50 Merge pull request #493 from mehmetteren/dev
Fixed VFP build failure in Cortex-A tx_thread_schedule.S
2026-03-02 11:41:53 -05:00
Frédéric Desbiens da5093f84b Proposed changes to the original PR 2026-03-02 14:24:07 +01:00
Frédéric DesbiensandGitHub 5910de86d6 Merge pull request #506 from akifejaz/qemu-examples
Updated the QEMU examples to match the new RV port format
2026-03-01 13:02:32 -05:00
Frédéric DesbiensandGitHub 33610aa190 Merge pull request #504 from fdesbiens/issue499
Added ax attribute to ThreadX module example build preamble.S files
2026-02-27 10:27:25 -05:00
Frédéric Desbiens f4051070db Added ax attribute to ThreadX module example build preamble.S files 2026-02-27 10:25:05 -05:00
Frédéric DesbiensandGitHub 3bbc096d78 Merge pull request #503 from fdesbiens/issue499
Added a missing symbol to tx_api.h for TX SMP.
2026-02-26 17:28:26 -05:00
Frédéric Desbiens c62ed82b1a Added a missing symbol to tx_api.h for TX SMP. 2026-02-26 17:22:25 -05:00
Frédéric DesbiensandGitHub 8f126ee414 Merge pull request #492 from akifejaz/qemu-virt-rv32
Added a RISC-V32 QEMU-virt example
2026-02-25 08:24:38 -05:00
Frédéric DesbiensandGitHub 0a0615ada3 Merge pull request #501 from akifejaz/rv64-gnu-port
Removed dead code from riscv64/gnu port
2026-02-25 08:23:49 -05:00
Frédéric DesbiensandGitHub 4de9be75e5 Merge pull request #490 from akifejaz/rv32-port
Added a RISC-V32 architecture port layer for GCC.
2026-02-24 11:06:03 -05:00
Frédéric DesbiensandGitHub 579246b4a2 Merge pull request #494 from spir6s/master
Added missing ULONG64 definition for RX ports needed by USBX and NetX Duo
2026-02-05 09:52:58 -05:00
Frédéric DesbiensandGitHub 0b0f1d0911 Merge pull request #496 from akifejaz/rv64-gnu-port
Improved RV64/GNU port robustness, portability, and CSR handling
2026-02-05 09:50:08 -05:00
Frédéric DesbiensandGitHub 4b6e8100d9 Merge commit from fork
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
Fix: Return 0u when no counters available
2026-01-09 09:38:16 -05:00
Frédéric DesbiensandGitHub a9b31c3102 Merge pull request #495 from eclipse-threadx/dev
Merge changes ahead of the v6.4.5.202504 release
2026-01-09 09:36:27 -05:00
Frédéric DesbiensandGitHub 5c58767c5d Updated the version number 2026-01-09 09:33:14 -05:00
Frédéric DesbiensandGitHub d24ef8db37 Updated the version number 2026-01-09 09:31:57 -05:00
Frédéric DesbiensandGitHub 44fadf7143 Merge pull request #478 from ayedm1/fix_typo
fix typo TX_BYTE_POOL_DELAY_VALUE  instead of TX_BTYE_POOL_DELAY_VALUE
2025-11-27 17:05:17 -05:00
Frédéric DesbiensandGitHub c4ad279b85 Merge pull request #468 from eclipse-threadx/dev
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
Merge changes included in the v6.4.3.202503 release.
2025-09-28 23:22:13 +01:00
Frédéric Desbiens 8a744afc1c Updated version number and added build and hotfix. 2025-09-28 23:19:17 +01:00
Frédéric DesbiensandGitHub 09751d08c5 Merge pull request #467 from eclipse-threadx/smp-test-fix
Completed the implementation of a configurable queue max size.
2025-09-28 23:07:00 +01:00
Frédéric Desbiens b8530b59eb Added missing check for TX_QUEUE_MESSAGE_MAX_SIZE. 2025-09-28 22:53:58 +01:00
Frédéric Desbiens 1f59529034 Added missing QUEUE_MESSAGE_MAX_SIZE test for SMP. 2025-09-28 22:34:15 +01:00
Frédéric DesbiensandGitHub ea408ebe52 Merge commit from fork
Fixed pointer validation flaw and improper parameter check in syscall implementation
2025-09-28 21:23:20 +01:00
Frédéric DesbiensandGitHub 372e71ffc6 Merge commit from fork
Fixed issue where thread could get a higher priority than the module's value for max priority.
2025-09-28 21:15:19 +01:00
Frédéric DesbiensandGitHub ca7589ce4a Merge pull request #463 from ericminnerath/fix-iar-include
Fix IAR include typo.
2025-09-21 16:50:09 -04:00
Frédéric DesbiensandGitHub a17fd83e94 Merge pull request #464 from gzzi/avoid-hang-check-stack
Do not analyze when stack overflow has occured.
2025-09-16 11:32:21 -04:00
Frédéric DesbiensandGitHub d22057ee89 Merge pull request #465 from eclipse-threadx/master
Port CI fixes to dev branch
2025-09-02 16:06:04 +01:00
Frédéric DesbiensandGitHub 12dac1d67d Merge pull request #457 from eclipse-threadx/ci-fixes-2
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
Fixed code coverage report download step in deploy_code_coverage.
2025-07-29 17:06:02 -04:00
Frédéric Desbiens 8616486d99 Fixed code coverage report download step in deploy_code_coverage. 2025-07-29 17:05:07 -04:00
Frédéric DesbiensandGitHub 1e109f0c35 Merge pull request #456 from eclipse-threadx/ci-fixes-2
Added condition to "Coverage Report Name". Corrected formatting.
2025-07-29 16:48:12 -04:00
Frédéric Desbiens 8e808e70f1 Added condition to "Coverage Report Name". Corrected formatting. 2025-07-29 16:46:45 -04:00
Frédéric DesbiensandGitHub 48c173cc11 Merge pull request #455 from eclipse-threadx/ci-fixes
Fixed code coverage artefacts upload
2025-07-29 16:27:14 -04:00
Frédéric Desbiens c00056bb78 Fixed code coverage artefacts upload 2025-07-29 16:23:08 -04:00
Frédéric DesbiensandGitHub acf2e57606 Merge pull request #454 from eclipse-threadx/ci-fixes
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
regression_test / tx (push) Has been cancelled
regression_test / smp (push) Has been cancelled
regression_test / deploy (push) Has been cancelled
Updated all actions to their latest release.
2025-07-17 19:52:34 -04:00
Frédéric Desbiens 754c348568 Updated all actions to their latest release.
Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
2025-07-17 19:51:12 -04:00
Frédéric DesbiensandGitHub 171af05ed1 Merge pull request #453 from eclipse-threadx/ci-fixes
Added workflow permissions.
2025-07-17 17:01:27 -04:00
Frédéric Desbiens b19b468e13 Added workflow permissions.
Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
2025-07-17 16:26:04 -04:00
Frédéric Desbiens 3128f18b30 Adding maintenance log.
Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
2025-07-17 09:18:42 -04:00
Frédéric Desbiens 3d6b65a7d3 Merged fixes for advisories GHSA-76hh-wrj5-hr2v and GHSA-wcfg-5jpf-hhxq provided by Bill Lamie. 2025-07-14 16:58:01 -04:00
Frédéric Desbiens da0985e748 Merged fix for advisory GHSA-w8rw-fqgj-9r49 provided by Bill Lamie. 2025-07-14 16:33:19 -04:00
Frédéric DesbiensandGitHub b2beb17046 Merge pull request #449 from hnguyenHWI/master
Document GNU library compile flags for Linux and SMP Linux
2025-05-21 09:41:15 -04:00
Frédéric DesbiensandGitHub 4fdc5dc0ae Merge pull request #447 from eclipse-threadx/implement_new_feature_424
Make queue max message size configurable
2025-04-15 08:46:53 -04:00
Frédéric DesbiensandGitHub 7ad78c40e9 Merge pull request #387 from netomi/patch-1
regression_test / tx (push) Has been skipped
regression_test / smp (push) Has been skipped
regression_test / deploy (push) Has been skipped
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
Add new label for all created issues, enforce the use of issue templates
2025-02-27 11:32:30 -05:00
Frédéric DesbiensandGitHub 06dabb0ad0 Merge pull request #442 from eclipse-threadx/dev
regression_test / tx (push) Has been skipped
regression_test / smp (push) Has been skipped
regression_test / deploy (push) Has been skipped
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
Release ThreadX 6.4.2
2025-02-24 15:43:49 -05:00
Frédéric DesbiensandGitHub f0a44ad391 Merge pull request #441 from eclipse-threadx/cmake-minimal-version
Updated CMake minimal version
2025-02-24 15:42:21 -05:00
Frédéric Desbiens 898d0ebfde Updated CMake minimal version to 3.13 2025-02-24 15:40:22 -05:00
Frédéric DesbiensandGitHub 880598c608 Merge pull request #439 from eclipse-threadx/version-642
Version 6.4.2
2025-02-24 13:53:56 -05:00
Frédéric Desbiens 41bdb2c6ba Updated version number to 6.4.2. 2025-02-24 13:46:37 -05:00
Frédéric Desbiens 376e26be29 Updated ports version to v6.4.2. 2025-02-24 13:31:48 -05:00
Frédéric Desbiens e4d517efba Merge remote-tracking branch 'origin/master' into dev 2025-02-24 10:56:06 -05:00
Frédéric DesbiensandGitHub 98c9172d01 Merge pull request #438 from eclipse-threadx/action-fixes
regression_test / tx (push) Has been skipped
regression_test / smp (push) Has been skipped
regression_test / deploy (push) Has been skipped
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
Upgrading upload-artifact version to 4.6.0.
2025-02-14 08:51:53 -05:00
Frédéric Desbiens 72ab369eb7 Upgrading upload-artifact version to 4.6.0. 2025-02-13 10:58:58 -05:00
Frédéric DesbiensandGitHub e657568041 Merge pull request #416 from Jer6y/master
riscv : add riscv qemu virt support and fix fs bit error in mstatus
2025-02-13 09:58:54 -05:00
Frédéric DesbiensandGitHub 6bef7c08f6 Merge pull request #407 from eclipse-threadx/dependabot/github_actions/dot-github/workflows/actions/download-artifact-4.1.7
regression_test / tx (push) Has been skipped
regression_test / smp (push) Has been skipped
regression_test / deploy (push) Has been skipped
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows
2025-01-27 09:10:46 -05:00
Frédéric DesbiensandGitHub c805ac7ec0 Merge branch 'master' into dependabot/github_actions/dot-github/workflows/actions/download-artifact-4.1.7 2025-01-27 09:09:57 -05:00
Frédéric DesbiensandGitHub af3c1e7245 Merge pull request #423 from spir6s/master
regression_test / tx (push) Has been skipped
regression_test / smp (push) Has been skipped
regression_test / deploy (push) Has been skipped
cortex_m / Cortex M0 build (push) Has been cancelled
cortex_m / Cortex M3 build (push) Has been cancelled
cortex_m / Cortex M4 build (push) Has been cancelled
cortex_m / Cortex M7 build (push) Has been cancelled
Added missing CMakeLists.txt for Renesas RX ports
2025-01-13 10:18:32 -05:00