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

跳至解决方案
1,786 次查看
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 解答
1,751 次查看
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 项奖励
回复
4 回复数
591 次查看
anagha12
Contributor I

We have a got SCST document - M7_S32K3XX_SCST_User_Manual.pdf from NXP.

We have written a code, attached below. 

After calling function - m7_scst_execute_core_tests inside our code, this test is getting failed. Need support for the same.

0 项奖励
回复
575 次查看
Mirek_Franek
NXP Employee
NXP Employee

Hello anagha12,

Thank you for reaching out to us. We’re sorry to hear that you’re experiencing issues with the integration of our software.

To assist you more effectively, could you please provide us with a few additional details about the problem? Specifically:

  • The version of the SCST You are using
  • How you called SCST (a code snippet would be helpful)
  • Any errors or unexpected behavior you encountered
  • The environment in which the SCST is running (e.g., operating system, bare metal application, etc.)

Thank You!
Best Regards
Mirek

0 项奖励
回复
1,752 次查看
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 项奖励
回复
1,739 次查看
Yongxingjia
Contributor II

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

0 项奖励
回复