This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952: TI Tool "mklib" for custom Hercules Target Arm C/C++ and RTS does not work for CCS 12.6.0 and 20.2.7.LTS

Part Number: RM48L952

Tool/software:

When I follow the instructions in the TI Compiler manual for ARM 20.2.7.LTS to build a custom library for Hercules RM48L952 chip, the process fails.

--> It seems the that the TI tool "mklib" cannot find the compiler tools, even though the directory is listed in the path.  The error message says that "armcl: not found", even though the tools seem to be in the correct directory and the directory is listed in $PATH environment variable:

kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin$ echo $PATH | grep "ti-cgt-arm_20.2.7.LTS/bin"
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/WindowsApps/MicrosoftCorporationII.WindowsSubsystemForLinux_2.1.5.0_x64__8wekyb3d8bbwe:/mnt/c/SynaptiCAD/bin/win32:/mnt/c/Program Files/Python312/Scripts/:/mnt/c/Program Files/Python312/:/mnt/c/Program Files/VanDyke Software/Clients/:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/010 Editor:/mnt/c/Program Files/Graphviz/bin:/mnt/c/Program Files/WinMerge:/mnt/c/Program Files/dotnet/:/mnt/c/SynaptiCAD/bin:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Strawberry/c/bin:/mnt/c/Strawberry/perl/site/bin:/mnt/c/Strawberry/perl/bin:/mnt/c/Program Files (x86)/HP/Common/HPDestPlgIn/:/mnt/c/Program Files/PuTTY/:/mnt/c/Users/Kip_Leitner/AppData/Local/Programs/Python/Python311/Scripts/:/mnt/c/Users/Kip_Leitner/AppData/Local/Programs/Python/Python311/:/mnt/c/Users/Kip_Leitner/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files (x86)/Nmap:/mnt/c/Users/Kip_Leitner/AppData/Local/Programs/MiKTeX/miktex/bin/x64/:/mnt/c/Users/Kip_Leitner/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/Kip_Leitner/Documents/Software/Arm_Compiler/w64-i686/arm-gnu-toolchain-12.3.rel1-mingw-w64-i686-arm-none-eabi/bin:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib:/mnt/c/ti/ccs1240/ccs/utils/cygwin:/mnt/c/ti/ccs1240/ccs/utils/bin:/mnt/c/Users/Kip_Leitner/Documents/_cmds:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin:/mnt/c/Program Files/ArmCompilerforEmbeddedFuSa6.16.2/bin:/mnt/c/Program Files (x86)/HP/Common/HPDestPlgIn/:/snap/bin

kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin$ ll
total 71160
drwxrwxrwx 1 kleitner kleitner     4096 Jun 11 16:10 ./
drwxrwxrwx 1 kleitner kleitner     4096 Jun  4 16:59 ../
-rwxrwxrwx 1 kleitner kleitner  1086584 Aug  7  2022 armabs.exe*
-rwxrwxrwx 1 kleitner kleitner  5353584 Aug  7  2022 armacpia.exe*
-rwxrwxrwx 1 kleitner kleitner  1883760 Aug  7  2022 armadv.exe*
-rwxrwxrwx 1 kleitner kleitner  1036408 Aug  7  2022 armar.exe*
-rwxrwxrwx 1 kleitner kleitner  2187888 Aug  7  2022 armasm.exe*
-rwxrwxrwx 1 kleitner kleitner  7891568 Aug  7  2022 armcg.exe*
-rwxrwxrwx 1 kleitner kleitner  2589808 Aug  7  2022 armcl.exe*
-rwxrwxrwx 1 kleitner kleitner   344696 Aug  7  2022 armclist.exe*
-rwxrwxrwx 1 kleitner kleitner   505968 Aug  7  2022 armdem.exe*
-rwxrwxrwx 1 kleitner kleitner  1230448 Aug  7  2022 armdis.exe*
-rwxrwxrwx 1 kleitner kleitner  1281648 Aug  7  2022 armembed.exe*
-rwxrwxrwx 1 kleitner kleitner  1624688 Aug  7  2022 armhex.exe*
-rwxrwxrwx 1 kleitner kleitner  2796144 Aug  7  2022 armilk.exe*
-rwxrwxrwx 1 kleitner kleitner  1418872 Aug  7  2022 armlibinfo.exe*
-rwxrwxrwx 1 kleitner kleitner  4849264 Aug  7  2022 armlnk.exe*
-rwxrwxrwx 1 kleitner kleitner  1126000 Aug  7  2022 armnm.exe*
-rwxrwxrwx 1 kleitner kleitner  3650160 Aug  7  2022 armobjcopy.exe*
-rwxrwxrwx 1 kleitner kleitner  6099568 Aug  7  2022 armobjdump.exe*
-rwxrwxrwx 1 kleitner kleitner  1609840 Aug  7  2022 armofd.exe*
-rwxrwxrwx 1 kleitner kleitner 10645624 Aug  7  2022 armopt.exe*
-rwxrwxrwx 1 kleitner kleitner  1270904 Aug  7  2022 armpdd.exe*
-rwxrwxrwx 1 kleitner kleitner  1252976 Aug  7  2022 armpprof.exe*
-rwxrwxrwx 1 kleitner kleitner  5690480 Aug  7  2022 armreadelf.exe*
-rwxrwxrwx 1 kleitner kleitner  3163768 Aug  7  2022 armsize.exe*
-rwxrwxrwx 1 kleitner kleitner  1082488 Aug  7  2022 armstrip.exe*
-rwxrwxrwx 1 kleitner kleitner  1132664 Aug  7  2022 armxref.exe*

The process we are supposed to follow used TI CCS VERSION 5, which is many years old.  There are mistakes in the Compiler manual.

The process is described in section 7.4 of TI document spnu151w.pdf

Here is the history of what I did, including error message at the end.  I am using Ubuntu 22.04 LTS installed as type 2 Windows System Linux ("WSL"), Windows 10.

kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS$ ll
total 468
drwxrwxrwx 1 kleitner kleitner   4096 Jun  4 16:59 ./
drwxrwxrwx 1 kleitner kleitner   4096 Jan 19 17:48 ../
-rwxrwxrwx 1 kleitner kleitner  73350 Aug  7  2022 ARM_RTS_20.2.7.LTS_manifest.html*
-rwxrwxrwx 1 kleitner kleitner 294487 Aug  7  2022 ARM_RTS_20_2_0_LTS_398fd574-6305-440f-a001-432098e8e134.spdx*
-rwxrwxrwx 1 kleitner kleitner  74788 Aug  7  2022 README.html*
drwxrwxrwx 1 kleitner kleitner   4096 Jun 11 16:10 bin/
drwxrwxrwx 1 kleitner kleitner   4096 Aug 25  2023 include/
drwxrwxrwx 1 kleitner kleitner   4096 Jun 11 16:18 lib/
drwxrwxrwx 1 kleitner kleitner   4096 Aug 25  2023 man/
-rwxrwxrwx 1 kleitner kleitner  31334 Aug  7  2022 misra.txt*

kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ which sh
/usr/bin/sh
kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ which bash
/usr/bin/bash
kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ which make
/usr/bin/make
kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ which gmake
/usr/bin/gmake
kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ make -v
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <gnu.org/.../gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ gmake -v
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <gnu.org/.../gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ cat mklib_Islander.sh
#!/bin/bash

PATTERN="--pattern=rtsv7R4_A_le_v3D16_eabi.lib"
EXTRA_OPTIONS="--extra_options=\"g\""
COMPILER_BIN_DIR="--compiler_bin_dir=/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin"
INDEX="--index=/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib/lib" #note the "lib/lib" kludge
NAME="--name=rtsv7R4_A_le_v3D16_eabi_debug.lib"
INSTALL_TO="--install_to /mnt/c/Users/Kip_Leitner/workspace_v12/Config_01_POC/Debug"
VERBOSE="--verbose"

mklib $PATTERN $EXTRA_OPTIONS $COMPILER_BIN_DIR $INDEX $NAME $INSTALL_TO $VERBOSE

exit 0


kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$ ./mklib_Islander.sh
Building /mnt/c/Users/Kip_Leitner/workspace_v12/Config_01_POC/Debug/rtsv7R4_A_le_v3D16_eabi_debug.lib from pattern rtsv7R4_A_le_v3D16_eabi.lib
Work directory : /tmp/TI_MKLIBo2VAxr
mkdir /tmp/TI_MKLIBo2VAxr
mkdir /tmp/TI_MKLIBo2VAxr/OBJ
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/AUTOSAR31
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/libcxx
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/libcxx/ext
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/libcxx/include
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/libcxx/support/runtime
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/libcxx/support/ti
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/machine
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/stlport
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/sys
mkdir /tmp/TI_MKLIBo2VAxr/OBJ/xlocale
cd /mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib/src
/usr/bin/gmake -r -j 1 library CMD_FILE="/tmp/TI_MKLIBo2VAxr/_Makefile.cmd"
armcl dtor_list.c "g"  --fp_mode=strict --no_visible_enums --gen_func_subsections=on -mv7R4 --abi=eabi --float_support=vfpv3d16 -D_TI_USING_LIBCXX -me -c --ti_lib --keep_unneeded_types=false --diag_warning=225 --quiet -O4  --rtti -fg --building_runtime -DCHECKING=0 -I/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib/src -fe /tmp/TI_MKLIBo2VAxr/OBJ/dtor_list.c.obj -fs /tmp/TI_MKLIBo2VAxr/OBJ -ft /tmp/TI_MKLIBo2VAxr/OBJ -ppa -ppd=/tmp/TI_MKLIBo2VAxr/OBJ/dtor_list.c.pp
/usr/bin/sh: 1: armcl: not found
gmake: *** [Makefile:1931: /tmp/TI_MKLIBo2VAxr/OBJ/dtor_list.c.obj] Error 127
>> ERROR: mklib: gmake error during rtsv7R4_A_le_v3D16_eabi_debug.lib build
kleitner@xDER-kleitner-2:/mnt/c/ti/ccs1240/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib$

  • I am using Ubuntu 22.04 LTS installed as type 2 Windows System Linux ("WSL"), Windows 10.

    I am not familiar with that system.  TI compilers are not tested under that system.

    My understanding is WSL runs executable files built for Linux, and not executable files built for Windows.  But these ...

    -rwxrwxrwx 1 kleitner kleitner  1086584 Aug  7  2022 armabs.exe*
    -rwxrwxrwx 1 kleitner kleitner  5353584 Aug  7  2022 armacpia.exe*
    -rwxrwxrwx 1 kleitner kleitner  1883760 Aug  7  2022 armadv.exe*
    -rwxrwxrwx 1 kleitner kleitner  1036408 Aug  7  2022 armar.exe*
    -rwxrwxrwx 1 kleitner kleitner  2187888 Aug  7  2022 armasm.exe*
    -rwxrwxrwx 1 kleitner kleitner  7891568 Aug  7  2022 armcg.exe*
    -rwxrwxrwx 1 kleitner kleitner  2589808 Aug  7  2022 armcl.exe*

    ... are Windows executable files, because they have the file extension .exe.  Linux executable files have no extension.

    Thanks and regards,

    -George

  • Thanks George.  I am running many different tool chains and compilers from different vendors.  Let me take another look at my $PATH variable and all the installed software tools. I will report back tomorrow. 

  • George, I fixed my problems.  Also, there are two serious errors in TI compiler manual spnu151W.pdf  (C/C++ ARM LTS Compiler) which misled me.

    I was working too fast and didn't realize that the build is supposed to run under tools compiled for my Windows 10 platform.  I originally thought the tools were supposed to run under a Linux emulation environment, so had setup a Linux emulation environment.  Once I converted everything to the TI-required toolchains cross-compiled for Windows, the TI "mklib" worked, but with a few problems.

    If you read section 7.4.1 of TI document spnu151w.pdf, you will see that I did this wrong because the manual is poorly written and has errors. 

    To get everything working, I did the following:

    • Rewrote my command line call of TI "mklib" using Windows 10 syntax and environmental variables
    • Per TI requirement 7.4.1, installed gnuwin32 environment (gnu tools compiled for windows) and "make" version 3.81

    The problem in TI Document spnu151w.pdf,  -- at least for my version of the tools (20.2.7.LTS) -- is in table 7-2, "The mklib Program Options." 

    The first option "index=filename" should instead read "index=directory", where directory is the top level directory for the TI library source code, in my case:

    c:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_20.2.7.LTS\lib\src

    Also, it's not exactly clear in spnu151w.pdf, because it says NOWHERE IN THE INTRODUCTION that this compiler/assembler/linker/librarian toolchain is designed to work in both Windows and Unix environments. 

    Thus, in section 7.4.1, the manual instructs the user to install both the "gmake and sh (bash)" utilities.  This is why I incorrectly thought this was an emulated Linux build -- because while gmake has been ported to run under Windows, there is no way to run a unix shell on Windows without installing a complete Unix/Linux subsystem.

    --> TI should fix section 7.4.1 of the manual and say

    • For Unix do (a), (b), (c) ...
    • For Windows, do (q), (r), (s) . . .

    There is no way to install the sh (bash) on a Windows machine without installing a complete Unix subsystem.

    Here's my final *.bat file for windows 10

    Once I setup the environment, PATH, env variables as directed, everything seemed to work OK and I got a build and a custom output library.  My "custom" build was actually just the default library built with the -g option added to the build process, but even though the -g option was on by default, running this script forced the compiler to rebuild everything.

    Here is the *.bat script I used:

    @echo off
    REM file:  mklib_Islander.bat
    REM Prepend with "X_" to avoid any possible collision with DOS environment variables

    SET X_PATTERN="--pattern=rtsv7R4_A_le_v3D16_eabi.lib"
    SET X_EXTRA_OPTIONS="--extra_options="-g""
    SET X_COMPILER_BIN_DIR="--compiler_bin_dir=C:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_20.2.7.LTS\bin"
    SET X_GMAKE="--gmake=make"
    SET X_INDEX="--index=c:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_20.2.7.LTS\lib\src"
    SET X_NAME="--name=rtsv7R4_A_le_v3D16_eabi_debug.lib"
    SET X_INSTALL_TO="--install_to=c:\Users\Kip_Leitner\workspace_v12\Config_01_POC\Debug"
    SET X_VERBOSE"=--verbose"

    mklib %X_PATTERN% %X_EXTRA_OPTIONS% %X_COMPILER_BIN_DIR% %X_GMAKE% %X_INDEX% %X_NAME% %X_INSTALL_TO% %X_VERBOSE%

    Thanks for helping!

    Kip

  • I'm glad you found a way to make it work.  I should have sent you this forum thread link.  It shows how customers on Windows systems typically use mklib.

    Thanks and regards,

    -George