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.

Launchpad CC2650 enable SPI

Other Parts Discussed in Thread: CC2650, CC2640, ADS1291

Hi there,

i have the CC2650 Launchpad and i was able to get the HeartRate Project to work on ccs.

I am able too see with my iphone the simulated date from the Launchpad to the Sensortag App.

So i have this project running fine.

Now i want to enable SPI to communicate with another IC. The problem is that i couldnt fine any example on Resource Explorer for it.

I have linked the spi driverlib into a folder and i have two files: SPICC26XXDMA.h and SPICC26XXDMA.c

I tryied to run this example code given in the header and i made a new C and H file in the Application folder and added it there. I did also include the header files  for the driver


// The SPI header file should be included in an application as follows:
 
 #include <ti/drivers/SPI.h>
 #include <ti/drivers/spi/SPICC2650DMA.h>
 #include <ti/drivers/dma/UDMACC26XX.h>


 // From board.c
 PIN_Config BoardGpioInitTable[] = {
 Board_CSN_0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, // Ensure SPI slave 0 is not selected
 Board_CSN_1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL // Ensure SPI slave 1 is not selected
 }

 const SPICC2650_HWAttrs SPICC2650DMAHWAttrs[CC2650_SPICOUNT] = {
 { // Use SPI0 module with default chip select on Board_CSN_0
 .baseAddr = SSI0_BASE,
 .intNum = INT_SSI0,
 .defaultTxBufValue = 0,
 .powerMngrId = PERIPH_SSI0,
 .rxChannelIndex = UDMA_CHAN_SSI0_RX,
 .txChannelIndex = UDMA_CHAN_SSI0_TX,
 .mosiPin = Board_SPI0_MOSI,
 .misoPin = Board_SPI0_MISO,
 .clkPin = Board_SPI0_CLK,
 .csnPin = Board_CSN_0
 }

 // From your_application.c
 static void taskFxn(UArg a0, UArg a1)
 {
 SPI_Handle handle;
 SPI_Params params;
 SPI_Transaction transaction;
 PIN_Id csnPin1 = PIN_ID(Board_CSN_1);
 uint8_t txBuf[] = "Hello World"; // Transmit buffer

 // Init SPI and specify non-default parameters
 SPI_Params_init(&params);
 params.bitRate = 1000000;
 params.frameFormat = SPI_POL1_PHA1;
 params.mode = SPI_MASTER;

 // Configure the transaction
 transaction.count = sizeof(txBuf);
 transaction.txBuf = txBuf;
 transaction.rxBuf = NULL;

 // Open the SPI and perform transfer to the first slave
 handle = SPI_open(Board_SPI, &params);
 SPI_transfer(handle, &transaction);

 // Then switch chip select pin and perform transfer to the second slave
 SPI_control(handle, SPICC2650DMA_SET_CSN_PIN, &csnPin1);
 SPI_transfer(handle, &transaction);
 }

Now when i compile it, CCS is given me errors:

SPI_Params_init()

SPI_open()

SPI_transfer()

Saying that those functions are unresolved symbols and first referenced in <whole-program>

Any idea? Is there a easy way to implement SPI with DMA on this?

  • Hi Michael,

    Can you please post your build log so that we can clearly see the all the build environment details. My suspicion is that the linker is not properly setup to link against the driverlib (where the undefined SPI functions are located).

  • Hi Sean,

    here is my Build log:

    **** Build of configuration FlashROM for project HeartRate ****

    "C:\\PRG\\CCS6.1\\ccsv6\\utils\\bin\\gmake" -k all
    'Building target: HeartRate.out'
    'Invoking: ARM Linker'
    "C:/PRG/CCS6.1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" --cmd_file="C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/HeartRate/CC26xx/CCS/HeartRate/../../IAR/Application/CC2640/../../../CCS/Config/ccsCompilerDefines.bcfg" -mv7M3 --code_state=16 --abi=eabi -me -O4 --opt_for_speed=0 -g --gcc --define=USE_ICALL --define=POWER_SAVING --define=GAPROLE_TASK_STACK_SIZE=520 --define=HEAPMGR_SIZE=3072 --define=ICALL_MAX_NUM_TASKS=3 --define=ICALL_MAX_NUM_ENTITIES=6 --define=xdc_runtime_Assert_DISABLE_ALL --define=xdc_runtime_Log_DISABLE_ALL --define=CC26XXWARE --define=CC26XX --define=ccs --define=DEBUG --diag_warning=225 --display_error_number --diag_suppress=48 --diag_wrap=off --gen_func_subsections=on -z -m"HeartRate.map" --heap_size=0 --stack_size=256 -i"C:/PRG/CCS6.1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/lib" -i"C:/PRG/CCS6.1/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --reread_libs --warn_sections --diag_wrap=off --diag_suppress=10247-D --display_error_number --xml_link_info="HeartRate_linkInfo.xml" --rom_model --unused_section_elimination=on --compress_dwarf=on -o "HeartRate.out" "C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/HeartRate/CC26xx/CCS/Config/ccsLinkerDefines.cmd" "C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/common/cc26xx/CCS/cc26xx_ble_app.cmd" "./Startup/CC2650_LAUNCHXL.obj" "./Startup/ccfg_appBLE.obj" "./Startup/main.obj" "./PROFILES/battservice.obj" "./PROFILES/devinfoservice.obj" "./PROFILES/gatt_uuid.obj" "./PROFILES/gattservapp_util.obj" "./PROFILES/heartrateservice.obj" "./PROFILES/peripheral.obj" "./ICallBLE/ICallBleAPI.obj" "./ICallBLE/bleUserConfig.obj" "./ICall/ICall.obj" "./ICall/ICallCC2650.obj" "./Driver/SPI/SPICC2650DMA.obj" "./Driver/PIN/PINCC2650.obj" "./Application_HR/ADS1291.obj" "./Application_HR/ADS1291_Filter.obj" "./Application_HR/ADS1291_SPI.obj" "./Application_HR/board_key.obj" "./Application_HR/heartRate.obj" "./Application_HR/util.obj" -l"configPkg/linker.cmd" -l"libc.a" -l"C:/ti/tirtos_simplelink_2_13_00_06/products/cc26xxware_2_21_01_15600/driverlib/bin/ccs/driverlib.lib"
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    SPI_Params_init <whole-program>

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "HeartRate.out" not built
    gmake: *** [HeartRate.out] Error 1
    gmake: Target `all' not remade because of errors.

    >> Compilation failure

    **** Build Finished ****

    How can i import Heartrate Project into CCS Cloud? Is there a way to do this?

    Does Simplelink Projects also work on CCS Linux?