S32K312 After integrating SCST, the SCST test fails the first run and passes all subsequent times

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

S32K312 After integrating SCST, the SCST test fails the first run and passes all subsequent times

Jump to solution
192 Views
Yongxingjia
Contributor II

I am using S32K312 chip to integrate SCST, the compiler used is GHS 20220104, the compilation, link attributes, and MPU are all configured according to the manual, and the macro configuration in m7_scst_configuration.h is as follows:

Yongxingjia_0-1717137630461.png

S32K312 After integrating SCST, the SCST m7_scst_exception_usage_fault_test test fails the first run and passes all subsequent times

The debugging situation is as follows:

The first run m7_scst_execute_core_tests(0, 0); The result is wrong

Yongxingjia_1-1717138469712.png

2nd run m7_scst_execute_core_tests (0, 0); The result is correct

Yongxingjia_2-1717138480952.png

The first run m7_scst_execute_core_tests(0, 49); The result is wrong

Yongxingjia_3-1717138614320.png

2nd run m7_scst_execute_core_tests (0, 49); The result is correct

Yongxingjia_4-1717138643492.pngYongxingjia_5-1717138655203.png

What are the possible reasons for this happening and how to fix it?

Thank you!

 

0 Kudos
Reply
1 Solution
157 Views
martinkaspar-r3
NXP Employee
NXP Employee
Hello,
It looks like the global variables, which are placed in m7_scst_test_shell_data section, are not properly initialized.
Especially m7_scst_fault_inject_test_index variable shall be initialized to 0xFFFFFFFF.

If this variable is initialized to 0 before m7_scst_execute_core_tests function is called, then fault is injected to test with index 0 -> m7_scst_exception_usage_fault_test, and wrong signature is returned. Variable m7_scst_fault_inject_test_index is then reinitialized to 0xFFFFFFFF, so other runs returns the correct signature.

View solution in original post

0 Kudos
Reply
2 Replies
158 Views
martinkaspar-r3
NXP Employee
NXP Employee
Hello,
It looks like the global variables, which are placed in m7_scst_test_shell_data section, are not properly initialized.
Especially m7_scst_fault_inject_test_index variable shall be initialized to 0xFFFFFFFF.

If this variable is initialized to 0 before m7_scst_execute_core_tests function is called, then fault is injected to test with index 0 -> m7_scst_exception_usage_fault_test, and wrong signature is returned. Variable m7_scst_fault_inject_test_index is then reinitialized to 0xFFFFFFFF, so other runs returns the correct signature.
0 Kudos
Reply
149 Views
Yongxingjia
Contributor II

That's really the reason, thank you very much!

0 Kudos
Reply