I have add the bypass into OIL
Code: Select all
OS EE {
EE_OPT = "OSEE_DEBUG";
EE_OPT = "OSEE_ASSERT";
EE_OPT = "OS_EE_APPL_BUILD_DEBUG";
EE_OPT = "OS_EE_BUILD_DEBUG";
EE_OPT="OSEE_BYPASS_CLOCK_CONFIGURATION"; <----------
STATUS = EXTENDED;
ERRORHOOK = TRUE;
USERESSCHEDULER = FALSE;
USEORTI = TRUE;
KERNEL_TYPE = OSEK {
CLASS = ECC2;
RQ = LL;
};
And adding clock initialisation function in core0_main(). This function tested and works in a demo project without OS. And when i run this code :
Code: Select all
int core0_main(void)
{
StatusType status;
AppModeType mode;
CoreIdType const core_id = GetCoreID();
#ifdef OSEE_BYPASS_CLOCK_CONFIGURATION
const IfxScuCcu_PllStepsConfig IfxScuCcu_testPllConfigSteps[] = {IFXSCU_CFG_PLL_STEPS};
IfxScuCcu_Config IfxScuCcu_testClockConfig =
{
{
sizeof(IfxScuCcu_testPllConfigSteps) / sizeof(IfxScuCcu_PllStepsConfig),
(IfxScuCcu_PllStepsConfig *)IfxScuCcu_testPllConfigSteps,
IFXSCU_CFG_PLL_INITIAL_STEP,
},
IFXSCU_CFG_CLK_DISTRIBUTION,
IFXSCU_CFG_FLASH_WAITSTATE,
IFX_CFG_SCU_XTAL_FREQUENCY
};
/* standard PLL initialisation */
IfxScuCcu_init(&IfxScuCcu_testClockConfig);
//control values
g_ScuClock.pllfreq = IfxScuCcu_getPllFrequency();
g_ScuClock.cpufreq = IfxScuCcu_getCpuFrequency(IfxCpu_getCoreIndex());
g_ScuClock.spbfreq = IfxScuCcu_getSpbFrequency();
g_ScuClock.gtmfreq = IfxScuCcu_getGtmFrequency();
g_ScuClock.srifreq = IfxScuCcu_getSriFrequency();
g_ScuClock.stmfreq = IfxScuCcu_getStmFrequency();
#endif
if (core_id == OS_CORE_ID_MASTER)
{
initPeriph();
logger = createLogger(&MODULE_ASCLIN0, 115200);
IfxPort_setGroupState(&MODULE_P33, 6, 0xff, 0xFF);
tellClocks();
StartCore(OS_CORE_ID_1, &status);
StartCore(OS_CORE_ID_2, &status);
mode = OSDEFAULTAPPMODE;
}
else
{
mode = DONOTCARE;
}
StartOS(mode);
return 0;
}
The code executed until line StartCore(OS_CORE_ID_2, &status); and on this line unexpectedly jumps to 0xA0000020

- Снимок.JPG (18.56 KiB) Viewed 18134 times
The address 0xA0000020 has the first user instruction, as described in TC29x B-Step User’s Manual item 4.1.4 Boot Options Summary
Internal Start
In this basic startup mode, the first user instruction is fetched from address A000 0020H
in Internal Program Flash of the device.
this may indicate a processor reset.
Howewer, when i stop execution (with breakpoint) at the line StartCore(OS_CORE_ID_2, &status); and continue running ater that, then program continue normal work cycle without jumping to 0xA0000020.
I'm sure clock frequencies are correctly initialized by function IfxScuCcu_init(&IfxScuCcu_testClockConfig); because registers that modified by IfxScuCcu_init(..) are really changes value. (eg FLASH0_FCON)
Please, help me to understand what the function StartCore(OS_CORE_ID_2, &status) is waiting for.