Creating New project : s32DS : Error clock not initializing

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

Creating New project : s32DS : Error clock not initializing

1,101 Views
Dinesh_Guleria
NXP Employee
NXP Employee

Hi NXP Device support team,

I am using following EVK S32K144EVB.
https://www.nxp.com/document/guide/get-started-with-the-s32k144evb:NGS-S32K144EVB

I am using following S32DS version :--
S32 Design Studio for S32 Platform
Version: 3.4
Build id: 201217 (Update 1

I am new to S32DS. For this purpose I first tried to test already tested sample project.
I tested this "ftm_periodic_interrupt_s32k144" project on my EVAL board its working fine, on my board S32K144EVB.


Then i created new "S32DS Application Project". In this project I did following task :--
1> configured clock for RUN mode, core clock runing at 80 MHZ.
2> Made PORTD 15,16 pins as output.
3> Configured FTM-0 as simple up timer.

I am using GDB PEMicro Interface Debugging.
I am getting following error when i do debugging, and execution of code is stuck at following DefaultISR . Getting this error :--

 

 

Initializing.
Target has been RESET and is active.
BusFault: A precise (synchronous) data access error has occurred.
Possible BusFault location: 0x4004C03C.
HardFault: A fault has been escalated to a hard fault.

 

 

Dinesh_Guleria_1-1630321363394.png

 


As per this error address 0x4004C03C, it seems to be memory map of PORTD, from excel sheet "S32K1xx_Memory_Map.xlsx" :--

 

 

Port D multiplexing control Port D 44 4 4004C000 4004CFFF

 

 

Following is my main() routine :--

 

 

int main(void)
{
/* Write your code here */
/* Write your local variable definition here */
ftm_state_t state;

/* Initialize clock module */
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

/* Initialize pins */
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

/* Initialize FTM */
FTM_DRV_Init(INST_FLEXTIMER_MC_1, &flexTimer_mc_1_InitConfig_0, &state);

/* Initialize counter */
FTM_DRV_InitCounter(INST_FLEXTIMER_MC_1, &flexTimer_mc_1_TimerConfig_0);

/* Start Counter */
FTM_DRV_CounterStart(INST_FLEXTIMER_MC_1);

/* Loop */
for (;;)
{
/* Do no thing, just wait for the interrupt */
}

return exit_code;
}

 

 

I debugged & found that error comes from this code execution in main() :--

 

 

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

 

 

Then i check the clock settings for PORT-D & FTM-0. And found that clock is not set :---
Following register PCC_PORTD & PCC_FTM0, bit-30 CGC is ZERO.

Dinesh_Guleria_0-1630321191476.png

 

Inspite of initializing my system clock this clocks are not set :--

 

 

/* Initialize clock module */
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

 

 


Please suggest how to get rid of this error. I have attached my sample project.

 

Any help from your side will be appreciated.

 

Regards,

Dinesh 

0 Kudos
2 Replies

1,081 Views
Dinesh_Guleria
NXP Employee
NXP Employee

Anyone who can suggest on this query ?

 

As I am trying to create Core_clock using external oscillator .. 8 MHZ connected on this Eval board S32K144EVB

 

I debugged the project & found  :---
What i found following function call return status : STATUS_ERROR :----

CLOCK_SYS_UpdateConfiguration()


Inside this function following line gives error :--

ret = CLOCK_SYS_SetConfiguration(g_clockState.configTable[targetConfigIndex]);

Dinesh_Guleria_0-1630336318167.png

 


It seems some issue with my configuration of clock that's why this function failing :--
ret = CLOCK_SYS_SetConfiguration(g_clockState.configTable[targetConfigIndex]);

 

Please suggest what I have made wrong settings, so that i can resolve this error.

 

Regards,

Dinesh

0 Kudos

1,065 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Dinesh_Guleria,

The CLOCK_SYS_UpdateConfiguration() function returns STATUS_ERROR here:

clock_S32K1xx.c

danielmartynek_0-1630406930035.png

If you open HSRUN configuration, you will see that the system clock frequency in your HSRUN configuration does not meet the max allowed values.

danielmartynek_1-1630407046269.png

danielmartynek_2-1630407092351.png

 

Regards,

Daniel

0 Kudos