Dear All
我在CC2640R2F工程simple_peripheral添加了SPI的驱动上去,编译提示内存一直不足,但是我添加SPI的代码并不是很多,所以请教一下是哪里的问题
谢谢
Viki Shi:
应该时添加方式有问题,请参考SPI driver进行添加:dev.ti.com/…/node
Tank-Bilway:
回复 Viki Shi:
请教一下应该如何添加
谢谢
Viki Shi:
回复 Tank-Bilway:
如下是一个简单测试,在 Simple Peripheral project上添加SPI功能,slave,block模式,需要搭配master进行收发:
SPI_Handle handle; SPI_Params params; SPI_Transaction transaction; uint8_t rxBuf[100]; // Receive buffer // Init SPI and specify non-default parameters SPI_Params_init(¶ms); params.bitRate = 1000000; params.frameFormat = SPI_POL1_PHA1; params.mode = SPI_SLAVE; // Configure the transaction transaction.count = 100; transaction.txBuf = NULL; transaction.rxBuf = rxBuf; // Open the SPI and perform the transfer handle = SPI_open(Board_SPI, ¶ms); for(;;) {SPI_transfer(handle, &transaction); }
Tank-Bilway:
回复 Viki Shi:
好的再请教一下为什么在SPI_Init的任务里加了 函数SPI_transfer(handle, &transaction)的死循环,编译就不会出现#10010和#10990_D的错误,如果去掉了就会出现错误,加了死循环会不会一直在这里循环?
谢谢支持
for(;;) {
SPI_transfer(handle, &transaction);
}