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.
Hello folks.
Are there instructions on rebuilding the NDK core included in the SimpleLink SDK? I am trying to enable debug flags for the NDK used by the various example projects provided in the SDK.
I have tried following the instructions at http://processors.wiki.ti.com/index.php/Rebuilding_The_NDK_Core_Using_Gmake for a separate ndk_2_25_01_11 install and then dropping the rebuilt NDK into simplelink_msp432e4_sdk_3_10_00_11/sources/ti/ndk, but it looks like there are some compatibility issues there. I have also tried using simplelink_msp432e4_sdk_3_10_00_11\source\ti\ndk\makefile with gmake, but get a number of errors there.
Any up-to-date instructions for rebuilding the NDK as part of the SDK?
Thanks.
When using simplelink_msp432e4_sdk_3_10_00_11\source\ti\ndk\makefile with gmake, the following is the error I get:
... ======== .libraries [./hal/eth_stub] ======== clem4f package/package_ti.ndk.hal.eth_stub.c ... clem4f llpktstb.c ... archiving package/lib/lib/hal_eth_stub/package/package_ti.ndk.hal.eth_stub.oem4f package/lib/lib/hal_eth_stub/llpktstb.oem4f into lib/hal_eth_stub.aem4f ... clm4fg package/package_ti.ndk.hal.eth_stub.c ... clm4fg llpktstb.c ... archiving package/lib/lib/hal_eth_stub/package/package_ti.ndk.hal.eth_stub.om4fg package/lib/lib/hal_eth_stub/llpktstb.om4fg into lib/hal_eth_stub.am4fg ... clrm4f package/package_ti.ndk.hal.eth_stub.c ... C:/Users/tnabelek/AppData/Local/Temp/make10652-2.sh: 1: Syntax error: "(" unexpected gmake[1]: *** [lib/hal_eth_stub.arm4f.mak:18: package/lib/lib/hal_eth_stub/package/package_ti.ndk.hal.eth_stub.orm4f] Error 2 xdctools_3_51_02_21_core\gmake.exe: *** [C:/ti/xdctools_3_51_02_21_core\packages\xdc\bld\xdc_top.mak:389: hal/eth_stub,.libraries] Error 2 gmake: *** [makefile:57: all] Error 2
Thomas,
Looks like the build instructions are very out-of-date. I apologies for this. We will try to update them in the next release.
Use these instructions to rebuild NDK with debug instrumentation:
Edit imports.mak and specify the install path for the following variables (I have use my install paths, replace them with your actual paths):
edit simplelink_msp432e4_sdk_3_10_00_11/imports.mak
CCS = C:/CCS/CCS_9_1_0_00001
XDC_INSTALL_DIR = C:/Products/xdctools_3_51_02_21_core
SYSCONFIG_TOOL = $(CCS)/ccs/utils/sysconfig/cli.js
NODE_JS = $(CCS)/ccs/tools/node/node.exe
CCS_ARMCOMPILER = $(CCS)/ccs/tools/compiler/ti-cgt-arm_18.12.1.LTS
Edit the ndk makefile and remove the following two lines. This ensures you are only building wit the TI compiler.
edit simplelink_msp432e4_sdk_3_10_00_11/source/ti/ndk/makefile
Remove following lines:
gnu.targets.arm.M4F=\"$(GCC_ARMCOMPILER)\" \
iar.targets.arm.M4F=\"$(IAR_ARMCOMPILER)\" \
You should have the following after your edits above.
XDCARGS= \
ti.targets.arm.elf.M4F=\"$(CCS_ARMCOMPILER)\" \
CORESDK_INSTALL_DIR=\"$(CORESDK_INSTALL_DIR)\" \
MSP432E4DRIVERLIB=$(CORESDK_INSTALL_DIR) \
BUILDMINSTACK=\"$(BUILDMINSTACK)\" \
TIPOSIX_REPO=\"$(CORESDK_INSTALL_DIR)/source\" \
NS_INSTALL_DIR=\"$(CORESDK_INSTALL_DIR)\" \
MBEDTLS_INSTALL_DIR=\"$(CORESDK_INSTALL_DIR)/source/third_party/mbedtls\"
Finally, edit the ndk.bld script and enable the debug build profile. Add the following lines to the end of the script:
edit simplelink_msp432e4_sdk_3_10_00_11/source/ti/ndk/ndk.bld
/* build in debug mode */
Pkg.attrs.profile = "debug";
I find it easiest to create a Windows batch script to setup my build environment. Create the following file. This file must be in Windows file format (i.e. not Unix). The doskey command will create an alias for 'make' which will run the gmake.exe provided by XDCtools. I use a Windows 7 machine, your path may be different for Windows 10.
edit simplelink_msp432e4_sdk_3_10_00_11/dosrc.bat
@echo off
set system=C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem
set xdc=C:\Products\xdctools_3_51_02_21_core
REM prompt $n:$g
prompt $p$g
PATH=%system%;%xdc%;%xdc%\bin
doskey alias=doskey /macros
doskey make="%xdc%\gmake.exe" $*
doskey xdc="%xdc%\xdc.exe" $*
doskey xs="%xdc%\xs.exe" $*
set system=
set xdc=
Now, open a DOS command window and change directory into your SDK folder. Run the batch script.
cd simplelink_msp432e4_sdk_3_10_00_11
dosrc
Change directory into the NDK package folder. Clean and rebuild the NDK component.
cd simplelink_msp432e4_sdk_3_10_00_11/source/ti/ndk
make clean
make all
The first build will take a few minutes. After that, to rebuild the NDK it will be much quicker.
Now you will need to relink your application.
Let me know how this goes.
~Ramsey
Hi Ramsey, thanks for you instructions. Using them, and after setting my XDC_JAVA_HOME environmental variable (to C:\ti\ccs901\ccs\eclipse\jre), it looks like the NDK builds successfully.
However, it seems that the rebuilt NDK is not compatible with example projects from the Resource Explorer. When I import the project found at http://dev.ti.com/tirex/explore/node?node=AGE3tYN-1yxW5Gfhbpx1Ig__J4.hfJy__LATEST and try to build it, I get:
makefile:179: recipe for target 'tcpecho_MSP_EXP432E401Y_freertos_gcc.out' failed c:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -l:ti/ndk/slnetif/lib/slnetifndk.am4fg c:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -l:ti/ndk/hal/timer_bios/lib/hal_timer.am4fg c:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -l:ti/ndk/hal/eth_stub/lib/hal_eth_stub.am4fg ...
You can see that after rebuilding, there are some files missing:
simplelink_msp432e4_sdk_3_10_00_11_original> dir .\source\ti\ndk\slnetif\lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 6/12/2019 11:03 AM 1437 lib - Shortcut.lnk -a--- 3/29/2019 7:46 PM 343642 slnetifndk.aem4f -a--- 3/29/2019 7:46 PM 151778 slnetifndk.am4fg -a--- 3/29/2019 7:46 PM 37306 slnetifndk.arm4f simplelink_msp432e4_sdk_3_10_00_11_rebuilt> dir .\source\ti\ndk\slnetif\lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 6/12/2019 11:10 AM 352618 slnetifndk.aem4f -a--- 6/12/2019 11:08 AM 10992 slnetifndk.aem4f.mak
I was able to resolve this by re-enabling the GCC compiler for the NDK build.
In simplelink_msp432e4_sdk_3_10_00_11\imports.mak:
GCC_ARMCOMPILER = $(CCS)/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32
In simplelink_msp432e4_sdk_3_10_00_11\source\ti\ndk\makefile:
XDCARGS= \ ti.targets.arm.elf.M4F=\"$(CCS_ARMCOMPILER)\" \ gnu.targets.arm.M4F=\"$(GCC_ARMCOMPILER)\" \ CORESDK_INSTALL_DIR=\"$(CORESDK_INSTALL_DIR)\" \ MSP432E4DRIVERLIB=$(CORESDK_INSTALL_DIR) \ BUILDMINSTACK=\"$(BUILDMINSTACK)\" \ TIPOSIX_REPO=\"$(CORESDK_INSTALL_DIR)/source\" \ NS_INSTALL_DIR=\"$(CORESDK_INSTALL_DIR)\" \ MBEDTLS_INSTALL_DIR=\"$(CORESDK_INSTALL_DIR)/source/third_party/mbedtls\"
(added gnu.targets.arm.M4F=\"$(GCC_ARMCOMPILER)\" \ back in)
Thomas,
I had assumed you were using the TI ARM compiler. Sorry. You made the correct updates to enable the GNU compiler.
~Ramsey
**Attention** This is a public forum