Other Parts Discussed in Thread: SYSCONFIG,
我在使用CC1310RGZ芯片时,使用了PIN的中断,然后在回调函数内使用SPI的DMA功能。在调试的时候进入SPI通信失败了,程序卡死了。在中断外部能却够使用该SPI通信。这是优先级的原因导致的吗?
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.
您好,
能将您的工程文件打包发过来测试一下吗?这将对我们确定问题很有帮助。
另外,您说您使用了Sysconfig配置了文件?CC1310并不支持Sysconfig,您这是怎么操作的?
您好,我这边用的离线端的SYSCONFIG,通过浏览本地的SDK路径进入配置的。CC1310这边的外围电路是我自己画的,并没有使用CC1310_LaunchPad;工程文件里的三个文件CC1310_LAUNCHXL.c CC1310_LAUNCHXL.h CC1310_LAUNCHXL_fxns.c我删除了,使用的配置文件Board.c和Board,h。
/* * ======== Board.c ======== * Configured TI-Drivers module definitions * * DO NOT EDIT - This file is generated for the CC1310RGZ * by the SysConfig tool. */ #include <stddef.h> #ifndef DeviceFamily_CC13X0 #define DeviceFamily_CC13X0 #endif #include <ti/devices/DeviceFamily.h> #include "Board.h" /* * =============================== DMA =============================== */ #include <ti/drivers/dma/UDMACC26XX.h> #include <ti/devices/cc13x0/driverlib/udma.h> #include <ti/devices/cc13x0/inc/hw_memmap.h> UDMACC26XX_Object udmaCC26XXObject; const UDMACC26XX_HWAttrs udmaCC26XXHWAttrs = { .baseAddr = UDMA0_BASE, .powerMngrId = PowerCC26XX_PERIPH_UDMA, .intNum = INT_DMA_ERR, .intPriority = 0xC0 }; const UDMACC26XX_Config UDMACC26XX_config[1] = { { .object = &udmaCC26XXObject, .hwAttrs = &udmaCC26XXHWAttrs, }, }; /* * =============================== GPIO =============================== */ #include <ti/drivers/GPIO.h> #include <ti/drivers/gpio/GPIOCC26XX.h> /* * ======== gpioPinConfigs ======== * Array of Pin configurations */ GPIO_PinConfig gpioPinConfigs[] = { /* SPI_SS */ GPIOCC26XX_DIO_21 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_HIGH, /* INT1 */ GPIOCC26XX_DIO_14 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_NONE, }; /* * ======== GPIOCC26XX_config ======== */ const GPIOCC26XX_Config GPIOCC26XX_config = { .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs, .callbacks = NULL, .numberOfPinConfigs = 2, .numberOfCallbacks = 0, .intPriority = (~0) }; /* * =============================== PIN =============================== */ #include <ti/drivers/PIN.h> #include <ti/drivers/pin/PINCC26XX.h> const PIN_Config BoardGpioInitTable[] = { /* Parent Signal: ADXL372 SCLK, (DIO22) */ Board_PIN0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED, /* Parent Signal: ADXL372 MISO, (DIO18) */ Board_PIN1 | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS, /* Parent Signal: ADXL372 MOSI, (DIO19) */ Board_PIN2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED, /* Parent Signal: SPI_SS GPIO Pin, (DIO21) */ Board_PIN3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED, /* Parent Signal: INT1 GPIO Pin, (DIO14) */ Board_PIN4 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS, /* Parent Signal: UART0 TX, (DIO3) */ Board_PIN5 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED, /* Parent Signal: UART0 RX, (DIO2) */ Board_PIN6 | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_DIS, PIN_TERMINATE }; const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = { .intPriority = (~0), .swiPriority = 0 }; /* * =============================== Power =============================== */ #include <ti/drivers/Power.h> #include <ti/drivers/power/PowerCC26XX.h> #include "Board.h" extern void PowerCC26XX_standbyPolicy(void); extern bool PowerCC26XX_calibrate(unsigned int); const PowerCC26XX_Config PowerCC26XX_config = { .enablePolicy = true, .policyInitFxn = NULL, .policyFxn = PowerCC26XX_standbyPolicy, .calibrateFxn = PowerCC26XX_calibrate, .vddrRechargeMargin = 0, .calibrateRCOSC_LF = true, .calibrateRCOSC_HF = true, }; /* * =============================== SPI DMA =============================== */ #include <ti/drivers/SPI.h> #include <ti/drivers/spi/SPICC26XXDMA.h> #define Board_SPICOUNT 1 /* * ======== spiCC26XXDMAObjects ======== */ SPICC26XXDMA_Object spiCC26XXDMAObjects[Board_SPICOUNT]; /* * ======== spiCC26XXDMAHWAttrs ======== */ const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[Board_SPICOUNT] = { /* ADXL372 */ { .baseAddr = SSI0_BASE, .intNum = INT_SSI0_COMB, .intPriority = 0xc0, .swiPriority = 1, .powerMngrId = PowerCC26XX_PERIPH_SSI0, .defaultTxBufValue = ~0, .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX, .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX, .minDmaTransferSize = 10, .mosiPin = IOID_19, .misoPin = IOID_18, .clkPin = IOID_22, .csnPin = PIN_UNASSIGNED }, }; /* * ======== SPI_config ======== */ const SPI_Config SPI_config[Board_SPICOUNT] = { /* ADXL372 */ { .fxnTablePtr = &SPICC26XXDMA_fxnTable, .object = &spiCC26XXDMAObjects[ADXL372], .hwAttrs = &spiCC26XXDMAHWAttrs[ADXL372] }, }; const uint_least8_t SPI_count = Board_SPICOUNT; /* * =============================== UART =============================== */ #include <ti/drivers/UART.h> #include <ti/drivers/uart/UARTCC26XX.h> #include <ti/drivers/Power.h> #include <ti/drivers/power/PowerCC26XX.h> #include <ti/devices/cc13x0/inc/hw_memmap.h> #include <ti/devices/cc13x0/inc/hw_ints.h> #define Board_UARTCOUNT 1 UARTCC26XX_Object uartCC26XXObjects[Board_UARTCOUNT]; static unsigned char uartCC26XXRingBuffer0[32]; static const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[Board_UARTCOUNT] = { { .baseAddr = UART0_BASE, .intNum = INT_UART0_COMB, .intPriority = (~0), .swiPriority = 0, .powerMngrId = PowerCC26XX_PERIPH_UART0, .ringBufPtr = uartCC26XXRingBuffer0, .ringBufSize = sizeof(uartCC26XXRingBuffer0), .rxPin = IOID_2, .txPin = IOID_3, .ctsPin = PIN_UNASSIGNED, .rtsPin = PIN_UNASSIGNED, .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8, .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8, .errorFxn = NULL }, }; const UART_Config UART_config[Board_UARTCOUNT] = { { /* UART0 */ .fxnTablePtr = &UARTCC26XX_fxnTable, .object = &uartCC26XXObjects[0], .hwAttrs = &uartCC26XXHWAttrs[0] }, }; const uint_least8_t UART_count = Board_UARTCOUNT; #include <ti/drivers/Board.h> /* * ======== Board_initHook ======== * Perform any board-specific initialization needed at startup. This * function is declared weak to allow applications to override it if needed. */ #if defined(__IAR_SYSTEMS_ICC__) __weak void Board_initHook(void) #elif defined(__GNUC__) && !defined(__ti__) void __attribute__((weak)) Board_initHook(void) #else #pragma WEAK (Board_initHook) void Board_initHook(void) #endif { } /* * ======== Board_init ======== * Perform any initialization needed before using any board APIs */ void Board_init(void) { /* ==== /ti/drivers/Power initialization ==== */ Power_init(); /* ==== /ti/drivers/PIN initialization ==== */ if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) { /* Error with PIN_init */ while (1); } Board_initHook(); }
/* * ======== Board.h ======== * Configured TI-Drivers module declarations * * DO NOT EDIT - This file is generated for the CC1310RGZ * by the SysConfig tool. */ #ifndef Board_h #define Board_h #define Board_SYSCONFIG_PREVIEW #define Board_CC1310RGZ /* Temporary define for backwards compatibility!!! */ #define __CC1310RGZ_BOARD_H__ #ifndef DeviceFamily_CC13X0 #define DeviceFamily_CC13X0 #endif #include <stdint.h> /* support C++ sources */ #ifdef __cplusplus extern "C" { #endif /* * ======== GPIO ======== */ #define SPI_SS 0 #define INT1 1 /* LEDs are active high */ #define Board_GPIO_LED_ON (1) #define Board_GPIO_LED_OFF (0) #define Board_LED_ON (Board_GPIO_LED_ON) #define Board_LED_OFF (Board_GPIO_LED_OFF) /* * ======== PIN ======== */ /* Includes */ #include <ti/drivers/PIN.h> /* Externs */ extern const PIN_Config BoardGpioInitTable[]; /* Parent Signal: ADXL372 SCLK, (DIO22) */ #define Board_PIN0 0x00000016 /* Parent Signal: ADXL372 MISO, (DIO18) */ #define Board_PIN1 0x00000012 /* Parent Signal: ADXL372 MOSI, (DIO19) */ #define Board_PIN2 0x00000013 /* Parent Signal: SPI_SS GPIO Pin, (DIO21) */ #define Board_PIN3 0x00000015 /* Parent Signal: INT1 GPIO Pin, (DIO14) */ #define Board_PIN4 0x0000000e /* Parent Signal: UART0 TX, (DIO3) */ #define Board_PIN5 0x00000003 /* Parent Signal: UART0 RX, (DIO2) */ #define Board_PIN6 0x00000002 /* * ======== SPI ======== */ #define ADXL372 0 /* * ======== UART ======== */ #define UART0 0 /* * ======== Board_init ======== * Perform all required TI-Drivers initialization * * This function should be called once at a point before any use of * TI-Drivers. */ extern void Board_init(void); /* * ======== Board_initGeneral ======== * (deprecated) * * Board_initGeneral() is defined purely for backward compatibility. * * All new code should use Board_init() to do any required TI-Drivers * initialization _and_ use <Driver>_init() for only where specific drivers * are explicitly referenced by the application. <Driver>_init() functions * are idempotent. */ #define Board_initGeneral Board_init #ifdef __cplusplus } #endif #endif /* include guard */
您好,
由于CC1310的SDK本身不支持SYSCONFIG,所以您这么导入有可能会造成不可预期的错误。(相关寄存器配置问题之类的)
您这边为什么需要使用sysconfig?CC1310的话还是建议直接修改文件如图:。
您好,
是的,您需要修改相关文件的包括 CC1310_LAUNCHXL.c CC1310_LAUNCHXL.h Board,h 的代码(如上一条回复的图所示)。