### Hello World Example with puts() Source: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_tips_for_using_printf A basic 'hello, world' program using the `puts` function to verify C I/O setup. This example requires the `stdio.h` header file. ```c #include int main() { puts("Hello, world!"); } ``` -------------------------------- ### Start Test Server using dss Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server Initiates the Test Server script, which listens for client connections. This script is typically started using the 'dss' command-line tool provided with CCS. The server is ready when a 'TestServer is ready' message is displayed. ```text > dss test_server.js ``` -------------------------------- ### JavaScript DSS Test Server Example Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server An example JavaScript server script that demonstrates the functionality of TestServer.js. It typically starts a DSS Test Server for a specific target (e.g., CC2640R2 LaunchPad) and defines custom commands. ```javascript // Example test_server.js content would go here, demonstrating TestServer.js usage and custom commands. ``` -------------------------------- ### Run Test Server Client Examples (Perl, Python, JavaScript) Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server Executes client scripts to connect to the running Test Server and send commands. These scripts take the host and port of the Test Server as arguments. The example demonstrates running the client with 'localhost' and port 4444. Failures are handled and indicated by messages. ```text > perl perl_client.pl "localhost" 4444 ``` ```text > python python_client.py "localhost" 4444 ``` ```text > dss js_client.js "localhost" 4444 ``` -------------------------------- ### Allocate Library Input Section with Load/Run Addresses (C) Source: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer This example shows how to allocate an input section '.const' from 'driverlib.lib' to an output section 'ipcConst'. It specifies different memory ranges for loading (FLASH5) and running (RAMLS0), and defines symbols for load start, load size, run start, and run size. The ALIGN(8) directive ensures the run address is a multiple of 8. ```c ipcConst { driverlib.lib(.const) } LOAD = FLASH5, RUN = RAMLS0, LOAD_START(constLoadStart), LOAD_SIZE(constLoadSize), RUN_START(constRunStart), ALIGN(8) ``` -------------------------------- ### GEL Conditional Execution Examples Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/if Provides practical examples of 'if' and 'if-else' statements in GEL, including scenarios with single statements and compound statements enclosed in braces. These examples show how to perform assignments based on conditions. ```gel if (a == 25) b = 30; ``` ```gel if (b == 20) { a = 30; c = 30; } else { d = 20; } ``` -------------------------------- ### Python DSS Client Example Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server An example Python script showcasing the DSSClient.py module for communicating with a DSS Test Server. It illustrates initializing a DSSClient object and issuing scripting commands. ```python # Example python_client.py content would go here, demonstrating DSSClient.py usage. ``` -------------------------------- ### GEL Function Definition and Call Example Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/param Demonstrates the definition of a GEL function with parameters and a subsequent example of how to call it with various argument types. It highlights how parameters are assigned values and the implications for function logic and potential errors. ```gel Initialize(localSymbol, filename, value) { if (value > 10) { localSymbol = 0; targetStatus = 10; } else { GEL_MemoryLoad(localSymbol, 0, 0x100, filename); targetStatus = value; } return value*value; } ``` ```gel Initialize(targetSymbol, "c:\\workspace\\myProject\\Debug\\myProject.dat", 2 * 5 + 1.22); ``` ```gel Initialize(targetSymbol, "c:\\workspace\\myProject\\Debug\\myProject.dat", 10); ``` ```gel Initialize(targetSymbol, "c:\\workspace\\myProject\\Debug\\myProject.dat", 1.2); ``` ```gel Initialize(targetSymbol, "c:\\workspace\\myProject\\Debug\\myProject.dat"); ``` ```gel Initialize(); ``` -------------------------------- ### JavaScript DSSClient Module: Halt Command Example Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server Provides an example of how to format a 'halt' command using the DSSClient JavaScript module. The command is structured as a JSON object and sent directly to the Test Server. ```javascript // Halt the target ``` -------------------------------- ### GEL Register Access Example Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/index_debug Demonstrates how to access and manipulate hardware registers using GEL functions. This is vital for low-level debugging, hardware initialization, and understanding the state of the target system. The example shows reading from and writing to a hypothetical register. ```gel // Read the value of a register at address 0x40000000 var reg_value = MEM_read(0x40000000); print("Register value at 0x40000000: " + reg_value); // Write a new value (e.g., 0x1234) to the register MEM_write(0x40000000, 0x1234); print("Wrote 0x1234 to register at 0x40000000"); // Example using symbolic register names if available (e.g., for a specific architecture) // var GPIO_Data = REG_read("GPIO_DATA"); // print("GPIO_DATA register: " + GPIO_Data); ``` -------------------------------- ### Perl DSS Client Example Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server An example Perl script demonstrating the use of the DSSClient.pm module to interact with an active DSS Test Server. It shows how to create a DSSClient instance and send scripting commands. ```perl # Example perl_client.pl content would go here, demonstrating DSSClient.pm usage. ``` -------------------------------- ### loadti Command-Line Usage Example Source: https://software-dl.ti.com/ccs/esd/documents/sdto_dss_loadti Demonstrates how to use the loadti command to configure a debug server, load an executable, pass arguments, and generate a log file. This example showcases the practical application of loadti for running and debugging embedded applications. ```text loadti -c C:\myproject\mytarget.ccxml -x C:\myproject\mylog.xml C:\myproject\myapp.out arg1 arg2 ``` -------------------------------- ### createTargetConfiguration CLI Options Description Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-command-line-full-api-guide Provides a detailed explanation of the available command-line options for the `createTargetConfiguration` application. This includes descriptions for specifying the target device, connection settings, output file path, default import destination, extra arguments, and a help flag. ```text -ccs.device Device. Expects the device XML-file name, or a Java reg-exp to match device's name, ID, or XML-file name. -ccs.connection Connection [optional]. Expects the connection XML-file name, or a Java reg-exp to match connection's name, or XML-file name. -ccs.saveAs '' Destination file name or path [optional]. If omitted, picks default name and creates file in the working directory. -ccs.defaultImportDestination '' Default import-destination. This is the workspace where user-projects will be created/imported by default. -ccs.args '' File containing any extra arguments (optional). -ccs.help Print this help message. ``` -------------------------------- ### CCS CLI createProject Options - Build Options and Tool Enabling Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-command-line-full-api-guide This section details options for listing build options and enabling specific tools like Hex, Objcopy, and SysConfig. It also covers setting compiler, linker, hex, objcopy, and SysConfig options, with support for prepending values and specifying configurations. ```bash -ccs.listBuildOptions Prints a list of all applicable build-options (optional). Does not actually create the project. -ccs.setCompilerOptions '' [@prepend] [@files ['' ]+] [@folders ['' ]+] [@configurations [ ]+] Space-separated list of build-options to set on the created project's compiler tool (optional) (use backslash '\' to escape all double-quotes in ). Optionally, force the value for any list-type options to be prepended to current value. Optionally, specify lists of files/folders (project-relative paths) to set these options on. Optionally, specify a list of build-configurations in which these options are to be set. -ccs.setLinkerOptions '' [@prepend] [@configurations [ ]+] Similar to -ccs.setCompilerOptions -ccs.setHexOptions '' [@prepend] [@configurations [ ]+] Similar to -ccs.setCompilerOptions. Hex tool needs to be separately enabled using -ccs.enableHexTool. -ccs.setObjcopyOptions '' [@prepend] [@configurations [ ]+] Similar to -ccs.setCompilerOptions. Objcopy tool needs to be separately enabled using -ccs.enableObjcopyTool. -ccs.setSysConfigOptions '' [@prepend] [@configurations [ ]+] Similar to -ccs.setCompilerOptions. SysConfig tool needs to be separately enabled using -ccs.enableSysConfigTool. -ccs.enableHexTool Enable the Hex tool with its default build-options (optional). Defaults to 'false'. -ccs.enableObjcopyTool Enable the Objcopy tool with its default build-options (optional). Defaults to 'false'. -ccs.enableSysConfigTool Enable the SysConfig tool with its default build-options (optional). Defaults to 'false'. ``` -------------------------------- ### Get Boolean Driver Property Example - GEL Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_GetBoolDriverProperty This example demonstrates how to retrieve a boolean driver property using GEL_GetBoolDriverProperty. It also shows related functions for retrieving string and numeric properties. ```gel int hasBoardReset = GEL_GetBoolDriverProperty("Use Board Reset"); string deviceId = GEL_GetStringDriverProperty("device.identify"); int traceId = GEL_GetNumericDriverProperty("device.traceId"); ``` -------------------------------- ### Get String Debug Property Example - GEL Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_GetStringDebugProperty This GEL code snippet demonstrates how to retrieve the value of a string debug property named 'FlashFiles'. It also shows examples of retrieving boolean and numeric debug properties for context. ```gel int autoResetOnConnect = GEL_GetBoolDebugProperty("AutoResetOnConnect"); string flashFiles = GEL_GetStringDebugProperty("FlashFiles"); int flashTimeout = GEL_GetNumericDebugProperty("FlashTimeoutValue"); ``` -------------------------------- ### GEL_MatchesConnection Example - Match Pattern Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_MatchesConnection This example shows how to use GEL_MatchesConnection() with a regular expression to match connection names starting with 'TIXDS'. It returns 1 if the connection name matches the pattern, and 0 otherwise. The regex is enclosed in quotation marks. ```gel GEL_MatchesConnection("TIXDS.*"); ``` -------------------------------- ### CCS CLI createProject Options - Build Steps Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-command-line-full-api-guide Configure pre-build and post-build steps for projects created with the `createProject` CLI. These options allow specifying commands to be executed before or after the build process, with the ability to target specific build configurations. ```bash -ccs.setPreBuildStep '' [@configurations [ ]+] Command to be used as a pre-build step (optional) (use backslash '\' to escape all double-quotes in ). Optionally, specify a list of build-configurations in which this build-step is to be set. -ccs.setPostBuildStep '' [@configurations [ ]+] Command to be used as a post-build step (optional) (use backslash '\' to escape all double-quotes in ). Optionally, specify a list of build-configurations in which this build-step is to be set. ``` -------------------------------- ### Example Usage of GEL_SymbolAddOffset() Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_SymbolAddOffset This example demonstrates how to use the GEL_SymbolAddOffset() function to load symbol information from a specified file with code and data offsets. It includes optional CPU and board names, illustrating its application in a multiprocessor setup. ```gel GEL_SymbolAddOffset("c:\\mydir\\myfile.out", 16, 64, "Cortex_M4_0", "Texas Instruments XDS110 USB Debug Probe_0"); ``` -------------------------------- ### GEL_TargetTextOut() Function Examples Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_TargetTextOut Examples demonstrating the usage of the GEL_TargetTextOut() function to display formatted strings from target memory. The function requires a starting address and can optionally take parameters for memory page, maximum length, data format, and an output label. ```gel GEL_TargetTextOut(0x800); GEL_TargetTextOut(0x1000, 0, 400, 1, "My Window", 1); ``` -------------------------------- ### JSON: Connect Command Format Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server The 'connect' command establishes a connection to the target device. It does not require parameters and returns a status. ```json {"name":"connect"} ``` -------------------------------- ### JavaScript: Load Binary File Command Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server This JavaScript code illustrates the 'loadRawFromFile' command for loading a binary file from the PC to the target's memory. It includes parameters like page, address, filename, word size, and byte swap settings. ```javascript // Load binary file to memory. cmd = { "name": "loadRawFromFile", "page": 0, "address": 0x10000, "file": "loadRawFromFile.bin", "wordSize": 32, "byteSwap": 0, } ``` -------------------------------- ### Inspect Application Options - CCS Server CLI Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-command-line-full-api-guide This snippet lists and describes various command-line options available for the 'com.ti.ccs.apps.inspect' application. It details how to inspect global preferences, discovered products, supported devices (with filtering and grouping), device-specific details, and project-related information such as errors, problems, variables, build options, and external resources. ```shell -ccs.preferences Inspect the global preferences. -ccs.products Inspect the discovered third-party products and tools. -ccs.products:showBasicDetails Output some basic details for each product or tool [optional]. -ccs.productDetails '[:]' Inspect product details. -ccs.devices Inspect the listing of supported devices. -ccs.devices:groupBy:family Group the device list by device-family [optional]. -ccs.devices:filterBy:family Filter the device list by device-family [optional]. Valid arguments: [ARM, C2000, C5400, C5500, C6000, C7000, MSP430, MSP432, EVE, ARP32, IVAHD, PRU, CLA, UNKNOWN]. -ccs.devices:filterBy:variant Filter the device list by device-variant [optional]. Valid arguments: [ARM7, ARM9, ARM11, CortexA5, CortexA7, CortexA8, CortexA9, CortexA12, CortexA15, CortexA17, CortexA32, CortexA35, CortexA53, CortexA57, CortexA72, CortexA73, CortexM0, CortexM3, CortexM4, CortexM33, CortexR4, CortexR5, C27XX, C28XX, C29XX, C54XX, C55XX, C55X+, C62XX, C64XX, C64X+, C66XX, C67XX, C67X+, C674X, C71XX, MSP430, MSP432, EVE, ARP32, IVAHD, PRU, CLA, Custom, UNKNOWN]. -ccs.devices:filterBy:id Filter the device list by device-ID [optional]. Expects Java reg-exp as argument. -ccs.format:json Output results in JSON format [optional]. Defaults to XML. -ccs.devices:showBasicDetails Output some basic details for each device [optional]. -ccs.deviceDetails Inspect device details. -ccs.projects [ ]+ Space-separated list of projects to inspect. -ccs.projects:listErrors List all errors for each project. -ccs.projects:listProblems List all errors and warnings for each project. -ccs.projects:listVariables List all build/path variables for each project. -ccs.projects:showBuildOptions Show a hierarchical view of the set build-flags [optional]. -ccs.projects:externalResources [ ]+ Same as '-ccs.projects', but only show each project's external resource dependencies. -ccs.projects:externalResources:noDirs [ ]+ Same as '-ccs.projects:externalResources', but omit any external directory dependencies (lists only files). -ccs.projects:externalResources:noSourceDependencies [ ]+ Same as '-ccs.projects:externalResources', but omit any source-level dependencies (avoids compiling all source files). -ccs.projects:projectSpecApplicability [ ]+ Same as '-ccs.projects', but only show each project's original projectspec applicability. -ccs.defaultImportDestination '' Default import-destination. This is the workspace where user-projects will be created/imported by default. -ccs.args '' File containing any extra arguments (optional). -ccs.help Print this help message. ``` -------------------------------- ### Example CCS Linker Command File for C6748 EVM Source: https://software-dl.ti.com/ccs/esd/documents/troubleshooting-data_verification_errors This example shows a linker command file (*.cmd) for a C6748 EVM, configured to load everything into shared RAM starting at address 0x8000000. Linker command files are crucial for defining memory configurations and allocating program sections correctly. ```c /***************************************************************************** * * linker command file for C6748 test code. * * Copyright 2009, Logic Product Development Company. All Rights Reserved. * *****************************************************************************/ -l ``` -------------------------------- ### Read Data Array from Memory (DSS Commands) Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server Reads multiple values from memory starting at a given address. Configuration includes memory page, starting address, data type size, number of values to read, and whether the values should be treated as signed. Returns status, the array of values (if successful), and an error message. ```text { "name":"readDataArray", "page":[memory page], "address":[address value], "typeSize":[bit size of the values to read], "numValues":[number of values to read], "signed":[return value is signed ('0' = false, '1' = true)] } ``` -------------------------------- ### GEL File I/O Example Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/index_debug Illustrates how to perform file input and output operations using GEL functions. This includes writing data to a file and reading data back, which is essential for scripting and data logging within the debug session. It showcases basic file handling capabilities available in GEL. ```gel // Writing to a file var file_handle = File_Open("output.txt", "w"); if (file_handle > 0) { File_Write(file_handle, "This is line 1.\n"); File_Write(file_handle, "This is line 2.\n"); File_Close(file_handle); print("Successfully wrote to output.txt"); } else { print("Error opening file for writing."); } // Reading from a file file_handle = File_Open("output.txt", "r"); if (file_handle > 0) { var line; while ((line = File_ReadLine(file_handle)) != null) { print("Read line: " + line); } File_Close(file_handle); } else { print("Error opening file for reading."); } ``` -------------------------------- ### Execute GEL Code with GEL_Run() Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_Run Demonstrates the basic usage of the GEL_Run() function to start code execution on the target. It also shows how to specify an optional condition for stopping execution at breakpoints. ```gel GEL_Run(); GEL_Run("A != B"); ``` -------------------------------- ### Load Memory Data with GEL_MemoryLoadData() Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_MemoryLoadData This example demonstrates how to use the GEL_MemoryLoadData() function to load a block of memory from a specified file into the target memory. It specifies the starting address, memory page, the number of values to load, and the filename. ```GEL GEL_MemoryLoadData( 0x100, 0 , 0x100, "c:\\mydir\\myfile.dat" ); ``` -------------------------------- ### CCS CLI createProject Options - Build and Output Configuration Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-command-line-full-api-guide Configure build and output settings for projects created with the `createProject` CLI. Options include specifying the compiler tool version, output format (COFF/ELF), required products, linker command file, runtime support library, and build configurations. ```bash -ccs.toolVersion Compiler version (optional). Defaults to highest applicable version. -ccs.outputFormat (COFF | ELF) The output-format (optional). Defaults to device-specific setting, if defined, or 'COFF'. -ccs.products '[[:];]+' List of products to enable (optional). -ccs.cmd '' Linker command file to be physically copied into the project (optional). Defaults to device-specific setting, if defined. -ccs.rts '' Runtime support library (optional). Defaults to device-specific setting, if defined. -ccs.configurations [ ]+ Space-separated list of build-configurations to create (optional). Defaults to 'Debug Release'. ``` -------------------------------- ### Configure Perl DSS Client Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server This Perl script configuration modifies the program to be used for the debug session. It involves updating a specific line in the `perl_client.pl` script located in the CCS installation directory. ```Perl hello_CC2640R2_LAUNCHXL_tirtos_ccs.out ``` -------------------------------- ### Full Multi-Core Debug Session Management (JavaScript) Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/sdto_dss_handbook A comprehensive example demonstrating the complete workflow for multi-core debugging with DSS. It includes server configuration, opening sessions for multiple cores, connecting to each core, loading programs, and running them either individually or simultaneously using the `simultaneous.run()` API. ```javascript ... // Get the Debug Server and start a Debug Session debugServer = script.getServer("DebugServer.1"); // Configure target for a TCI6488 EVM with SD XDS510 USB emulator script.traceWrite("Configuring debug server for TCI6488 EVM..."); debugServer.setConfig("TCI6488EVM_SD510USB.ccxml"); script.traceWrite("Done!"); // Open a debug session for each TCI6488 CPU script.traceWrite("Opening a debug session for all TCI6488 cores..."); debugSessionF1A = debugServer.openSession("TCI6488EVM_XDS510USB/C64PLUS_F1A"); debugSessionF1B = debugServer.openSession("TCI6488EVM_XDS510USB/C64PLUS_F1B"); debugSessionF1C = debugServer.openSession("TCI6488EVM_XDS510USB/C64PLUS_F1C"); debugSessionF2A = debugServer.openSession("TCI6488EVM_XDS510USB/C64PLUS_F2A"); debugSessionF2B = debugServer.openSession("TCI6488EVM_XDS510USB/C64PLUS_F2B"); debugSessionF2C = debugServer.openSession("TCI6488EVM_XDS510USB/C64PLUS_F2C"); script.traceWrite("Done!"); // Connect to each TCI6488 CPU script.traceWrite("Connecting to all TCI6488 CPUs..."); debugSessionF1A.target.connect(); debugSessionF1B.target.connect(); debugSessionF1C.target.connect(); debugSessionF2A.target.connect(); debugSessionF2B.target.connect(); debugSessionF2C.target.connect(); script.traceWrite("Done!"); // Load a program for just the first TCI6488 CPU script.traceWrite("Loading program to first TCI6488 CPU..."); debugSessionF1A.memory.loadProgram("HelloTCI6488.out"); script.traceWrite("Done!"); // Load a program for just the second TCI6488 CPU script.traceWrite("Loading program to second TCI6488 CPU..."); debugSessionF1B.memory.loadProgram("HelloTCI6488.out"); script.traceWrite("Done!"); // Run the program for just the first TCI6488 CPU script.traceWrite("Executing program on first TCI6488 CPU..."); debugSessionF1A.target.run(); script.traceWrite("Execution complete!"); // Reload program for just the first TCI6488 CPU script.traceWrite("Loading program to first TCI6488 CPU..."); debugSessionF1A.memory.loadProgram("HelloTCI6488.out"); script.traceWrite("Done!"); // Run the program for the first and second TCI6488 CPU simultaneously script.traceWrite("Executing program on first and second TCI6488 CPU..."); var dsArray = new Array(); dsArray[0] = debugSessionF1A; dsArray[1] = debugSessionF1B; debugServer.simultaneous.run(dsArray); // Run CPUs 1 and 2 script.traceWrite("Done!"); ... ``` -------------------------------- ### C: Mix Explicit and Wildcard Section Placement Source: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer Creates an output section named 'output_section_name' and places the '.text' section from 'first.obj' first, followed by all other '.text' sections from remaining object files. The entire section is allocated to FLASH. ```c output_section_name { first.obj(.text) /* This code must be first */ *(.text) } > FLASH ``` -------------------------------- ### Set Boolean Debug Property using GEL_SetBoolDebugProperty Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_SetBoolDebugProperty This example demonstrates how to set a boolean debug property using the GEL_SetBoolDebugProperty function. It also shows related functions for getting and setting other debug property types (numeric, string). ```GEL int autoResetOnConnect = GEL_GetBoolDebugProperty("AutoResetOnConnect"); string flashFiles = GEL_GetStringDebugProperty("FlashFiles"); int flashTimeout = GEL_GetNumericDebugProperty("FlashTimeoutValue"); GEL_SetBoolDebugProperty("AutoResetOnConnect", 1); GEL_SetStringDebugProperty("FlashFiles", "a.out"); GEL_SetNumericDebugProperty("FlashTimeoutValue", 100); ``` -------------------------------- ### Retrieve Numeric Debug Property Value with GEL Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_GetNumericDebugProperty This snippet demonstrates how to use the GEL_GetNumericDebugProperty function to retrieve the value of a numeric debug property. It shows an example of getting the 'FlashTimeoutValue' property. This function is synchronous and part of the GEL scripting language. ```gel int flashTimeout = GEL_GetNumericDebugProperty("FlashTimeoutValue"); ``` -------------------------------- ### JSON: Run Command Format Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server The 'run' command executes the program on the target synchronously, blocking until the program halts or a timeout occurs. It has no parameters and returns a status. ```json {"name":"run"} ``` -------------------------------- ### Utility to Get XDS200 Debug Probe Serial Number Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main This utility retrieves the serial number of an XDS200 debug probe when provided with its port address. The serial number is a unique identifier for each probe and can be used for differentiation in multi-probe setups. Ensure the XDS200 is configured with EnableUSBSerial set to true. ```shell xds2xxx_conf --port ``` -------------------------------- ### GEL dialog Keyword Example: Adding Menu Items Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/dialog Demonstrates how to use the 'dialog' keyword to add custom functions ('InitTarget' and 'LoadMyProg') to the Scripts menu. 'InitTarget' includes parameters with descriptions for user input via a dialog box. ```gel menuitem "My Functions"; dialog InitTarget(startAddress "Starting Address", EndAddress "End Address") { statements } dialog LoadMyProg() { statements } ``` -------------------------------- ### Python DSSClient Module: loadRawFromFile Command Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server Illustrates the formatting of the 'loadRawFromFile' command with various parameters using the DSSClient Python module. This command facilitates loading binary files from the host PC to the target. ```python # Load binary file to memory. cmd = { "name": "loadRawFromFile", "page": 0, "address": 0x10000, "file": "loadRawFromFile.bin", "wordSize": 32, "byteSwap": 0, } ``` -------------------------------- ### Configure DSS Test Server JavaScript Source: https://software-dl.ti.com/ccs/esd/documents/dss_test-server This JavaScript code snippet configures the DSS Test Server by specifying the target configuration file and the connection/CPU name for the debug session. It's located within the CCS installation directory. ```JavaScript configFile = "CC2640R2F.ccxml"; name = "Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0"; ``` -------------------------------- ### Load Binary File with GEL_LoadBin() Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_LoadBin Demonstrates how to load a binary file into target memory using the GEL_LoadBin() function. It shows the basic usage with a file path and start address, and an extended version including CPU and board names for multiprocessor environments. ```gel GEL_LoadBin( "C:/path/to/file.bin", 0x8000 ); ``` ```gel GEL_LoadBin( "C:/path/to/file.bin", 0x8000, "cpu_a", "Emulator" ); ``` -------------------------------- ### String Manipulation with GEL Functions Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_StrCat Illustrates string manipulation using GEL functions, including calculating string length with GEL_StrLen and extracting substrings with GEL_SubStr. This example shows how to get the length of the concatenated product string and extract the first five characters of the company name. ```gel int length = GEL_StrLen(product_str); // length == 26 string state = GEL_SubStr(company, 0, 5); // state == "Texas" ``` -------------------------------- ### Set Build Options and Steps Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-command-line-createProject-options These options allow for detailed configuration of build settings, including compiler, linker, hex, objcopy, and SysConfig tool options. They also enable setting pre-build and post-build steps. Options can be prepended and applied to specific configurations. ```bash -ccs.setCompilerOptions '' [@prepend] [@files ['' ]+] [@folders ['' ]+] [@configurations [ ]+] ``` ```bash -ccs.setLinkerOptions '' [@prepend] [@configurations [ ]+] ``` ```bash -ccs.setHexOptions '' [@prepend] [@configurations [ ]+] ``` ```bash -ccs.setObjcopyOptions '' [@prepend] [@configurations [ ]+] ``` ```bash -ccs.setSysConfigOptions '' [@prepend] [@configurations [ ]+] ``` ```bash -ccs.setPreBuildStep '' [@configurations [ ]+] ``` ```bash -ccs.setPostBuildStep '' [@configurations [ ]+] ``` -------------------------------- ### Load Memory Block from File using GEL_MemoryLoad() Source: https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_MemoryLoad This example demonstrates how to load a block of target memory from a specified file using the GEL_MemoryLoad() function. It specifies the starting address, memory page, number of words to load, and the filename. The function supports different file formats and endianness conversions. ```gel GEL_MemoryLoad(0x1000, 1, 0x100, "c:\\mydir\\myfile.dat"); ```