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.

[参考译文] CC1352R:通过 SPI 发送0x00000000

Guru**** 2392905 points


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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1169425/cc1352r-sending-0x00000000-via-spi

器件型号:CC1352R

我需要通过 SPI 72位命令发送。 在命令的中间、可能连续为10个零、因此、缓冲区(大小为8、但)会忽略该命令。 我在 spi.h 中看到了有关以下内容的警告:  

 *  @warning The use of NULL as a sentinel txBuf or rxBuf value to determine
 *  whether the SPI transaction includes a tx or rx component implies
 *  that it is not possible to perform a transmit or receive transfer
 *  directly from/to a buffer with a base address of 0x00000000. To support
 *  this rare use-case, the application will have to manually copy the
 *  contents of location 0x00000000 to/from a temporary buffer before/after
 *  the tx/rx SPI transaction.

如果 消息中间出现10个零、我不知道我可以解决这个问题。

我的代码:

        transaction1T2R.count = messageSize/spiParams1T2R.dataSize;
        asciiVal = BinaryToASCII(value1T2Rstr);
        transaction1T2R.txBuf = asciiVal;
        transaction1T2R.rxBuf = (void *)masterRxBuffer;

        /* Perform SPI transfer */
        transferOK=SPI_transfer(masterSpi1T2R, &transaction1T2R);

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

    您好!

    您是否还可以指定您使用的是哪个 Simplelink SDK 版本?

    此致、

    高斯图

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

    我使用的是 simplelink_cc13xx_cc26xx_sdk_6_20_00_29

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

    您好!

    我尝试通过发送一个9字节序列来重现此情况、其中只有一个八位位组为0x00。 在我的情况下、该值不会被忽略、我可以看到0x00在0xAA 值之间传输。 您能否提供有关交易和缓冲区内容的更多详细信息?

    memset(txBuffer, 0xAA, SPI_MSG_LENGTH);
    txBuffer[3] = 0x0;
    
    transaction.count = SPI_MSG_LENGTH;
    transaction.txBuf = (void *)txBuffer;
    transaction.rxBuf = (void *)rxBuffer;
    
    transferOK = SPI_transfer(masterSpi, &transaction);

    此致、

    高斯图

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

    谢谢、这很有帮助。 之前,我 将日期按 char*转移到 SPI_Transaction,因此这些值被忽略。 现在、当我使用数组时、它可以正常工作。