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.

[参考译文] CC2652R7:SPI_MODE_Blocking 崩溃板?

Guru**** 2484615 points
Other Parts Discussed in Thread: LP-CC2652R7

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1192618/cc2652r7-spi_mode_blocking-crashing-board

器件型号:CC2652R7

您好!

在针对 LP-CC2652R7使用芯片锁定应用示例时,如果未指定超时,在从模式下使用 SPI_TRANSLT()函数将锁定电路板。 这是预期的吗?

在以下示例中、如果  未指定 params.transferTimeout = x;、则电路板看起来挂起-即串行调试中没有输出。

请注意、在以下情况下、不会通过 SPI 总线传输任何数据:

void SpiSlaveTask (void * pvParameter)

  SPI_Params   参数;
  SPI_Transaction 事务;
  uint8_t     rxBuffer[8];
  布尔       RC;

  SPI_PARAMS_INIT (params);
  params.bitrate = 4000000;
  params.transferMode = SPI_MODE_BLOCKING
  params.transferTimeout = 500000;  //必须指定此参数  
  params.frameFormat = SPI_POL0_PHA1;
  params.mode = SPI_SLAVE;
  SPI_Handle SPI = SPI_open (CONFIG_SPI_0、params);

  

  vTaskDelay (50000);
  plat_log ("调试:SPI-slave running ");

  while (true)
  {
    transaction.count = 1;
    transaction.txBuf = nulptr;
    transaction.rxBuf =(void*) rxBuffer;
    memset (rxBuffer、0、sizeof (rxBuffer));

    RC = SPI_TRANSFERT (SPI、事务);
    如果( RC )
    {
      plat_log ("调试-> 0x%x"、rxBuffer[0]);
    }
    plat_log ("调试:超时");
    
  }
实际上,SPI_TRANSF()看起来根本不起作用。 只有"1"的计数大小才会接收一些数据。 发送多个字节、并验证这些字节是否通过逻辑分析仪发送、在 TI 端不会产生任何结果。 SPI_TRANSF()只是超时,从不指示它没有收到任何数据。  
  uint8_t rxBuffer[8];
  。 。 。
  transaction.count = sizeof (rxBuffer);
  transaction.txBuf = nulptr;
  transaction.rxBuf =(void*) rxBuffer;