目录
- 关键词
- 平台说明
- 一、背景
- 二、根本原因
- 2.1 Com模块
- 三、措施
关键词
嵌入式、C语言、autosar、TDA4
平台说明
项目 | Value |
---|---|
OS | autosar 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路由后问题解决。