Skip to content

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

Open
smmasongt wants to merge 6 commits intoARM-software:mainfrom
smmasongt:feature/core-validation-ti-support
Open

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

Conversation

@smmasongt
Copy link
Contributor

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

  • Adds Clang_TI option to build script.
  • Adds new filter for TI supported devices.
  • Adds new filter for Core Validation supported devices to replace commented code.
  • Updates Target.clayer.yml files for TI supported devices to specify regions files for TI Arm Clang Compiler.
  • Removes older TI linker command files.

Note 1: I was unable able to verify the "run" portion of the build script due to license issues with the Fast Models. This needs to be tested to ensure compiler and linker scripts perform as expected.

Note 2: This update relies on the common linker script in the CMSIS Toolbox devtools. This file needs to be patched for the build to work. For testing the 'clang_ti_linker_script.cmd.src` script can be temporarily updated with the following commands:

--stack_size=__STACK_SIZE
--heap_size=__HEAP_SIZE
--symbol_map=_start=_c_int00

#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
#define __STACKSEAL_SIZE 8
#else
#define __STACKSEAL_SIZE 0
#endif

#if defined (__ROM0_BASE)
__stack = __ROM0_BASE + __ROM0_SIZE - __STACKSEAL_SIZE - 1;
__stack_seal = __ROM0_BASE + __ROM0_SIZE - __STACKSEAL_SIZE - 1;
__stack_limit = __ROM0_BASE + __ROM0_SIZE - __STACKSEAL_SIZE - __STACK_SIZE;
#define __STACK_ADDR (__ROM0_BASE + __ROM0_SIZE - __STACKSEAL_SIZE - 1)
#define __STACK_LIMIT_ADDR (__ROM0_BASE + __ROM0_SIZE - __STACKSEAL_SIZE - __STACK_SIZE)
#else
__stack = __ROM_BASE + __ROM_SIZE - __STACKSEAL_SIZE - 1;
__stack_seal = __ROM_BASE + __ROM_SIZE - __STACKSEAL_SIZE - 1;
__stack_limit = __ROM_BASE + __ROM_SIZE - __STACKSEAL_SIZE - __STACK_SIZE;
#define __STACK_ADDR (__ROM_BASE + __ROM_SIZE - __STACKSEAL_SIZE - 1)
#define __STACK_LIMIT_ADDR (__ROM_BASE + __ROM_SIZE - __STACKSEAL_SIZE - __STACK_SIZE)
#endif

MEMORY
{
#if defined (__ROM0_BASE)
ROM0 : ORIGIN = __ROM0_BASE, LENGTH = __ROM0_SIZE
#else
ROM0 : ORIGIN = __ROM_BASE, LENGTH = __ROM_SIZE
#endif

#if defined (__ROM1_BASE)
ROM1 : ORIGIN = __ROM1_BASE, LENGTH = __ROM1_SIZE
#endif

#if defined (__RAM0_BASE)
RAM0 : ORIGIN = __RAM0_BASE, LENGTH = __RAM0_SIZE
#else
RAM0 : ORIGIN = __RAM_BASE, LENGTH = __RAM_SIZE
#endif

#if defined (__RAM1_BASE)
RAM1 : ORIGIN = __RAM1_BASE, LENGTH = __RAM1_SIZE
#endif
}

SECTIONS
{
.vectors: 0x00000000
.cinit: palign=4 {} > ROM0
.pinit: palign=4 {} > ROM0

.text: palign=4 {} > ROM0
.const: palign=4 {} > ROM0
.rodata: palign=4 {} > ROM0

.data: palign=4 {} > RAM0
.bss: type=NOINIT, palign=4 {} > RAM0

.stack: run=__STACK_LIMIT_ADDR, type=NOLOAD {} > RAM0

#if __STACKSEAL_SIZE > 0
.stackseal: run=__STACK_ADDR, type=NOLOAD {} > RAM0
#endif
}

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Test Results

   264 files   -    300     264 suites   - 300   0s ⏱️ - 12m 24s
    56 tests +     7      54 ✅ +   10      2 💤  -     3  0 ❌ ±0 
14 292 runs   - 13 344  12 124 ✅  - 4 580  2 168 💤  - 8 764  0 ❌ ±0 

Results for commit 1fa9350. ± Comparison against base commit fdbbc52.

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
Member

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

@smmasongt
Copy link
Contributor Author

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

@smmasongt
Copy link
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
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
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
Collaborator

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

@smmasongt
Copy link
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
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
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.

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.

3 participants