S32K SCST in IAR

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

S32K SCST in IAR

1,671 Views
PETER_BUSH2021
Contributor I

Dear Sir,

I am using s32k144 to develop a project with IAR as It is requested BY OEM . It needs to run core self test after POR. I try to porting S32K144_M4SCST_1.0.6_D2106 to IAR . But it fails to pass as SCST . I want to know whether there is the SCST demo code in IAR or how to change the linker file of IAR anf INIT CODE for SCST.

My test code is as below: void main(void)

{ uint8_t * m4_scst_test_shell_data_dest;

uint8_t * m4_scst_test_shell_data_src;

uint8_t * m4_scst_test_shell_data_src_end;

#pragma section = ".m4_scst_test_shell_data"

#pragma section = ".m4_scst_test_shell_data_init"

m4_scst_test_shell_data_dest = __section_begin(".m4_scst_test_shell_data"); m4_scst_test_shell_data_src=__section_begin(".m4_scst_test_shell_data_init"); m4_scst_test_shell_data_src_end = __section_end(".m4_scst_test_shell_data_init");

while (m4_scst_test_shell_data_src_end != m4_scst_test_shell_data_src)

{ *m4_scst_test_shell_data_dest = *m4_scst_test_shell_data_src;

m4_scst_test_shell_data_dest++; m4_scst_test_shell_data_src++;

}

result = m4_scst_execute_core_tests(0U,43U);

0 Kudos
Reply
4 Replies

1,658 Views
martinkaspar-r3
NXP Employee
NXP Employee

Hello,

note, that you are not using the latest product version which is 1.0.8 (there are known bugs in 1.0.6, see LOKD). The full version of the product (released in source code) is ready for IAR, see the exact compiler version in the Release Notes.

An example code could be:

       /* Execute all tests */

       result = m4_scst_execute_core_tests(0,43);

                     …

      /* Check SCST result ! */

       if (result==M4_SCST_TEST_WAS_INTERRUPTED)

       {

           /* Some, test was interrupted.

               Please check m4_scst_last_executed_test_number variable and run

               interrupted test + not executed tests again  */          

       }

       else if (result == 0x929940F1)

       {

           /* All tests passed */

       }

       else

       {

           /* Error, please check m4_scst_last_executed_test_number  variable

                to have number of failed test */  

       }

0 Kudos
Reply

1,637 Views
PETER_BUSH2021
Contributor I

Hello! Martin,

I used the  lastest version of 1.0.8 ,the issue still exist.

When executing  result = m4_scst_execute_core_tests(0,43);

It will stop at the sentence of NOP  in the scst_exception_wrapper.s and fail the test.

I think the linker of IAR should do some modification and do some initialization before 

executing  result = m4_scst_execute_core_tests(0,43).

But I do not know what and how to do.

 

m4_scst_ISR_dispatcher:
/*
4 NOPs are used to clean up possibly active IT-block queue.
This may happen if the dispatcher routines are entered in thread mode
during interrupt "tail" processing.
Valid for:
m4_scst_ISR_dispatcher
*/

NOP
NOP
NOP
NOP
 

0 Kudos
Reply

1,615 Views
martinkaspar-r3
NXP Employee
NXP Employee

Hello,

This description  looks like an issue with connected debugger which most probably stops SCST tests execution.

In case of the debugger is connected then the exceptions triggered by SCST Library for testing purposes can be captured directly by the debugger,  tests execution then stops in the m4_scst_ISR_dispatcher function, see the attached picture.

To avoid this behavior, please configure your debugger not to capture the exceptions!

 E.g. for Lauterbach debugger this can be done by running the following commands:

TrOnchip.Set.HARDERR OFF

TrOnchip.Set.BUSERR OFF

TrOnchip.Set.CHKERR OFF

TrOnchip.Set.MMERR OFF

TrOnchip.Set.STATERR OFF

 

Hope this helps

0 Kudos
Reply

1,252 Views
sungjun
Contributor II
0 Kudos
Reply