Part Number: PROCESSOR-SDK-DRA8X-TDA4X
Tool/software: TI C/C++ Compiler
Hi, experts,
I want to integrate MCUSW/autosar software into the project of vision_apps.
I did the following:
1. copy all MCUSW/autosar source code to the vision_apps/utils and add the concerto.mak.
2. build the autosar software as a library. TARGET := app_utils_autosar TARGETTYPE := library
3. In the vision_app basic_demos add the library for linking.
4. Excute make vision_apps and debug MCU2_1 with CCS. The program is OK.
5. But when I excute make linux_fs_install_sd to copy the binary to the SD card, the MCU2_1 Program can't work correctly.
The MCU2_1 program stop in the function of CanApp_PlatformInit:
-------------------------------------------------
void CanApp_PlatformInit()
{
uint32 regVal = 0U;
printf("CanApp_PlatformInit\n");
/* Unlock lock key registers for Partition 7: IO PAD
configuration registers in MAIN_CTRL_MMR */
/* write Partition 7 Lock Key 0 Register */
CSL_REG32_WR(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1D008, 0x68EF3490);
/* write Partition 7 Lock Key 1 Register */
CSL_REG32_WR(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1D00C, 0xD172BC5A);
/* Check for unlock */
regVal = CSL_REG32_RD(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1D008);
while ((regVal & 0x1) != 0x1U)
{
regVal = CSL_REG32_RD(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1D008);
}
/* Unlocking done */
/* Below code will be replaced by Port module in further releases */
#if defined (BUILD_MCU1_0)
printf("CanApp_PlatformInit MCU1_0\n");
/* MCU MCAN 0 Tx PAD configuration */
regVal = CSL_REG32_RD(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0A8U);
regVal &= 0U;
regVal |= 0x60000U;
CSL_REG32_WR(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0A8U, regVal);
/* MCU MCAN 0 Rx PAD configuration */
regVal = CSL_REG32_RD(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0ACU);
regVal &= 0U;
regVal |= 0x60000U;
CSL_REG32_WR(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0ACU, regVal);
/* MCU MCAN 1 Tx PAD configuration */
regVal = CSL_REG32_RD(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0C0U);
regVal &= 0U;
regVal |= 0x60001U;
CSL_REG32_WR(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0C0U, regVal);
/* MCU MCAN 1 Rx PAD configuration */
regVal = CSL_REG32_RD(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0C4U);
regVal &= 0U;
regVal |= 0x60001U;
CSL_REG32_WR(CSL_WKUP_CTRL_MMR0_CFG0_BASE + 0x1C0C4U, regVal);
#endif //BUILD_MCU1_0
#if defined (BUILD_MCU2_1)
printf("CanApp_PlatformInit MCU2_1\n");
/* fix SDK bug, flynnpeng 2020-5-14 */
/* Unlock lock key registers for Partition 7: IO PAD
configuration registers in MAIN_CTRL_MMR */
/* write Partition 7 Lock Key 0 Register */
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1D008, 0x68EF3490);
/* write Partition 7 Lock Key 1 Register */
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1D00C, 0xD172BC5A);
/* Check for unlock */
regVal = CSL_REG32_RD(CSL_CTRL_MMR0_CFG0_BASE + 0x1D008);
while ((regVal & 0x1) != 0x1U)
{
regVal = CSL_REG32_RD(CSL_CTRL_MMR0_CFG0_BASE + 0x1D008);
}
/* end fix SDK bug, flynnpeng 2020-5-14 */
/* MAIN MCAN 0 Tx PAD configuration */
regVal = 0x60000U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C20CU, regVal);
/* MAIN MCAN 0 Rx PAD configuration */
regVal = 0x60000U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C208U, regVal);
/* MAIN MCAN 4 Tx PAD configuration */
regVal = 0x60006U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C020U, regVal);
/* MAIN MCAN 4 Rx PAD configuration */
regVal = 0x60006U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C024U, regVal);
/* MAIN MCAN 9 Tx PAD configuration */
regVal = 0x60006U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C0CCU, regVal);
/* MAIN MCAN 9 Rx PAD configuration */
regVal = 0x60006U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C0D0U, regVal);
/* MAIN MCAN 11 Tx PAD configuration */
regVal = 0x60006U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C11CU, regVal);
/* MAIN MCAN 11 Rx PAD configuration */
regVal = 0x60006U;
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + 0x1C120U, regVal);
#endif //BUILD_MCU2_1
/* Take MCAN transceivers out of STB mode i.e NORMAL Mode */
CanApp_EnableTransceivers();
}
---------------------------------
and I can't initialize MCAN controller.
This function can't run correctly:
-----------------------------------------
/** \brief Start up sequence : Program the interrupt muxes / priorities */
void CanApp_Startup(void)
{
/* Equivalent to EcuM_AL_SetProgrammableInterrupts */
CanApp_BuildIntList();
CanApp_InterruptConfig();
/* Initialize counters, that would be required for timed operations */
// AppUtils_ProfileInit(0);
CanApp_PowerAndClkSrc();
/* Initialize dummy CAN IF */
CanIf_Init(NULL);
}
-------------------------------
so, I have some questions about TDA4X.
1. When I use uboot to load the mcu program, can the MCU set related hardware registers, or must it be set on the Linux side.
2. How can I debug MCU program when I boot mcu program with U-boot.
3. The limitation of boot MCU program with u-boot. Why I can run my MCU program with CSS but U-BOOT can't run correctly.
autosar SDK Path as follow: sdk path/vision_apps/utils/autosar
mcu2_5F00_1.tar.gz SDK path as follow: sdk_path/vision_apps/apps/basic_demos/app_tirtos/tirtos_linux/mcu2_1
Thanks.