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.

CC1310 I2C Master下载程序后跑不起来

Other Parts Discussed in Thread: CC1310, CC1350

你好:

我在使用cc1310的配置i2c接口,编译可以过,在下载时会出现以下错误提示:

Cortex_M3_0: Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.0.27.9)

Cortex_M3_0: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.0.27.9)

代码如下,去掉I2C_transfer(i2c, &i2cTransaction);则不会出现上述问题。请问何解?

SDK版本:simplelink_cc13x0_sdk_2_20_00_38,工程用的是\examples\rtos\CC1310_LAUNCHXL\ti154stack\sensor_oad

I2C使用的引脚:

#define CC1350_LAUNCHXL_I2C0_SCL0 IOID_9
#define CC1350_LAUNCHXL_I2C0_SDA0 IOID_8

I2C操作如下:

I2C_Handle i2c_init(void)
{


I2C_Handle i2c;
I2C_init();
I2C_Params_init(&I2CParams);
I2CParams.bitRate = I2C_400kHz;
i2c = I2C_open(Board_I2C0, &I2CParams);

testGpioPin = PIN_open(&testGpioPinpinGpioState, testGpioPinTable);

if (testGpioPin == NULL) {
return false;
}

InterruptIntPinHandle = PIN_open(&InterruptPinState, testInterruptPinTable);
if(testInterruptPinTable == NULL) {
/* Error initializing button pins */
while(1);
}
/* Setup callback for button pins */
if (PIN_registerIntCb(testInterruptPinTable, &InterruptCallbackFxn0) != 0) {
/* Error registering button callback function */
while(1);
}

uint8_t txBuffer[2];
uint8_t rxBuffer[2];
I2C_Transaction i2cTransaction;
txBuffer[0] = reg;
txBuffer[1] = data;
i2cTransaction.slaveAddress = Board_i2c_ADDR;
i2cTransaction.writeBuf = txBuffer;
i2cTransaction.writeCount = 2;
i2cTransaction.readBuf = rxBuffer;
i2cTransaction.readCount = 1;

I2C_transfer(i2c, &i2cTransaction);


}