Add TI Arm Clang Compiler Support to CMSIS Core Validation#282
Add TI Arm Clang Compiler Support to CMSIS Core Validation#282smmasongt wants to merge 10 commits intoARM-software:mainfrom
Conversation
Test Results 292 files - 272 292 suites - 272 0s ⏱️ - 12m 24s Results for commit d5d4cde. ± Comparison against base commit fdbbc52. This pull request removes 49 and adds 56 tests. Note that renamed tests count towards both.This pull request removes 5 skipped tests and adds 2 skipped tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
|
If we want TI Clang CoreValidation tests to be executed in GitHub CI, please consider updating |
|
Updated |
|
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:
|
c638e2b to
4baf587
Compare
|
@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 |
|
@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. |
|
@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
|
Revert changes as these changes are in separate pull request.
Thank you. I will try this out. |
|
@JonatanAntoni I was able to get the MDK community edition license to work. I needed to use a slightly updated command format from here.
I don't see any obvious errors in the output. Maybe it's a problem with semihosting support.
|
|
Sorry, I indeed missed the Such "errors" are typically hard to grab. I see two major points we need to check:
You could try to use Arm Debugger extension in VS Code to connect to the running model and check what actually gets executed. |
|
@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 |
|
@smmasongt, without more details I can't recap what it going on. For a semihosting build I'd expect all 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. |
|
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). |
|
@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. Let me have some additional checks and gather more feedback. |
|
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. |
|
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 |
|
Thanks for the explanation. I'll look at the linker command files and output maps again. |
|
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. |
Update build scripts to utilize TI Arm Clang Compiler in Core Validation:
Clang_TIoption to build script.Target.clayer.ymlfiles for TI supported devices to specify regions files for TI Arm Clang Compiler.