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.

CCS/CC3200: how to generate .bin file

Part Number: CC3200


Tool/software: Code Composer Studio

I am using the newest CCS V7.3 and the CC3200 launch pad. I am using the  "aws-iot-device-sdk-embedded-c"  to connect with AWS. I imported it to the CCS workspace as "existing code as makefile project". With the gmake, I can generate the .out file. How can I generate .bin file?

In the previous posts, such as 
https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/190375

https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/486843

it seems that post-build actions are needed to get the .bin file. But I do not find the post-build in the project setting.

Thank you in advance for your help.

  • Since you are not using a managed make project (CCS or standard Eclipse), that option is not available. You will need to invoke it from your makefile

    Thanks
    ki
  • Thank you for your reply. Can you explain "invoke it from your makefile" in more detail?
  • For me, as long as I can get the .bin file, it is Okay.
    Hope that you can give me more intructions. Thank you and below is my current makefile.



    #This target is to ensure accidental execution of Makefile as a bash script will not execute commands like rm in unexpected directories and exit gracefully.
    .prevent_execution:
    exit 0

    #Set this to @ to keep the makefile quiet
    ifndef SILENCE
    SILENCE = @
    endif

    CC = gcc
    RM = rm

    DEBUG =

    #--- Inputs ----#
    COMPONENT_NAME = IotSdkC

    ALL_TARGETS := build-cpputest
    ALL_TARGETS_CLEAN :=

    CPPUTEST_USE_EXTENSIONS = Y
    CPP_PLATFORM = Gcc
    CPPUTEST_CFLAGS += -std=gnu99
    CPPUTEST_LDFLAGS += -lpthread
    CPPUTEST_CFLAGS += -D__USE_BSD
    CPPUTEST_USE_GCOV = Y

    #IoT client directory
    IOT_CLIENT_DIR = .

    APP_DIR = $(IOT_CLIENT_DIR)/tests/unit
    APP_NAME = aws_iot_sdk_unit_tests
    APP_SRC_FILES = $(shell find $(APP_DIR)/src -name '*.cpp')
    APP_SRC_FILES = $(shell find $(APP_DIR)/src -name '*.c')
    APP_INCLUDE_DIRS = -I $(APP_DIR)/include

    CPPUTEST_DIR = $(IOT_CLIENT_DIR)/external_libs/CppUTest

    # Provide paths for CppUTest to run Unit Tests otherwise build will fail
    ifndef CPPUTEST_INCLUDE
    CPPUTEST_INCLUDE = $(CPPUTEST_DIR)/include
    endif

    ifndef CPPUTEST_BUILD_LIB
    CPPUTEST_BUILD_LIB = $(CPPUTEST_DIR)
    endif

    CPPUTEST_LDFLAGS += -ldl $(CPPUTEST_BUILD_LIB)/libCppUTest.a

    PLATFORM_DIR = $(IOT_CLIENT_DIR)/platform/linux

    #MbedTLS directory
    TEMP_MBEDTLS_SRC_DIR = $(APP_DIR)/tls_mock
    TLS_LIB_DIR = $(TEMP_MBEDTLS_SRC_DIR)
    TLS_INCLUDE_DIR = -I $(TEMP_MBEDTLS_SRC_DIR)

    # Logging level control
    LOG_FLAGS += -DENABLE_IOT_DEBUG
    #LOG_FLAGS += -DENABLE_IOT_TRACE
    LOG_FLAGS += -DENABLE_IOT_INFO
    LOG_FLAGS += -DENABLE_IOT_WARN
    LOG_FLAGS += -DENABLE_IOT_ERROR
    COMPILER_FLAGS += $(LOG_FLAGS)

    EXTERNAL_LIBS += -L$(CPPUTEST_BUILD_LIB)

    #IoT client directory
    PLATFORM_COMMON_DIR = $(PLATFORM_DIR)/common

    IOT_INCLUDE_DIRS = -I $(PLATFORM_COMMON_DIR)
    IOT_INCLUDE_DIRS += -I $(IOT_CLIENT_DIR)/include
    IOT_INCLUDE_DIRS += -I $(IOT_CLIENT_DIR)/external_libs/jsmn

    IOT_SRC_FILES += $(shell find $(PLATFORM_COMMON_DIR)/ -name '*.c')
    IOT_SRC_FILES += $(shell find $(IOT_CLIENT_DIR)/src/ -name '*.c')
    IOT_SRC_FILES += $(shell find $(IOT_CLIENT_DIR)/external_libs/jsmn/ -name '*.c')

    #Aggregate all include and src directories
    INCLUDE_DIRS += $(IOT_INCLUDE_DIRS)
    INCLUDE_DIRS += $(APP_INCLUDE_DIRS)
    INCLUDE_DIRS += $(TLS_INCLUDE_DIR)
    INCLUDE_DIRS += $(CPPUTEST_INCLUDE)

    TEST_SRC_DIRS = $(APP_DIR)/src

    SRC_FILES += $(APP_SRC_FILES)
    SRC_FILES += $(IOT_SRC_FILES)

    COMPILER_FLAGS += -g
    COMPILER_FLAGS += $(LOG_FLAGS)
    PRE_MAKE_CMDS = cd $(CPPUTEST_DIR) &&
    PRE_MAKE_CMDS += cmake CMakeLists.txt &&
    PRE_MAKE_CMDS += make &&
    PRE_MAKE_CMDS += cd - &&
    PRE_MAKE_CMDS += pwd &&
    PRE_MAKE_CMDS += cp -f $(CPPUTEST_DIR)/src/CppUTest/libCppUTest.a $(CPPUTEST_DIR)/libCppUTest.a &&
    PRE_MAKE_CMDS += cp -f $(CPPUTEST_DIR)/src/CppUTestExt/libCppUTestExt.a $(CPPUTEST_DIR)/libCppUTestExt.a

    # Using TLS Mock for running Unit Tests
    MOCKS_SRC += $(APP_DIR)/tls_mock/aws_iot_tests_unit_mock_tls_params.c
    MOCKS_SRC += $(APP_DIR)/tls_mock/aws_iot_tests_unit_mock_tls.c

    ISYSTEM_HEADERS += $(IOT_ISYSTEM_HEADERS)
    CPPUTEST_CPPFLAGS += $(ISYSTEM_HEADERS)
    CPPUTEST_CPPFLAGS += $(LOG_FLAGS)

    LCOV_EXCLUDE_PATTERN = "tests/unit/*"
    LCOV_EXCLUDE_PATTERN += "tests/integration/*"
    LCOV_EXCLUDE_PATTERN += "external_libs/*"

    #use this section for running a specific group of tests, comment this to run all
    #ONLY FOR TESTING PURPOSE
    #COMMAND_LINE_ARGUMENTS += -g CommonTests
    #COMMAND_LINE_ARGUMENTS += -v

    build-cpputest:
    $(PRE_MAKE_CMDS)

    include CppUTestMakefileWorker.mk

    .PHONY: run-unit-tests
    run-unit-tests: $(ALL_TARGETS)
    @echo $(ALL_TARGETS)

    .PHONY: clean
    clean:
    $(MAKE) -C $(CPPUTEST_DIR) clean
    $(RM) -rf build_output
    $(RM) -rf gcov
    $(RM) -rf objs
    $(RM) -rf testLibs
  • To generate a binary, you can use the tiobj2bin utility that comes with CCS:

    <CCSv7 INSTALL DIR>\ccsv7\utils\tiobj2bin

    It is a batch file that calls additional utilities under the hood to generate the binary from the executable out file.

    You can invoke it from your makefile or simply call it from the command line.

    Or you can just run the little DOS batch file I created for you. Just edit the bat file so that the variables for the paths and the file names apply to your environment. Run it from the location of your out file.

    /cfs-file/__key/communityserver-discussions-components-files/81/generate_5F00_bin.zip

    Thanks

    ki

  • It works perfectly. The DOS batch file created by you is really fantastic!! Thank you very much!