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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
191 次查看
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 项奖励
回复
1 解答
156 次查看
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 项奖励
回复
2 回复数
157 次查看
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 项奖励
回复
148 次查看
Yongxingjia
Contributor II

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

0 项奖励
回复