S32K324: clock initialization when jump from Boot into Appli

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K324: clock initialization when jump from Boot into Appli

431 Views
Drifter22
Contributor II

Hi,
I'm using the MCTPTX1AK324 demoboard with the related example code as a starting point for implementing a Bootloader code that jumps to an Application.
Clock initialization now is present (with same configuration) both into Boot code and Appli code: if I call jump function before executing clock initialization (into Boot code) the jump is correctly executed, otherwise it doesn't work.
Is this problem related to the fact that the clock inizialization would be done two times? How can I fix this (because I need to set clock configuration/initialization into Boot code before jumping into Appli)?
Thanks

Tags (1)
0 Kudos
3 Replies

405 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Drifter22,

What do you mean by it does not work?

Do you see a fault exception or is the application stuck in a loop?

Is the HSE_FW installed on that MCU?

Do you set all the clocks precisely to one of the clock options available in the RM, Section 24.7.2 Clocking use case examples?

 

Thank you,

BR, Daniel

0 Kudos

387 Views
Drifter22
Contributor II

Hi @danielmartynek , thanks for the answer.

I see a Hard Fault exception because of a timeout expiration into a clock initialization function, as you can see below:
clk_init_fault_01.png

The fault is raised by Clock_Ip_ReportClockErrors(CLOCK_IP_REPORT_TIMEOUT_ERROR, Config->Name); into the following function (i didn't copy the last part of the function):

static void Clock_Ip_CompleteSxoscOsconEocv(Clock_Ip_XoscConfigType const* Config)
{
    boolean TimeoutOccurred = FALSE;
    uint32 StartTime;
    uint32 ElapsedTime;
    uint32 TimeoutTicks;
    uint32 SxoscStatus;
    uint32 Instance;

    if (NULL_PTR != Config)
    {
        Instance = Clock_Ip_au8ClockFeatures[Config->Name][CLOCK_IP_MODULE_INSTANCE];

        if (Config->Enable != 0U)
        {
            if(0U == Config->BypassOption)
            {
                Clock_Ip_StartTimeout(&StartTime, &ElapsedTime, &TimeoutTicks, CLOCK_IP_TIMEOUT_VALUE_US);
                /* Wait until xosc is locked */
                do
                {
                    SxoscStatus = ((Clock_Ip_apxXosc[Instance]->STAT & SXOSC_SXOSC_STAT_OSC_STAT_MASK) >> SXOSC_SXOSC_STAT_OSC_STAT_SHIFT);
                    TimeoutOccurred = Clock_Ip_TimeoutExpired(&StartTime, &ElapsedTime, TimeoutTicks);
                }
                while ((0U == SxoscStatus) && (FALSE == TimeoutOccurred));

                if (TimeoutOccurred)
                {
                    /* Report timeout error */
                    Clock_Ip_ReportClockErrors(CLOCK_IP_REPORT_TIMEOUT_ERROR, Config->Name);
                }


HSE is not installed.

I use clock configuration based on a RTD Motor Control example. Here is my configuration:
nxp_clock_cfg1.pngnxp_clock_cfg2.pngnxp_clock_cfg3.png

 

0 Kudos

381 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Drifter22,

The clock configuration is not correct.

The dividers between the clocks must be configured according to one of the clock options.

danielmartynek_0-1704962439886.png

We can't guarantee the specified functionality of the MCU otherwise.

It is recommended to use one of the options precisely.

 

I'm not sure this is the root cause, but it should be fixed first.

 

Regards,

Daniel

 

0 Kudos