Part Number: TDA2
Tool/software: TI-RTOS
Hi,
I'm using dcan example with tda2xx_evm_bios_all config on tda2xx evm board with Vision SDK (PROCESSOR_SDK_VISION_03_01_00_00).
After turning on DCAN_INCLUDE(DCAN_INCLUDE=yes) in vision_sdk\apps\configs\tda2xx_evm_bios_all\ cfg.mk, dcan1 can be tested as expected in external loopback mode.
In order to test dcan2, vision_sdk\apps\src\rtos\modules\dcan\utils_dcan.c is modified, since utils_dcan.c only support dcan1 . The modification can be seen bellow.
But it seems that the dcan ISR is not entered, causing the code stuck at Utils_dcanWaitForTxComplete().
Is the modification correct? Did I miss some configuration? Thanks!
--- utils_dcan_original.c 2018-06-14 18:05:18.280695070 +0800
+++ utils_dcan_modified.c 2018-06-14 18:09:01.520685249 +0800
@@ -121,7 +121,8 @@
-#define UTILS_DCAN_INST (SOC_DCAN1_BASE)
+#define UTILS_DCAN_INST (SOC_DCAN2_BASE)
@@ -553,7 +554,9 @@
Utils_dcanWaitForIfReg(UTILS_DCAN_INST, UTILS_DCAN_TX_IF_REG);
+ Vps_printf("Utils_dcanWaitForTxComplete\n");
Utils_dcanWaitForTxComplete(mbxIndex);
+ Vps_printf("Utils_dcanWaitForTxComplete done\n");
@@ -1088,13 +1091,19 @@
PlatformUnlockMMR();
/* Clock Configuration. */
- PlatformDCAN1PrcmEnable();
+ if(UTILS_DCAN_INST == SOC_DCAN1_BASE)
+ PlatformDCAN1PrcmEnable();
+ else
+ PlatformDCAN2PrcmEnable();
/* Perform the DCAN pinmux. */
- PlatformDCAN1SetPinMux();
+ if(UTILS_DCAN_INST == SOC_DCAN1_BASE)
+ PlatformDCAN1SetPinMux();
+ else
+ PlatformDCAN2SetPinMux();
/* Initialize the DCAN message RAM. */
- PlatformDcanMessageRamInit(0);
+ PlatformDcanMessageRamInit(UTILS_DCAN_INST == SOC_DCAN1_BASE? 0 : 1);
}
/**
@@ -1638,7 +1647,7 @@
UInt32 cookie = 0;
const UInt32 intrId = dcanConfig.dcanCntrlIntrId;
- IntXbar_connectIRQ(intrId, DCAN1_IRQ_INT1);
+ IntXbar_connectIRQ(intrId, UTILS_DCAN_INST == SOC_DCAN1_BASE? DCAN1_IRQ_INT1 : DCAN2_IRQ_INT1);
/* Disabling the global interrupts */
cookie = Hwi_disable();
@@ -1785,6 +1794,7 @@
+ Vps_printf("dqy dcan: init can%d!!!\n", UTILS_DCAN_INST == SOC_DCAN1_BASE? 1 : 2);
+ PlatformDcanClkConfig(UTILS_DCAN_INST == SOC_DCAN1_BASE? 0 : 1);
Utils_dcanPlatformInit();
/* Register Crossbars and IRQ numbers */
Utils_dcanConfigIntr();
Dong