Skip to content

Add TI Arm Clang Compiler Support to CMSIS Core Validation#282

Merged
JonatanAntoni merged 18 commits intoARM-software:mainfrom
smmasongt:feature/core-validation-ti-support
Apr 14, 2026
Merged

Add TI Arm Clang Compiler Support to CMSIS Core Validation#282
JonatanAntoni merged 18 commits intoARM-software:mainfrom
smmasongt:feature/core-validation-ti-support

Conversation

@smmasongt
Copy link
Copy Markdown
Contributor

@smmasongt smmasongt commented Feb 20, 2026

Update build scripts to utilize TI Arm Clang Compiler in Core Validation:

  • Adds Clang_TI option to build script.
  • Updates GitHub workflows to include Clang_TI
  • Adds new filter for TI supported devices.
  • Adds new filter for Core Validation supported devices to replace commented code.
  • Updates CMSIS Toolbox files for TI supported devices to specify regions files for TI Arm Clang Compiler.
  • Removes older TI linker command files and replaces them with updated versions.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 20, 2026

Test Results

   292 files   -    352     292 suites   - 352   0s ⏱️ - 13m 9s
    56 tests +     7      54 ✅ +   10      2 💤  -     3  0 ❌ ±0 
15 768 runs   - 15 788  13 264 ✅  - 6 892  2 504 💤  - 8 896  0 ❌ ±0 

Results for commit 64c2c8a. ± Comparison against base commit 593be3a.

This pull request removes 49 and adds 56 tests. Note that renamed tests count towards both.
CMSIS-Core.src ‑ apsr.c
CMSIS-Core.src ‑ basepri.c
CMSIS-Core.src ‑ bkpt.c
CMSIS-Core.src ‑ clrex.c
CMSIS-Core.src ‑ clz.c
CMSIS-Core.src ‑ control.c
CMSIS-Core.src ‑ cp15.c
CMSIS-Core.src ‑ cpsr.c
CMSIS-Core.src ‑ dmb.c
CMSIS-Core.src ‑ dsb.c
…
TC_CML1Cache_CleanDCacheByAddrWhileDisabled
TC_CML1Cache_EnDisableDCache
TC_CML1Cache_EnDisableICache
TC_CoreFunc_APSR
TC_CoreFunc_BASEPRI
TC_CoreFunc_Control
TC_CoreFunc_EnDisIRQ
TC_CoreFunc_EncDecIRQPrio
TC_CoreFunc_FAULTMASK
TC_CoreFunc_FPSCR
…
This pull request removes 5 skipped tests and adds 2 skipped tests. Note that renamed tests count towards both.
CMSIS-Core.src ‑ lda.c
CMSIS-Core.src ‑ ldaex.c
CMSIS-Core.src ‑ stl.c
CMSIS-Core.src ‑ stlex.c
CMSIS-Core.src ‑ systick.c
TC_CoreInstr_WFE
TC_CoreInstr_WFI

♻️ This comment has been updated with latest results.

@JonatanAntoni
Copy link
Copy Markdown
Member

If we want TI Clang CoreValidation tests to be executed in GitHub CI, please consider updating corevalidation.yml workflow.

@smmasongt
Copy link
Copy Markdown
Contributor Author

Updated corevalidation.yml to add Clang_TI to the compiler matrix.

@smmasongt
Copy link
Copy Markdown
Contributor Author

Hello @JonatanAntoni , I spent some time looking at how we could get the TI compiler in the workflow without a package manager. One option is to include a step which consists of a generic downloader for pulling the TI compiler installer from their public website and then installing it. It would be quite resource intensive though (285 MB download / 1GB+ installed). I looked at the GCC vcpkg and it was a similar size, so maybe this is not an issue. Do you have any thoughts on the approach, or possibly a better way to solve the problem?

@JonatanAntoni
Copy link
Copy Markdown
Member

Hello @JonatanAntoni , I spent some time looking at how we could get the TI compiler in the workflow without a package manager. One option is to include a step which consists of a generic downloader for pulling the TI compiler installer from their public website and then installing it. It would be quite resource intensive though (285 MB download / 1GB+ installed). I looked at the GCC vcpkg and it was a similar size, so maybe this is not an issue. Do you have any thoughts on the approach, or possibly a better way to solve the problem?

No better solution. I think we might cache the install folder with an additional cache step so that the download is skipped. We need to watch the cache size. I.e., the required steps may be:

  • Restore from cache (version, os)
  • Download from remote and extract (if cache missed)
  • Enrich the env ($GITHUB_ENV) with CLANG_TI_TOOLCHAIN_5_0_0 variable

@smmasongt smmasongt force-pushed the feature/core-validation-ti-support branch from c638e2b to 4baf587 Compare March 8, 2026 20:00
@smmasongt
Copy link
Copy Markdown
Contributor Author

@JonatanAntoni I've updated both the Core and CoreValidation workflow routines to bring the TI compiler into the workflow. Could you please review and let me know if this is an acceptable solution? There is an issue with running the Fast Models with the Clang_TI .elf but it will be difficult to troubleshoot without a local license. Maybe you can take a look at that as well. I imagine it's a problem with the linker scripts.

@KeilChris
Copy link
Copy Markdown
Collaborator

@smmasongt, I can get you a license to test this.

@smmasongt
Copy link
Copy Markdown
Contributor Author

smmasongt commented Mar 9, 2026

@smmasongt, I can get you a license to test this.

@KeilChris That would be great. I'll be on travel this week and won't have access to my development environment, but we can coordinate on the license so I can test when I get back.

@JonatanAntoni
Copy link
Copy Markdown
Member

@smmasongt, you could check if the MDK Community Edition is already sufficient for your analysis:

> armlm --server https://mdk-preview.keil.arm.com --product KEMDK-COM0 

armlm is part of Arm Compiler for example, which gets installed via vcpkg.

Revert changes as these changes are in separate pull request.
@smmasongt
Copy link
Copy Markdown
Contributor Author

@smmasongt, you could check if the MDK Community Edition is already sufficient for your analysis:

> armlm --server https://mdk-preview.keil.arm.com --product KEMDK-COM0 

armlm is part of Arm Compiler for example, which gets installed via vcpkg.

Thank you. I will try this out.

@smmasongt
Copy link
Copy Markdown
Contributor Author

@JonatanAntoni I was able to get the MDK community edition license to work. I needed to use a slightly updated command format from here.

armlm activate -product KEMDK-COM0 -server https://mdk-preview.keil.arm.com

I don't see any obvious errors in the output. Maybe it's a problem with semihosting support.

/CMSIS/CoreValidation/Project$ python3 build.py -c Clang_TI -d CM4 -o none build run --verbose
[Clang_TI][Cortex-M4][none](build) Compiling Tests...
[Clang_TI][Cortex-M4][none](build:cbuild) /opt/cmsis-toolbox/cmsis-toolbox-linux-amd64/bin/cbuild --toolchain CLANG_TI --update-rte --context .none+CM4 Validation.csolution.yml
[Clang_TI][Cortex-M4][none](build:cbuild) +--------------------------------------------
[Clang_TI][Cortex-M4][none](build:cbuild) (1/1) Building context: "Validation.none+CM4"
[Clang_TI][Cortex-M4][none](build:cbuild) Using CLANG_TI V5.0.0 compiler, from: '/opt/ti-arm-clang/ti-cgt-armllvm_5.0.0.STS/bin'
[Clang_TI][Cortex-M4][none](build:cbuild) Building CMake target 'Validation.none+CM4'
[Clang_TI][Cortex-M4][none](build:cbuild) [1/1] Linking C executable /home/sm/git/smmasongt-cmsis-6/CMSIS/CoreValidation/Project/build/CM4/CLANG_TI/none/Validation/outdir/Validation.elf
[Clang_TI][Cortex-M4][none](build:cbuild) tiarmclang: warning: argument unused during compilation: '--specs=rdimon.specs' [-Wunused-command-line-argument]
[Clang_TI][Cortex-M4][none](build:cbuild) "/home/sm/git/smmasongt-cmsis-6/CMSIS/CoreValidation/Project/tmp/1/clang_ti_linker_script.cmd", line 22: warning:
[Clang_TI][Cortex-M4][none](build:cbuild) LOAD placement ignored for ".stack": object is uninitialized
[Clang_TI][Cortex-M4][none](build:cbuild) +------------------------------------------------------------
[Clang_TI][Cortex-M4][none](build:cbuild) Build summary: 1 succeeded, 0 failed - Time Elapsed: 00:00:00
[Clang_TI][Cortex-M4][none](build:cbuild) +============================================================
[Clang_TI][Cortex-M4][none](build:cbuild) /opt/cmsis-toolbox/cmsis-toolbox-linux-amd64/bin/cbuild succeeded with exit code 0
[Clang_TI][Cortex-M4][none](build) Archiving build output to build/CoreValidation-Clang_TI-none-CM4-20260318233901.zip...
[Clang_TI][Cortex-M4][none](run) Running Core Validation on Arm model ...
[Clang_TI][Cortex-M4][none](run:model_exec) /opt/avh-fvp-bin_11.22.39/avh-linux-x86/bin/FVP_MPS2_Cortex-M4 -q --simlimit 100 -f ../Layer/Target/CM4/model_config.txt -a build/CM4/CLANG_TI/none/Validation/outdir/Validation.elf
[Clang_TI][Cortex-M4][none](run:model_exec) telnetterminal0: Listening for serial connection on port 5000
[Clang_TI][Cortex-M4][none](run:model_exec) telnetterminal1: Listening for serial connection on port 5001
[Clang_TI][Cortex-M4][none](run:model_exec) telnetterminal2: Listening for serial connection on port 5002
[Clang_TI][Cortex-M4][none](run:model_exec) Info: Simulation is stopping. Reason: Simulated time has been exceeded.
[Clang_TI][Cortex-M4][none](run:model_exec) Info: /OSCI/SystemC: Simulation stopped by user.
[Clang_TI][Cortex-M4][none](run:model_exec) /opt/avh-fvp-bin_11.22.39/avh-linux-x86/bin/FVP_MPS2_Cortex-M4 succeeded with exit code 0
[Clang_TI][Cortex-M4][none](run) No valid test report found in model output!

@JonatanAntoni
Copy link
Copy Markdown
Member

Sorry, I indeed missed the activate command 🫣

Such "errors" are typically hard to grab. I see two major points we need to check:

  1. Is Semihosting properly activated via compiler and linker flags?
  2. Does the test actually run or does it getting stuck somewhere, such as a fault trap?

You could try to use Arm Debugger extension in VS Code to connect to the running model and check what actually gets executed.

@smmasongt
Copy link
Copy Markdown
Contributor Author

@JonatanAntoni Update on this PR. Thanks for the guidance on the Arm Debugger. I was able to get it up and running. The issue appears to be related to lack of semihosting support in the TI compiler. I was able to trace all the way to the BKPT instruction in the Clang build. However, the TI libraries seem to use a proprietary host interface for their debuggers. There are some semihost files in their libraries, but I don't see a convenient way to stub them in via a linker command like PicoLibc.

@JonatanAntoni
Copy link
Copy Markdown
Member

@smmasongt, without more details I can't recap what it going on. For a semihosting build I'd expect all printf calls to end up in a bkpt #0xab instruction (on Armv8-M). The fast model used for execution shall catch this special breakpoint and run the semihosted part of the standard io function on the host, i.e., dump the printf output to the console.

Maybe having Arm Debugger connected to the model messes up the whole story. You could try to run other compilers (such as LLVM/Clang or GCC) for comparison.

@smmasongt
Copy link
Copy Markdown
Contributor Author

Notes for latest commit on 2026/03/29.

References

This commit implements a semi-custom semihosting solution for TI Arm Clang Compiler based on source files provided with the compiler package. I could not find another convenient method to implement it via supported librariers and linker options. Also added linker commands to create CMSE veneers and link them properly per the compiler users guide.

This update also upgraded the CI workflow compiler to the latest LTS version (v5.1.0).

@JonatanAntoni
Copy link
Copy Markdown
Member

@smmasongt, looks like you made it. Congrats and thanks for your efforts.

I am a bit puzzled about the amount of code required for getting TI Clang to emit proper semi-hosted printf output. This adds some imbalance to the code compared to all other compilers.

So far, we relied on standard libs for semi-hosting support. And all further I/O retargeting for compilers is done in https://github.com/ARM-software/CMSIS-Compiler.
Of course, that won't help us much as we rely on semi-hosting printf output during the tests.

Let me have some additional checks and gather more feedback.

@smmasongt
Copy link
Copy Markdown
Contributor Author

Yes, it's not an elegant solution. I'm also a bit puzzled as to why the order you pass the executables to the Fast Model varies between compilers.

TI's version of semihosting may make sense since they have been developing proprietary cores and debuggers for a very long time, so a processor core agnostic solution is beneficial. If you are using Code Composer Studio and TI's debugger, you'll get a print to console whether you are using an old DSP core or a new Arm core.

It's probably also important to keep in mind that if you are using Code Composer Studio, and by extension TI Arm Clang Compiler, you probably won't be implementing full-stack CMSIS. It would be better to move to Keil or IAR for that. A more likely use case is just using CMSIS-DSP in a CCS project (since TI provides an outdated version). To get CMSIS-DSP running the Core compiler includes have to be functional for Cortex-M and Cortex-R. If Core Test and Core Validation can ensure there are no issues with the includes, that may be good enough for a lot of use cases.

@JonatanAntoni
Copy link
Copy Markdown
Member

The order in which we are passing the elf files to the model executable affects the starting point. I.e., models do not read the initial PC value from the vector table like physical devices do but rely on the ELF start address property.

@smmasongt
Copy link
Copy Markdown
Contributor Author

Thanks for the explanation. I'll look at the linker command files and output maps again.

@smmasongt
Copy link
Copy Markdown
Contributor Author

I'm having trouble using the ARM Debugger with multiple .elf's, but I was able to add print statements to the bootloader and it confirms there is probably an error with my CMSE implementation. I'll continue to investigate.

@smmasongt
Copy link
Copy Markdown
Contributor Author

smmasongt commented Apr 13, 2026

Latest updates:

  • Corrected critical errors in linker file that were exposed in the Cortex M33 Trust Zone tests. These included incorrect entry point and vector table mapping.
  • Performed AI review on linker command files and incorporated several improvements including removal of error prone manually calculated symbol values.
  • Reverted several unnecessary changes in the CMSIS Toolbox configuration files.
  • Performed AI review on GitHub workflow file and made minor updates.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds TI Arm Clang (Clang_TI) as a supported toolchain for CMSIS CoreValidation builds/runs, including TI-specific semihosting output and linker scripts, and wires the new compiler into CI and documentation.

Changes:

  • Add Clang_TI compiler option to the CoreValidation build matrix and update CI to install/use the TI Arm Clang toolchain.
  • Introduce TI Arm Clang semihosting support and route CoreValidation report output through it when building with TI’s clang.
  • Add TI Arm Clang linker command files per Cortex-M target and update layer linker selections; remove older TI linker cmd files.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
CMSIS/CoreValidation/Source/CV_Report.c Adds TI-clang-specific semihosted printing path.
CMSIS/CoreValidation/Source/Clang_TI_Semihost/clang_ti_semihost.h New TI semihosting API + trap helper definition.
CMSIS/CoreValidation/Source/Clang_TI_Semihost/clang_ti_semihost.c New TI semihosting-backed vprintf implementation (+ optional FM init for v8-R).
CMSIS/CoreValidation/README.md Documents Clang_TI support and required toolchain install/registration.
CMSIS/CoreValidation/Project/build.py Adds Clang_TI, expands device axis entries/filters, and tweaks model execution parameters.
CMSIS/CoreValidation/Layer/App/Validation_Cortex-M/App.clayer.yml Adds include path and source group for TI semihost support under CLANG_TI.
CMSIS/CoreValidation/Layer/Target/CM0/Target.clayer.yml Adds CLANG_TI linker script selection.
CMSIS/CoreValidation/Layer/Target/CM0/RTE/Device/ARMCM0/tiac_arm.cmd Removes legacy TI linker cmd.
CMSIS/CoreValidation/Layer/Target/CM0/RTE/Device/ARMCM0/clang_ti_linker_script.cmd Adds new TI Arm Clang linker command file.
CMSIS/CoreValidation/Layer/Target/CM0plus/Target.clayer.yml Adds CLANG_TI linker script selection.
CMSIS/CoreValidation/Layer/Target/CM0plus/RTE/Device/ARMCM0P/tiac_arm.cmd Removes legacy TI linker cmd.
CMSIS/CoreValidation/Layer/Target/CM0plus/RTE/Device/ARMCM0P/clang_ti_linker_script.cmd Adds new TI Arm Clang linker command file.
CMSIS/CoreValidation/Layer/Target/CM3/Target.clayer.yml Adds CLANG_TI linker script selection.
CMSIS/CoreValidation/Layer/Target/CM3/RTE/Device/ARMCM3/tiac_arm.cmd Removes legacy TI linker cmd.
CMSIS/CoreValidation/Layer/Target/CM3/RTE/Device/ARMCM3/clang_ti_linker_script.cmd Adds new TI Arm Clang linker command file.
CMSIS/CoreValidation/Layer/Target/CM4/Target.clayer.yml Adds CLANG_TI linker script selection.
CMSIS/CoreValidation/Layer/Target/CM4/RTE/Device/ARMCM4/tiac_arm.cmd Removes legacy TI linker cmd.
CMSIS/CoreValidation/Layer/Target/CM4/RTE/Device/ARMCM4/clang_ti_linker_script.cmd Adds new TI Arm Clang linker command file.
CMSIS/CoreValidation/Layer/Target/CM33/Target.clayer.yml Adds CLANG_TI linker script selection.
CMSIS/CoreValidation/Layer/Target/CM33/RTE/Device/ARMCM33/clang_ti_linker_script.cmd Adds new TI Arm Clang linker command file.
CMSIS/CoreValidation/Layer/Target/CM33S/Target.clayer.yml Adds CLANG_TI linker script selection.
CMSIS/CoreValidation/Layer/Target/CM33S/RTE/Device/ARMCM33/clang_ti_linker_script.cmd Adds new TI Arm Clang linker command file.
CMSIS/CoreValidation/Layer/Target/CM33NS/Target.clayer.yml Adds CLANG_TI linker script selection.
CMSIS/CoreValidation/Layer/Target/CM33NS/RTE/Device/ARMCM33/clang_ti_linker_script.cmd Adds new TI Arm Clang linker command file.
CMSIS/CoreValidation/Layer/Target/CM23S/RTE/Device/ARMCM23/ARMCM23_ac6.sct.base@1.1.0 Removes unused/legacy AC6 scatter template.
CMSIS/CoreValidation/Layer/Target/CM23S/RTE/Device/ARMCM23/ARMCM23_ac6.sct Removes unused/legacy AC6 scatter file.
.github/workflows/corevalidation.yml Adds Clang_TI to CI matrix and installs/caches TI Arm Clang toolchain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JonatanAntoni
Copy link
Copy Markdown
Member

@smmasongt, looks very good! Thank you very much. I think we shall get this merged and add enhancements from there. Before actually merging, could you please glance over the Copilot remarks? I think these are minor issues but mayby worth to have them cleaned.

smmasongt and others added 3 commits April 13, 2026 19:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@smmasongt
Copy link
Copy Markdown
Contributor Author

@JonatanAntoni I believe all Copilot comments have been addressed. Thanks for all your help and guidance with this PR. Some possible interesting future enhancements:

  • Add Cortex-R and Cortex-A models to Core Validation if Arm makes them available.
  • Add Trust Zone NSC veneers to validation program.

@JonatanAntoni JonatanAntoni merged commit fd7e494 into ARM-software:main Apr 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants