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.

SYSBIOS多task操作同一个SPI的问题

Other Parts Discussed in Thread: SYSBIOS

TI工程师您好,

我最近有一个疑问,SYSBIOS支持多task切换,而且本身已经有任务调度了

那么我在task1里和task2里都调用SPI和片外设备通信的话,会不会出现打架呢

因为我们定义的SPI与外部FPGA通信方式是

步骤1.写操作地址(因为FPGA内部寄存器很多,因此设计了独立的一个写地址操作)

步骤2.写命令参数

在这种模式下,如果task1在刚执行完步骤1,还没执行到步骤2的时候,sysbios将控制权切入到task2了,那么可能会出现操作混乱

用什么办法能确保在步骤1和步骤2之间不会有任务切换发生呢?

SWI可以解决这个问题吗?