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.

[参考译文] TDA4VM: PDK API Hwip_createDirect ()可能有一些错误

Guru**** 2457760 points
Other Parts Discussed in Thread: TDA4VM, J721EXSOMXEVM

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1480771/tda4vm-the-pdk-api-hwip_createdirect-may-have-some-bugs

器件型号:TDA4VM

工具与软件:

我想在 HwiP_createDirect()中注册中断处理程序、以避免 masterISR 调用我的中断处理程序。 然而,实验结果表明,使用 Hwip_createDirect()注册的中断处理程序无法正确触发。

我的代码与此类似、 在 R5FSS0 CORE0上运行

#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <ti/csl/arch/csl_arch.h>
#include <ti/csl/hw_types.h>
#include <ti/csl/soc.h>
#include <ti/drv/sciclient/examples/common/sci_app_common.h>
#include <ti/drv/sciclient/sciclient.h>
#include <ti/drv/sciclient/soc/sysfw/include/j721e/tisci_clocks.h>
#include <ti/drv/sciclient/soc/sysfw/include/j721e/tisci_devices.h>
#include <ti/osal/HwiP.h>

#include <ti/osal/osal.h>

#include <ti/csl/arch/r5/csl_arm_r5_pmu.h>
#include <ti/csl/arch/r5/csl_vim.h>
#include <ti/csl/arch/r5/src/interrupt_priv.h>

#define INT_NUM_IRQ 32U



volatile uint32_t cnt_flag = 0;
volatile uint32_t t1 = 0;
volatile uint32_t t2 = 0;
volatile uint32_t t3 = 0;
void irq_func(){cnt_flag++;}
/* ========================================================================== */
/*                           Macros & Typedefs                                */
/* ========================================================================== */

int main(void) {
  SciApp_consoleInit();

  Sciclient_ConfigPrms_t config = {SCICLIENT_SERVICE_OPERATION_MODE_POLLED,
                                   NULL};
  int32_t status = CSL_PASS;

  status = Sciclient_init(&config);
  if (status != CSL_PASS) {
    SciApp_printf("SCIClient Init Failed\nstatus: %d", status);
    return 0;
  }

  HwiP_Params p_hwipParams;
  HwiP_Params_init(&p_hwipParams);
  HwiP_Handle p_handle;

  p_handle = HwiP_createDirect(INT_NUM_IRQ, irq_func, &p_hwipParams);
  SciApp_printf("handle: %p\n",p_handle);
  SciApp_printf("before post: %u\n",cnt_flag);
  int32_t ret = HwiP_post(INT_NUM_IRQ);
  if (ret != osal_OK) {
    SciApp_printf("not supported");
  }
  SciApp_printf("after post: %u\n",cnt_flag);
  return 0;

}

代码运行后的输出如下所示:

handle: 8001be98
before post: 0

显然,代码卡在 Hwip_post ()中。

但是、如果我将 HwiP_createDirect 替换为 HwiP_create、代码会按预期运行。

所以我认为 Hwip_createDirect 中可能有一些错误。

我的测试环境如下所示:

电流环路

软件 SDK 版本

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

    您好!

    使用直接 API 是否有任何具体原因? 您是否可以尝试使用  Hwip_create API、看看它是否有帮助?  

    此致、

    Brijesh

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

    HwiP_create API 运行良好、但是我们发现、如果通过这个 API 创建了一个 ISR、当中断发生时、首先调用 masterISR、然后是我们的自定义 ISR。 在某些时间关键的情况下、这种呼叫顺序可能不合适。 所以我们测试了 Hwip_createDirect API、发现 API 可能有一些错误。

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

    您好!

    但是我们发现、如果通过此 API 创建了 ISR、则在发生中断时、首先调用 masterISR、然后调用我们的自定义 ISR

    是的,Hwip_createDirect ()可能不会在 VIM 级别启用 IRQ,中断触发,但没有到达 CPU。您可以尝试手动启用 VIM 寄存器中的中断,以确保中断正确传递。

    请您参考 /packages/ti/csl/test/vim 该 CSL vim 示例。 请告诉我们这是否有帮助。

    此致、

    Karthik