cancel
Showing results for 
Search instead for 
Did you mean: 

STCU registers - SW access

alessandro2
Associate III
Posted on March 10, 2017 at 18:37

Hello everyone,

I'm working with SPC56EL60L3 and SPC5STUDIO v5.0.

Reading the reference manual RM0032 I understand the STCU registers are memory mapped and accessible for the software to read/write, but I can't find how to access the registers using the SPC5STUDIO API.

How are those registers named? I expect I'm going to have to write something like STCU.REG_NAME.R.. 

OK what do I need to write in place of STCU?

Thank you.

 Regards

Alessandro

5 REPLIES 5
alessandro2
Associate III
Posted on March 12, 2017 at 18:05

Hi,

I think I need to give some more details on what I need to do, to make things more clear.

Basically I want to implement Power on Self Test, as described in th STCU section of RM0032.

The RM describes what the software should do, to check the outcome of the self test procedure (which is run during the reset phase), after the reset phase has completed.

At page 1300 I found the following diagram:

0690X00000606Y3QAI.png

Point 3 states that the SW needs to check teh results of the self test. Detailed on how this check should be carried on are given at page 1301:

 ''The Integrity SW should perform operations based on the STCU status conditions after the self test. Even if no errors are reported, the Integrity SW should confirm that all MBIST and LBIST finished successfully and no further error is flagged. This software confirmation prevents a fault within the STCU itself from incorrectly indicating that the self test passed. ...''

So, it looks like the SW need to check the results before control is handed over to  the Apps SW.

The first question is related to where the place where this check should be run.

Is it already part of the startup code? I've been lookking at the startup code from the _reset_address (in boot.s) to the call to the main function (in crt0.s) and I could'n find anything..

if not: where should I place this check?

Assuming the first question is answered, how should I check the STCU register to determine how the self test ended up?

(this is the question from the previous post, rephrased). I can't find the STCU registers declarations in the SPC5STUDIO API.

Sample code would be great.

I have a third question, but I leave for the next post, when I'll have answers to the two questions above 🙂 

Thank you 

Regards

Alessandro

Posted on March 16, 2017 at 11:24

Hello Alessandro ,

it depends on the collector

Collector: Collects and updates the status and error conditions related to the L/MBIST

execution and STCU internal operation. The Collector sends the BIST error information to the FCCU and signals the MC_RGM to begin a functional reset.

I think that you should check the interruption by enabling this interruption :

Done

MC_RGM

56 0x0380 16'Functional' Reset Alternate EventInterruptMC_RGM MC_RGM

Failure

252 0x0FC0 16 Self Check RCC0 Failure FCCU

253 0x0FD0 16 Self Check RCC1 Failure FCCU

for your information, The include files SPC56EL does not contain the mapping on STCU module

you can use check some reset valuebefore going to the main section.

#define STCU_SKC (*(vuint32_t *)0xC3FF4008)
#define STCU_ERR (*(vuint32_t *)0xC3FF401C)
#define STCU_ERRK (*(vuint32_t *)0xC3FF4020)
#define STCU_LBS (*(vuint32_t *)0xC3FF4024)
#define STCU_LBE (*(vuint32_t *)0xC3FF4028)
#define STCU_MBSL (*(vuint32_t *)0xC3FF403C)
#define STCU_MBSH (*(vuint32_t *)0xC3FF4040)
#define STCU_MBEL (*(vuint32_t *)0xC3FF4044)
#define STCU_MBEH (*(vuint32_t *)0xC3FF4048)
#define STCU_LB_MISREL0 (*(vuint32_t *)0xC3FF4088)
#define STCU_LB_MISREL1 (*(vuint32_t *)0xC3FF40A8)
#define STCU_LB_MISREL2 (*(vuint32_t *)0xC3FF40C8)
#define STCU_LB_MISREH0 (*(vuint32_t *)0xC3FF408C)
#define STCU_LB_MISREH1 (*(vuint32_t *)0xC3FF40AC)
#define STCU_LB_MISREH2 (*(vuint32_t *)0xC3FF40CC)
#define STCU_LB_MISRRL0 (*(vuint32_t *)0xC3FF4090)
#define STCU_LB_MISRRL1 (*(vuint32_t *)0xC3FF40B0)
#define STCU_LB_MISRRL2 (*(vuint32_t *)0xC3FF40D0)
#define STCU_LB_MISRRH0 (*(vuint32_t *)0xC3FF4094)
#define STCU_LB_MISRRH1 (*(vuint32_t *)0xC3FF40B4)
#define STCU_LB_MISRRH2 (*(vuint32_t *)0xC3FF40D4)�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Sorry , we have no example on STCU.

Best regards

Erwan

Posted on April 03, 2017 at 17:44

Hello Erwan,

thank you for your reply.

I think I don't fully get what you explained..

Looking at the RM0032 document I found this: 

43.1.3.1:

Reported errors

In the case of reported errors, the Integrity SW should:

   • Read the STCU_LBS flag register to determine which LBISTs failed.

   • Read the STCU_LBE flag register to determine which LBISTs did not finish.

   • Read the STCU_MBSL and STCU_MBSH flag registers to determine which MBISTs failed.

   • Read the STCU_MBEL and STCU_MBEH flag registers to determine which MBISTs did not finish.

   • Read the STCU_ERR register to check whether there has been an internal STCU failure.

43.1.3.2:

No reported errors

In the case of no reported errors, the Integrity SW should confirm the following:

• The signature registers of each of the LBIST results match their corresponding expected values: For each LBIST: – Read the STCU_LBMISREL/H and STCU_LBIST_NMISRRL/H registers to check the coherency with the STCU_LBS and STCU_LBE bits.

– Read the registers described in Section 43.1.3.1, Reported errors,�? and verify that their values are as expected.

It looks like at some moment, after the reset, I need to check the STCU registers anc check them against expected values.

Now I have the defines allowing to access the registers.

The question is: where do I place the above-mentioned checks?

Is it OK to place them in the main application? Or should i place them in the startup code?

thank you.

Regards

Alessandro 

Posted on April 04, 2017 at 11:24

Hello Alesandro ,

i have checked on K2 or SPC56EL. (Soc Functional Valid Team)

I think that you can place the code on main application

  Best regards

                    Erwan

Posted on April 26, 2017 at 17:11

Hello Erwan,

thank you for your feedback.

I've been reading the reference manual and trying to implement the STCU test after boot, but there's still something that's not 100% clear.

Let's suppose I'm going to check the STCU for errors.

If errors are reported, declare the power on self test failed and exit.

If no errors are reported, I need to check the STCU registers to verify if all the tests have run to completion.

Would the following code be OK?

Thank you.

Regards

Alessandro

&sharpdefine STCU_LBE_OK 0x00000007U

&sharpdefine STCU_MBEL_OK 0xFFFFFFFFU

&sharpdefine STCU_MBEH_OK 0x00000007U

int32_t postStcuTest( void )

{

   int32_t retVal_i32;

   if(STCU_ERR != 0U)

   {

      /* errors are reported by STCU */

      retVal_i32 = POST_ERROR;

   }

   else

   {

      /* no errors are reported by STCU */

      /*

       * need to check if all the tests

       * have run to completion

       */

   if( ( STCU_LBE != STCU_LBE_OK )

      || ( STCU_MBEL != STCU_MBEL_OK )

      || ( STCU_MBEH != STCU_MBEH_OK ) )

   {

      retVal_i32 = POST_ERR;

   }

   else

   {

      /*

      * need to check if all the tests

      * have completed sucesfully

      */

      if ( ( STCU_LB_MISRRL0 != STCU_LB_MISREL0 )

         || ( STCU_LB_MISRRH0 != STCU_LB_MISREH0)

         )

       {

           retVal_i32 = POST_ERR;

        }

      else

      {

           retVal_i32 = POST_OK;

      }

     }

   }

return retVal_i32;

}