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,271件の閲覧回数
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,162件の閲覧回数
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,262件の閲覧回数
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,251件の閲覧回数
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,208件の閲覧回数
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,232件の閲覧回数
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,190件の閲覧回数
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,173件の閲覧回数
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,163件の閲覧回数
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,044件の閲覧回数
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,132件の閲覧回数
fengxianeric
Contributor IV

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

0 件の賞賛
返信