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.
CPU_wfi的含义如下:
Wait for interrupt.
Use this function to let the System CPU wait for the next interrupt. This function is implemented as a wrapper function for the WFI instruction.
您之前是执行了什么代码后跳入该语句呢?
CPUwfi的话,应该是程序跑到了某个函数,然后卡住了,函数不再返回。从调试器来看,就是设备正在等待中断 CPUwfi。
The "CPUwfi" is the expected state when the device in an idle state waiting for an interrupt
我是直接在debug模式中 直接run之后发现卡了
建议您程序运行到 mainThread(NULL); 之后进行单步调试或者设置断点调试,来看一下哪一个语句会引起这种情况。
就我直接拿开发板(没有mpu芯片 )来说,运行到 res=mpu_dmp_init(); 会进入 CPUwfi
If the transferMode is set to I2C_MODE_BLOCKING, the transferCallback argument is ignored.
If transferMode is set to I2C_MODE_CALLBACK, a user-defined callback function must be supplied.
不理解"thread context"
如图片所说:
在I2C_MODE_BLOCKING 中,调用I2C_transfer() 会阻塞,直到I2C_Transaction完成。在事务进行中调用I2C_transfer() 的其他线程也被置于阻塞状态。如果多个线程被阻塞,则优先级最高的线程将首先被解除阻塞。这意味着仲裁不会按时间顺序执行。
对于Context:程序在运行的时候,会用到CPU系统的资源,例如寄存器、栈空间等等。当前用到的这些资源,我们称之为上下文( Context)。我找到一个中文的解释,您可以看一下
https://blog.csdn.net/weixin_40599145/article/details/88032916
另外我们的例程 simplelink_msp432p4_sdk_3_40_01_02\examples\rtos\MSP_EXP432P401R\drivers\i2cmasterexample1 就是 使用的 I2C_MODE_BLOCKING