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.
工具/软件:Code Composer Studio
您好!
我正在尝试为 其中一个 I2C 从设备修改和运行 CC26X2R1的 I2C 的现有示例代码、但当我运行代码时、我遇到 硬故障:强制:BUSFAULT:IMPRECISERR 错误。 我对该器件非常陌生、我在论坛中搜索了错误、但没有获得太多信息来解决该错误。 因此、我在此附上代码段和 ROV 屏幕截图、如果有人知道如何解决此问题、请为我提供帮助。 谢谢你。
我使用的是 CCS8和 SDK 3_10_00_53
bool maxim_max30102_read_reg (uint8_t uch_addr、uint8_t * puch_data) /** *\brief 读取 MAX30102寄存器 *\par 详细信息 * 此函数读取 MAX30102寄存器 * \param[in] uch_addr -寄存器地址 *\param[out] puch_data -存储寄存器数据的指针 * \retval 在成功时为 true */ { //char ch_i2c_data; I2C_Params i2cParams; I2C_Handle I2C; I2C_Transaction i2cTransaction; //ch_i2c_data=uch_addr; //配置 I2C 参数。 i2C_Params_init (&i2cParams); i2cTransaction.slaveAddress = I2C_WRITE_ADDR; i2cTransaction.writeBuf =&uch_addr; i2cTransaction.writeCount = 1; i2cTransaction.readBuf = puch_data; i2cTransaction.ReadCount = 1; // Open I2C i2c = I2C_open (Board_I2C_TMP、&i2cParams); if (I2C_transfer (i2c、&i2cTransaction) ){ //关闭 I2C I2C_Close (i2c); 返回 true; } 否则 { //关闭 I2C I2C_Close (i2c); 返回 false; } void Spo2TestFunction() { Display_Handle 显示; UART_Handle UART; UART_Params uartParams; uint8_t ucUartData="应用程序启动"; display_init(); GPIO_init(); I2C_init(); Maxim_max30102_read_reg (0xff,&ucReadData); while (1) { } } int main (void) { pthread_t 线程; pthread_attr_t attrs; struct sched_param primParam; 内部 REC; /*调用驱动程序初始化函数*/ Board_init(); /*使用默认值初始化属性结构*// pthread_attr_init (&atttrs); //Dhananjay /*设置优先级、分离状态和栈大小属性*// priParam.sched_priority = 1; //Dhananjay // retc = pthread_attr_setschedparam (&atttrs、&priParam); // retc |= pthread_attr_setdetachstate (&atttrat、pthread_create_detached); // retc |= pthread_atze_setstacksize (&s、REtattrs、ADSTACKtrack); Spo2TestFunction(); 如果(retc!= 0){ /*无法设置属性*/ while (1){} // retc = pthread_create (&thread、&attrs、Spo2TestFunction、NULL); 如果(retc!= 0){ /* pthread_create()失败*/ while (1){} // BIOS_start(); 返回(0); }
此致、
Dhananjay