Why did they use the different function interface to initialize platform on s32g3 ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Why did they use the different function interface to initialize platform on s32g3 ?

跳至解决方案
3,273 次查看
fengxianeric
Contributor IV

Hi, I am planning to integrate ipcf single instance code from SW32G_IPCF_4.8.0_D2212 and llce sample code from Can_Llce_DS_Can2Can_S32G399A_M7, and they use the different calling method althogh they used the same rtd version (4.0.0), what's the reason ? 

PlatformInit(); // llce sample main

Platform_Init(NULL_PTR);  // ipcf instance main
 

plz discuss on how to use platform initialization function when they work together ?  thanks.

 

0 项奖励
回复
1 解答
3,164 次查看
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

We don't understand the following comment:

"Plus tesing, the commented code snippets within

PlatformInit(void

which will make serial terminal failed to work,"

We don't the see usage of a serial terminal on both programs, which we do not understand.

Also, if you comment them they will make it work? Or if you comment them it will fail?

Please, let us know.

在原帖中查看解决方案

0 项奖励
回复
9 回复数
3,264 次查看
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Even though you are seeing that LLCE and IPCF example may have a different init function, under the LLCE example it can be seen that the "PlatformInit()" function referenced under the main function redirects to the "Platform_Init(NULL_PTR)" you are seeing at the IPCF example.

At the end, both example uses the same "Platform_Init(NULL_PTR)" function you are saying.

Please, let us know.

0 项奖励
回复
3,253 次查看
fengxianeric
Contributor IV

Thanks caring,  tested today with such code altered,

int main(void)
{
   // PlatformInit();
Platform_Init(NULL_PTR);  // eric
    
    Llce_Firmware_Load();
    Can_Driver_Sample_Test();
 
  //  while (1);
    vTaskDelay(500);
 
    Can_Driver_Sample_Test();
    vTaskDelay(500);
 
       while (1)   {
          Can_Driver_Sample_Test();
 
            vTaskDelay(500);
       }
 
}
 
As a result, I failed to snap frame out, but I can detected frames if switching back to PlatformInit(), thanks.
0 项奖励
回复
3,210 次查看
fengxianeric
Contributor IV

Thanks caring, initially tested below combinations,

only Platform_Init(NULL_PTR);    ----->  ipcf works, no work for llce

only PlatformInit(); ------> uboot cmd shell chaos/mixed after startm7

both --------> same phenomenon with PlatformInit()

And then do you have smart idea to correct my code ?

Thanks again

0 项奖励
回复
3,234 次查看
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

The behavior you are seeing is correct, since "PlatformInit()" function contains much more than only the "Platform_Init(NULL_PTR)". What we were referring in our previous comment was that it also contained the function used under the IPCF example, but not that it was the only one.

Please, let us know.

0 项奖励
回复
3,192 次查看
fengxianeric
Contributor IV

Hello, again update testing today,  I commented all functions before Platform_Init, problems come out when I comment second function with PlatformInit(),

void PlatformInit(void)
{
    /* Configure S32G clocks */
    /* Enable LLCE partition */
    Mcu_Init(MCU_VARIANT);
    Mcu_InitClock(McuClockSettingConfig_0);  //  problem coming
//     while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )
//     {
//         /* Busy wait until the System PLL is locked */
//     }
//     Mcu_DistributePllClock();
//     Mcu_SetMode(McuModeSettingConf_0);

// #ifdef USE_PORT_HLD
//     Port_Init(PORT_VARIANT);
// #else
//     Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);
// #endif

//     OsIf_Init(NULL); /* enable system timer for timeout detection */

    /* Configurations for IRQ routing, priority and enable through Platform plugin. */
    Platform_Init(NULL);

    // Can_Enable_Timestamp();

}
 
THanks
0 项奖励
回复
3,175 次查看
fengxianeric
Contributor IV

Plus tesing, the commented code snippets within

PlatformInit(void

which will make serial terminal failed to work,

 /* Configure S32G clocks */
    /* Enable LLCE partition */
    Mcu_Init(MCU_VARIANT);
    ///////////////////////////////////////////////////////

    // Mcu_InitClock(McuClockSettingConfig_0);  //  problem coming
    // while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )
    // {
    //     /* Busy wait until the System PLL is locked */
    // }
   
    //  Mcu_DistributePllClock();
    // Mcu_SetMode(McuModeSettingConf_0);
//////////////////////////////////////////////////////////////////////
0 项奖励
回复
3,165 次查看
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

We don't understand the following comment:

"Plus tesing, the commented code snippets within

PlatformInit(void

which will make serial terminal failed to work,"

We don't the see usage of a serial terminal on both programs, which we do not understand.

Also, if you comment them they will make it work? Or if you comment them it will fail?

Please, let us know.

0 项奖励
回复
3,046 次查看
fengxianeric
Contributor IV
Plz permit me to add comments in detail based on your response,
We don't understand the following comment:

"Plus tesing, the commented code snippets within
PlatformInit(void)
which will make serial terminal failed to work,"

We don't the see usage of a serial terminal on both programs, which we do not understand.
[explain] we make it run by uboot startm7 command.
Also, if you comment them they will make it work? Or if you comment them it will fail?
[explain] ipcf can work, but failed to run if we call this func within PlatformInit(void),
-----
Mcu_InitClock(McuClockSettingConfig_0); // problem coming
-----
it will make serial terminal "zombie", so I can't continue to run startm7 command ?
Clear now ?
THanks and sorry if giving not detailed description.
0 项奖励
回复
3,134 次查看
fengxianeric
Contributor IV

Ipcf sample running by uboot command, I am doing integration with llce sample.

0 项奖励
回复