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.
Hi All,
We use scons to control our builds. I'm setting up a CCS project to run my scons command when I build. It works fine for "Build Project", but it does not work for "Clean Project". When I execute "Clean Project", the Console clears, but no new text is output to the console and the object files are not deleted.
How can I get this to work? Screen shots of my build setup are below. I'm running Code Composer Version: 6.1.1.00022.
Thanks,
Matt
Matt Ellis1 said:I'm setting up a CCS project to run my scons command when I build. It works fine for "Build Project", but it does not work for "Clean Project". When I execute "Clean Project", the Console clears, but no new text is output to the console and the object files are not deleted.
Matt,
Can you provide the full output seen in the CCS build console both when you Build Project and Clean Project? You can save them to a text file and attach here. Maybe that will give some clues as to why the -c option is not working.
I personally don't have experience with using scons in CCS, but it appears that it does not use a Makefile or equivalent (with make rules) for the build. Is that correct?
Matt Ellis1 said:Note that I am able to do both a full build and a build clean using the scons commands from a command prompt. I
Can you show what the clean command and its output looks like when executed from command prompt?
Here is the output from a clean command from the command prompt. Note that it executes the same command as a build except with -c added to the end.
c:\Git\firmware> cmd /c scons --config_map=pcs:1 --jobs=4 --no_unit_test --nolint -c
scons: dir.\site_scons
scons: Reading SConscript files ...
Parsing configurations for pcs
Using windows compiler on windows
scons: done reading SConscript files.
scons: Cleaning targets ...
Removed components\charger\PCS\PCS_P-1_A-1_U-1\pcs.obj
Removed components\charger\PCS\PCS_P-1_A-1_U-1\pcs.asm
Removed components\charger\PCS\PCS_P-1_A-1_U-1\PCS_P-1_A-1_U-1_GIT-19d955c.out
Removed components\charger\PCS\PCS_P-1_A-1_U-1\PCS_P-1_A-1_U-1_GIT-19d955c.map
Removed components\charger\PCS\PCS_P-1_A-1_U-1\PCS_P-1_A-1_U-1_GIT-19d955c.hex
Removed components\charger\PCS\PCS_P-1_A-1_U-1\PCS_P-1_A-1_U-1_GIT-19d955c.mxp
Removed components\charger\PCS\PCS_P-1_A-1_U-1\PCS_P-1_A-1_U-1_GIT-19d955c_CRC.hex
scons: done cleaning targets.
Matt,
Without having scons installed, i've created a test project with the same build settings as yours, and it does seem to behave as you would expect.
Build Project action output:
**** Build of configuration Debug for project zz ****
cmd /c scons --config_map=pcs: --jobs=4 --no_unit_test --nolint
'scons' is not recognized as an internal or external command,
operable program or batch file.
**** Build Finished ****
Clean Project action output:
**** Clean-only build of configuration Debug for project zz ****
cmd /c scons --config_map=pcs: --jobs=4 --no_unit_test --nolint -c
'scons' is not recognized as an internal or external command,
operable program or batch file.
**** Build Finished ****
Can you send us your <workspace>/.metadata/.log file? There might be an uncaught exception somewhere that's preventing the clean-build from running.
Thanks,
- Baltasar
Oh, i have just reproduced your problem.
CCS suppresses the 'clean' command if it doesn't find the build-configuration directory (PCS/Config 01/ in your case), or if that directory is empty. This was done to avoid unnecessarily launching gmake and causing it to display confusing error messages, when cleaning a project which has never been built. For the next CCS release (6.2.0), I will modify this to only happen during "managed" builds (when the "Generate makefiles automatically" checkbox is checked).
Until then, you can work around this problem by adding any empty file into your PCS/Config 01/ folder:
Thanks,
- Baltasar
Hi,
i am trying to figure out how to use an Sconstruct file to run a project build within ccs. I am not that much familiar with CCS and will highly appreciate any help that you are able to provide. Attached is a specific Sconstruct file that i will like to use but i have no clue how to do it.
Thanks
Thierry
import subprocess import os def projName(extension): return env['vars']['buildDir'] + '/' + env['vars']['projName'] + extension env = Environment() env['vars'] = {} # Version information - user changes this regularly env['vars']['verMajor'] = 1 env['vars']['verMinor'] = 1 env['vars']['appType'] = "App" SConscript(['../tools/common/SConscript']) env['vars']['sourcesC'] = [] env['vars']['sourcesCC'] = [] env['vars']['sourcesAsm']= [] env['vars']['projName'] = 'MTC' env['vars']['isTestBuild'] = ARGUMENTS.get('unittest', '0').lower() env['vars']['buildType'] = ARGUMENTS.get('BUILD_TYPE', 'debug').upper() env['vars']['hwRev'] = ARGUMENTS.get('HW_REV', 'reva').lower() env['vars']['platformDir'] = 'platform/HalCoGen' + env['vars']['hwRev'] env['vars']['buildDir'] = env['vars']['buildType'] env['vars']['nowECCPath'] = os.path.abspath(env['vars']['buildDir']) + '/../../tools/nowECC.exe' env['vars']['sourcesDir'] = [ 'app/appsrc', 'app/autogen/canautogen', 'app/capi', 'lib/sharedmathlibrary/MathLibSrc', 'lib/can-proto/src', 'lib/can-proto/src/server' ] env['CPPPATH'] = [ 'lib/flashapi/include', 'lib/sharedmathlibrary/MathLibHdr', 'app/autogen/canautogen', 'app/capi', 'drivers', 'app/apphdr', 'lib/can-proto/inc', env['vars']['platformDir'] +'/include' ] env['LIBPATH'] = [ 'lib/flashapi' ] env['LIBS'] = [ 'rtsv7R4_T_be_v3D16_eabi.lib', 'F021_API_CortexR4_BE_L2FMC_V3D16_NDS.lib' ] env['CFLAGS'] = [ '-mv7R4', '--define=CCS', '--code_state=16', '--float_support=VFPv3D16', '--abi=eabi', '-O3', '--gen_func_subsections=on', '-g', '--define=FPU_PRESENT', '--define=ARM_MATH_BIGENDIAN', '--define=__BIG_ENDIAN', '-pdsw=225', '--display_error_number', '--enum_type=packed', '--define=' + env['vars']['buildType'] ] env['CPPFLAGS'] = [ '-fprofile-arcs', '-ftest-coverage', '-Wno-unknown-pragmas' ] env['LINKFLAGS'] = [ '--reread_libs', '--warn_sections', '--diag_wrap=off', '--display_error_number', '--emit_warnings_as_errors', '--rom_model', '--be32', '--xml_link_info="MTC_linkInfo.xml"', '--unused_section_elimination=on', '-mMTC.map' ] env['vars']['LDScript'] = env['vars']['platformDir'] + '/source/HL_sys_link.cmd' if env['vars']['isTestBuild'] == '1': env['vars']['sourcesDir'] += [ 'platform/Hal_UT' ] env['CPPPATH'] += [ '../tools/common/googletestlib/g_include', 'platform/HAL_UT' ] else: env['vars']['sourcesDir'] += [ 'app/hapi', 'app/instrsrc', 'app/libsrc', 'drivers/xcp', 'lib/fee_wrapper', 'lib/ffs', 'lib/xcp', env['vars']['platformDir'] + '/source' ] env['CPPPATH'] += [ 'lib/eeprom', 'lib/fee_wrapper', 'lib/ffs', 'app/hapi', 'app/instrhdr', 'app/libhdr', 'drivers/xcp', 'lib/xcp' ] Export('env') SConscript('../tools/common/scons/scons_setup.py') if env['vars']['isTestBuild'] == '1': SConscript('../tools/common/scons/scons_unittest.py') else: SConscript('../tools/common/scons/scons_ti.py') for item in env['vars']['objectAndSource']: env.Object(item[0], item[1]) if env['vars']['isTestBuild'] == '1': env.Program(projName('.exe'), env['vars']['objList'], LIBPATH=['../tools/common/googletestlib/g_lib'], LDFLAGS="-lgcov -fprofile-arcs") env.Command(projName('.log'), projName('.exe'), [os.path.abspath(projName('.exe')) + ' > ' + projName('.log'), 'type ' + env['vars']['buildDir'] + '\\' + env['vars']['projName'] + '.log']) else: env.Program(projName('.out'), env['vars']['objList']) env.Command(projName('.hex'), projName('.out'), env['vars']['hexToolPath'] + ' --romwidth=32 --intel -o ${TARGET.abspath} ${SOURCE.abspath}') env.Command(projName('-ECC.hex'),projName('.hex'), env['vars']['nowECCPath'] + ' -i ${SOURCE.abspath} -r4 -f021 16M_ADD -o ${TARGET.abspath}') if env['vars']['buildType'] == 'RELEASE': env.Command(env['vars']['buildDir'] + '/DetailedReport.txt', projName('.out'), ['C:/ti/ccsv6/utils/bin/gmake -f ../tools/common/lint/Makefile', Copy(env['vars']['buildDir'] + '/DetailedReport.txt', '../test/lint/DetailedReport.txt')])