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.

CC2640R2F: Modify SPI driver settings - rebuild driver

Part Number: CC2640R2F

Hello,

I am working with a custom board and trying to program the SPI peripheral as a master to read from an SD card. I can see that the driver initializes successfully with some cards at 400k but not ith others. I wish to reduce this rate to 100k as this is the lower limit of the allowed data rates. My question is, how do I rebuild the specific driver "sdspi" after changing the line of code?

Can I do this directly via CCS9?

Regards,

  • Okay, I found a link to the SDK documentation which shows how to rebuild the drivers. After following the steps, my build breaks down with the following error message:

    clem3 adc/ADCCC26XX.c ...
    "c:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/drivers/pin/PINCC26XX.h", line 60: fatal error: cannot open source file "ti/devices/cc13x0/driverlib/ioc.h"
    1 catastrophic error detected in the compilation of "adc/ADCCC26XX.c".
    Compilation terminated.

    >> Compilation failure
    gmake[1]: *** [lib/drivers_cc13x0.aem3.mak:359: package/lib/lib/drivers_cc13x0/./adc/ADCCC26XX.oem3] Error 1
    xdctools_3_51_03_28_core\gmake.exe: *** [c:/ti/xdctools_3_51_03_28_core\packages\xdc\bld\xdc_top.mak:389: .,.libraries] Error 2
    gmake: *** [makefile:52: all] Error 2

    It looks like the devce family is being wrongly detected although the devicefamily.h is correct. Could someone point out what is going wrong here?

  • Digging up a bit further, I changed the occurence of cc13x0 to cc26x0r2f in the device family file and was able to get the build to go ahead but am stalled at the error below:

    clem4f adcbuf/ADCBufCC26X2.c ...
    "adcbuf/ADCBufCC26X2.c", line 65: warning: incompatible redefinition of macro "AUX_EVCTL_DMACTL_SEL_FIFO_NOT_EMPTY" (declared at line 822 of "c:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_aux_evctl.h")
    "adcbuf/ADCBufCC26X2.c", line 66: warning: incompatible redefinition of macro "AUX_EVCTL_EVTOMCUFLAGS_ADC_DONE" (declared at line 1328 of "c:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_aux_evctl.h")
    "adcbuf/ADCBufCC26X2.c", line 67: warning: incompatible redefinition of macro "AUX_EVCTL_EVTOMCUFLAGS_ADC_IRQ" (declared at line 1301 of "c:/ti/simplelink_cc2640r2_sdk_4_40_00_10/source/ti/devices/cc26x0r2/inc/hw_aux_evctl.h")
    "adcbuf/ADCBufCC26X2.c", line 260: error: identifier "AUX_EVCTL_EVTOMCUFLAGS_AUX_ADC_IRQ" is undefined
    "adcbuf/ADCBufCC26X2.c", line 260: error: identifier "AUX_EVCTL_EVTOMCUFLAGS_AUX_ADC_DONE" is undefined
    "adcbuf/ADCBufCC26X2.c", line 306: error: identifier "AUX_EVCTL_DMACTL_SEL_AUX_ADC_FIFO_NOT_EMPTY" is undefined
    "adcbuf/ADCBufCC26X2.c", line 324: error: identifier "AUX_EVCTL_EVTOMCUFLAGS_AUX_ADC_IRQ" is undefined
    "adcbuf/ADCBufCC26X2.c", line 324: error: identifier "AUX_EVCTL_EVTOMCUFLAGS_AUX_ADC_DONE" is undefined
    "adcbuf/ADCBufCC26X2.c", line 482: error: identifier "AUXADC_TRIGGER_GPT0A_CMP" is undefined
    "adcbuf/ADCBufCC26X2.c", line 486: error: identifier "AUXADC_TRIGGER_GPT0A_CMP" is undefined
    "adcbuf/ADCBufCC26X2.c", line 676: error: identifier "AUX_EVCTL_DMACTL_SEL_AUX_ADC_FIFO_NOT_EMPTY" is undefined
    "adcbuf/ADCBufCC26X2.c", line 753: error: identifier "AUX_EVCTL_DMACTL_SEL_AUX_ADC_FIFO_NOT_EMPTY" is undefined
    9 errors detected in the compilation of "adcbuf/ADCBufCC26X2.c".

    I doubt if a file for the the 26x2 needs to be built for the 26x0 family. Looks like something is seriously wrong with the build process here. Any help would be appreciated.

  • Hello Shailesh,

    Are you referring to Appendix A of the TI-RTOS Kernel User's Guide?  You may also want to refer to the FAQ or you can directly insert and modify the TI Driver .c file into your project, please see this E2E post.

    Regards,
    Ryan

  • Directly copying the files solved my issue. I did not assume that it would be so straightforward as I found an older thread about modifying include files which I found a bit more confusing.