[BUG]TDA4 main域 CAN 无法进中断

2023-12-17 05:28:25


??

关键词

嵌入式、C语言、autosar、TDA4
在这里插入图片描述

平台说明

项目Value
OSautosar OS
autosar厂商vector
芯片厂商TI
编程语言C,C++
编译器HighTec (GCC)

一、背景

??在将mcu域的部分can 移植到main域的时候发现无法进入can中断。

二、根本原因

2.1 Com模块

??TDA4中使用到了中断路由,如果中断路由没有关闭到mcu域的路径,即使main域收到can,也不会在main域中产生中断。

#define BRS_ENABLE_CHANNEL_CAN_1
#define BRS_ENABLE_CHANNEL_CAN_2
#define BRS_ENABLE_CHANNEL_CAN_3
#define BRS_ENABLE_CHANNEL_CAN_4
#define BRS_ENABLE_CHANNEL_CAN_5
#define BRS_ENABLE_CHANNEL_CAN_6

#if defined BRS_ENABLE_CHANNEL_CAN_4
  /* MAIN MCAN 6 routing */
  rmIrqReq.valid_params = TISCI_MSG_VALUE_RM_DST_ID_VALID;
  rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID;
  rmIrqReq.src_id = TISCI_DEV_MCAN6;
  rmIrqReq.global_event = 0U;
  /* Src Index 0 - mcanss_ext_ts_rollover_lvl_int,
     Src Index 1 - mcanss_mcan_lvl_int Line 0,
     Src Index 2 - mcanss_mcan_lvl_int Line 1 */
  rmIrqReq.src_index = 1U;
  rmIrqReq.dst_id = TISCI_DEV_MCU_R5FSS0_CORE0;
  rmIrqReq.dst_host_irq = CSLR_MCU_R5FSS0_CORE0_INTR_MAIN2MCU_LVL_INTRTR0_OUTL_0 + 2;
  rmIrqReq.ia_id = 0U;
  rmIrqReq.vint = 0U;
  rmIrqReq.vint_status_bit_index = 0U;
  rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;
  retVal = Sciclient_rmIrqSet(&rmIrqReq, &rmIrqResp, SCICLIENT_SERVICE_WAIT_FOREVER);
  if ((uint32)0 != retVal)
  {
    while (1)
      ;
  }
#endif /*BRS_ENABLE_CHANNEL_CAN_4*/

三、措施

??关闭移植到main域的can路由后问题解决。

文章来源:https://blog.csdn.net/weixin_42447823/article/details/135039912
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。