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.

MSP432E401Y: Rebuild Simplelink Third Party FatFS using default makefile problem

Part Number: MSP432E401Y

Hello TI community,

I wanted to enable 

#define FF_USE_FIND		1
 in ffconf.h and create fatfs.a with those features. I can clean but not build. These are the steps I took.

1. Disable compilers except CCS Compiler in C:\ti\simplelink_msp432e4_sdk_4_20_00_12\source\third_party\fatfs\makefile and rename imports.mak to imports.mak.windows as required

2. Ive then proceeded to compile it. No matter what I do it fails to find the files. Ive tried using absolute paths like C:\ti\simplelink_msp432e4_sdk_4_20_00_12\source\third_party\fatfs in vpath and C:\ti\simplelink_msp432e4_sdk_4_20_00_12\ in SIMPLELINK_SDK_INSTALL_DIR as well.

SIMPLELINK_SDK_INSTALL_DIR ?= $(abspath ../../../../../../)
include $(SIMPLELINK_SDK_INSTALL_DIR)/imports.mak.windows

CC = "$(CCS_ARMCOMPILER)/bin/armcl"
AR = "$(CCS_ARMCOMPILER)/bin/armar"

OBJS = diskio.obj \
	ff.obj \
	ffcio.obj \
	ffsystem.obj \
	ffunicode.obj \
	ramdisk.obj

CFLAGS = -I../../../ -I$(SIMPLELINK_SDK_INSTALL_DIR)/source \
	"-I$(CCS_ARMCOMPILER)/include" --silicon_version=7M4 --code_state=16 \
	--little_endian --display_error_number --diag_warning=255 --diag_wrap=off \
	--gen_func_subsections=on --float_support=vfplib -O2 --symdebug:dwarf

ARFLAGS = -r

vpath %.c ../../../

%.obj: %.c
	@ $(CC) $(CFLAGS) $< --output_file=$@

all: fatfs.a

clean:
	@ $(RM) $(OBJS) fatfs.a > $(DEVNULL) 2>&1

fatfs.a: $(OBJS)
	@ echo "# Archiving $@"
	@ $(AR) $(ARFLAGS) $@ $^

Im new to using makefiles directly and might have missed something trivial. I found another post which stated to put header files ff.h and ffconf.h in %.obj: %.c <header-files> but did not work. Any insights would be appreciated. |

Output below:

C:\ti\ccs1031\ccs\utils\bin>gmake -C "C:\ti\simplelink_msp432e4_sdk_4_20_00_12\source\third_party\fatfs" -f makefile clean
gmake: Entering directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs'
gmake[1]: Entering directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs/lib/ccs/m4'
gmake[1]: Leaving directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs/lib/ccs/m4'
gmake[1]: Entering directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs/lib/ccs/m4f'
gmake[1]: Leaving directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs/lib/ccs/m4f'
gmake: Leaving directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs'

C:\ti\ccs1031\ccs\utils\bin>gmake -C "C:\ti\simplelink_msp432e4_sdk_4_20_00_12\source\third_party\fatfs" -f makefile all
gmake: Entering directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs'
gmake[1]: Entering directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs/lib/ccs/m4'
process_begin: CreateProcess(NULL, c:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/bin/armcl -I../../../ -IC:/ti/simplelink_msp432e4_sdk_4_20_00_12/source -Ic:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/include --silicon_version=7M4 --code_state=16 --little_endian --display_error_number --diag_warning=255 --diag_wrap=off --gen_func_subsections=on --float_support=vfplib -O2 --symdebug:dwarf ../../../diskio.c --output_file=diskio.obj, ...) failed.
make (e=2): The system cannot find the file specified.
makefile:24: recipe for target 'diskio.obj' failed
gmake[1]: *** [diskio.obj] Error 2
gmake[1]: Leaving directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs/lib/ccs/m4'
makefile:36: recipe for target 'lib/ccs/m4' failed
gmake: *** [lib/ccs/m4] Error 2
gmake: Leaving directory 'C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/fatfs'

C:\ti\ccs1031\ccs\utils\bin>


Thanks,

Utsav

  • Update: I have fixed this. I printed all the environment variables to see what was wrong

    1. By default an arbitrary CCS Compiler version is chosen by $(CCS_ARMCOMPILER) in the makefile in third_party/fatfs folder. It also references a CCS installation directory for the compiler that does not exist. Perhaps my CCS version was updated and it referenced an old version.

    2. One has to define CCS_ARMCOMPILER variable with  C:\ti\<CCS-Directory>\ccs\tools\compiler<Compiler> in the makefile locations third_party/fatfs and other makefiles in subfolders where CCS_ARMCOMPILER is referenced else it will try to include something random.

    3. In my case it referenced  c:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS which does not exist. I had to explicitly define CCS_ARMCOMPILER = "C:\ti\ccs1031\ccs\tools\compiler\ti-cgt-msp430_20.2.5.LTS"

    This should also be applicable for IAR and GCC as the makefile style is same

    So to summarise. Do not change the makefile contents if you have installed everything in default locations and simply define your compiler variables. If problems persist, print all the environment variables using echo $(<Env-Var>) to confirm if its a path problem