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.

[参考译文] BQ79616EVM-021:BQ79616 EVM:在 UART 上未接收到任何消息

Guru**** 2606725 points
Other Parts Discussed in Thread: BQ79616

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

https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1220257/bq79616evm-021-bq79616-evm-not-receiving-any-message-on-uart

器件型号:BQ79616EVM-021
主题中讨论的其他器件:BQ79616

我有一块 bq79616EVM 板、我正在尝试通过 UART 将其与微控制器连接。

我遵循数据表中给出的步骤如下:


首先、发送2.5ms 的唤醒脉冲、成功地唤醒电路板。

电流消耗略有增加、板载 LED 亮起。


我将发送自动寻址命令、最后等待电路板的响应。 问题是、我没有从电路板获得任何响应。

  /* Initialize for UART_PAL */
  UART_Init(&uart_instance, UART_PAL_CONFIG);

  uint8_t cmd[] = {0xD0, 0x03, 0x4c, 0x00, 0xFC, 0x24};

  uint8_t cmdSetAutoAdd[] = {0xD0, 0x03, 0x09, 0x01, 0x0F, 0x74};

  uint8_t cmdSetAdd[] = {0xD0, 0x03, 0x06, 0x00, 0xCB, 0x44};

  uint8_t cmdSetStack[] = {0xD0, 0x03, 0x08, 0x02, 0x4e, 0xe5};

  uint8_t cmdSetBase[] = {0xD0, 0x03, 0x08, 0x01, 0x0e, 0xe4};

//  uint8_t cmd1[] = {0xC0, 0x05, 0x68, 0x10, 0x02, 0x29};
  uint8_t cmd1[] = {0xC0, 0x03, 0x4c, 0x1, 0x39, 0x24};

  UART_SendDataBlocking(&uart_instance, (uint8_t *) cmd, 6, TIMEOUT);
  while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY);

  UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetAutoAdd, 6, TIMEOUT);
   while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY);

   UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetAdd, 6, TIMEOUT);
    while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY);

    UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetStack, 6, TIMEOUT);
     while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY);

     UART_SendDataBlocking(&uart_instance, (uint8_t *) cmdSetBase, 6, TIMEOUT);
      while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY);

  UART_SendDataBlocking(&uart_instance, (uint8_t *) cmd1, 6, TIMEOUT);
  while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY);


  while(UART_GetTransmitStatus(&uart_instance, &bytesRemaining)== STATUS_BUSY);
    /* Send a welcome message */
//  UART_SendDataBlocking(&uart_instance, (uint8_t *)welcomeMsg, strlen(welcomeMsg), TIMEOUT);

  /* Infinite loop:
   *     - Receive data from user
   *     - Echo the received data back
   */
  while(1)
  {
      /* Receive and store data byte by byte until new line character is received,
       * or the buffer becomes full (256 characters received)
       */
      UART_ReceiveData(&uart_instance, buffer, 1U);
      /* Wait for transfer to be completed */
      while(UART_GetReceiveStatus(&uart_instance, &bytesRemaining) == STATUS_BUSY);

    }

代码卡在 UART_GetReceiveStatus 处、我不接收来自 EVM 板的任何内容、为了安全起见、我使用终端软件测试了此代码、我可以看到波特率是1mbps 并且接收到的数据是正确的此外、我从终端发回数据、我在固件末端接收相同的数据。

我对固件部分是否缺少某些序列或数据包中存在 CRC 错误没有疑问。  

代码中是否缺少某些内容?  EVM 上的 LED 状态含义是什么? 它处于激活模式右?

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

    您好、S:

    我们将在明天与您联系。

    此致、

    泰勒

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

    您好!

    您分享的顺序对我来说很好、我有以下问题

    1) 1)为什么要调用"UART_GetTransmitStatus" API 两次以发送广播读取命令

    2) 2)"UART_ReceiveData"是否需要 UART 数据末尾的换行符、BQ79616是否仅发送响应数据、在末尾不会添加换行符。 您能否尝试使用逻辑分析仪/示波器探测 UART 线路、以查看 MCU 的 RX 线路上是否有任何数据。

    我看到您正在发送广播读取命令、您是否还可以尝试发送器件 ID 为0的单个器件读取命令。

    谢谢。

    拉维

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

    1) 1)为什么要调用"UART_GetTransmitStatus" API 两次以发送广播读取命令

    2) 2)"UART_ReceiveData"是否需要 UART 数据末尾的换行符、BQ79616是否仅发送响应数据、在末尾不会添加换行符。 您能否尝试使用逻辑分析仪/示波器探测 UART 线路、以查看 MCU 的 RX 线路上是否有任何数据。

    我看到您正在发送广播读取命令、您是否还可以尝试发送器件 ID 为0的单个器件读取命令。

    [/报价]

    1.嗯,它在 SDK 中的错误,所以我已经调用它两次,否则我立即收到错误消息

    2.我只是想看到缓冲区上的数据,而不是我想要的\r\n,即需要在缓冲区中接收的数据。 是的、我已检查 CRO 上的数据、使用单个读取命令可以解决问题。 但它不是完整的解决方案、

    uint8_t cmdSetBas[]={ 0x90、0、0x03、0x08、0x01、 0xd2、0x1d};


    问题仍然存在、我可以在 CRO 上的 TX 线路上看到数据、但我在 MCU 上收到一个帧错误(根据我们的数据表、该错误是由停止位导致的)、我不知道哪一端是问题、

    这是我已经尝试过的方法、我已将 UART 的 MCU 设置设置为1Mbps 8-N-1、而且我 在 MCU 上没有收到任何消息、
    1.我尝试用终端软件检查 MCU 代码,我可以用相同的设置发送和接收数据

    2.我可以在 CRO 上看到 RX 和 TX 线,并且两条线都显示了一些数据

    3、它的接收器端的东西,我不明白

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

    您好!

    当您尝试使用终端软件时、您能否检查在 CRO 上看到什么数据(我建议您使用逻辑分析仪)、您在结束时是否看到从终端发送的换行符 (通常在终端软件中,按 Enter 键后,数据会附加到数据中)。

    从我在您共享的代码中突出显示的代码注释中、在收到换行符之前、它看起来像"UART_ReceiveData"块。

    您可以检查'UART_ReceiveData'的实现,它是否期望换行,并请检查您是否看到从此 API 返回的任何错误。

    此致、

    拉维

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

    因此、这是与驱动程序相关的错误、我们重新编写了驱动程序、现在我们可以看到来自 BQ79616的数据