Basics of Bus Fault in S32DS Program

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

Basics of Bus Fault in S32DS Program

226 Views
abdul_rahman
Contributor II

Hi team,

I was trying to run a simple complementary program on a S32K358 microcontroller using the S32DS IDE. But i'm facing an error called as bus fault in the program. I have attached the highlighted screenshot of the error message below.

abdul_rahman_0-1722441809041.png

I ran the same program in an S32K344 evaluation board and there I didn't face such an error. Please explain me this fault and also the solution to this as I'm new to this IDE's programming. It would be really helpful.

S32DS-S32PLATFORM #S32K358 #BusFault 

0 Kudos
Reply
8 Replies

57 Views
abdul_rahman
Contributor II

Hi @VaneB 

I ran the Emios_PWM_Ip example code, that comes with the SDK, on my custom board with the S32K358 controller. I'm still getting the same HardFault error mentioned before. What could be the problem then?

abdul_rahman_0-1723023668800.png

 

0 Kudos
Reply

203 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

BusFault: detects memory access errors on instruction fetch, data read/write, interrupt vector fetch, and register stacking (save/restore) on interrupt (entry/exit).

HardFault: is the default exception and can be triggered because of an error during exception
processing, or because an exception cannot be managed by any other exception mechanism.

If there is no handler for a specific fault, it is escalated to HardFault.

As the code works with a S32K344, there could be a configuration problem. If it is possible could you share your project or configurations? Also, which RTD version are you using? 

 

BR, VaneB

192 Views
abdul_rahman
Contributor II

Hi @VaneB 

I have attached the .zip file of the project that the code is in. I'm using version 4.0.0 of PlatformSDK kit from NXP. 

P.S.: Is it necessary to use both Cortex-M7_0_0 (Boot) and Cortex-M7_0_2 files for programming S32K358? Why does the design studio make two files for this processor and only one file for S32K344??

0 Kudos
Reply

149 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

I have flashed your code on my S32K3X8EVB-Q289 and I did not get a bus Fault. Are you using a custom board?

Is it necessary to use both Cortex-M7_0_0 (Boot) and Cortex-M7_0_2 files for programming S32K358? No, depends if you want to work with multicore. 

Why does the design studio create two files for this processor and only one file for S32K344? Because S32K358 devices have 1 LS core and 1 single core and S32K344 devices have only 1 LS core. So one project is created for each device core.

0 Kudos
Reply

78 Views
abdul_rahman
Contributor II

Hi @VaneB 

Yes, you are right. I'm using a custom made board which uses the S32K358. What may the problem then?

0 Kudos
Reply

37 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

It seems to be a hardware problem. Since the Hard fault occurs during clock initialization, a possible root cause could be the connections of the EXTAL and XTAL pins, for this you can use as a reference the Hardware Design Guidelines for S32K3xx Microcontrollers.

0 Kudos
Reply

18 Views
abdul_rahman
Contributor II

Hi @VaneB 

As per the Hardware Design Guidelines for S32K3xx Microcontrollers the crystal oscillator design of our hardware seems to be correct. What could be other possible hardware/software reason(s) for the BusFault and HardFault errors?

0 Kudos
Reply

10 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @abdul_rahman 

From the shared images I deduce that it is a clock problem because the failure occurs in the Clock_Ip_init() function. To verify if this is the case, test the Clock_Ip_Example_S32K358 making the necessary changes to match your HW.

0 Kudos
Reply