]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/blob - packages/ti/diag/sdr/test/sdtf-test/src/sdtf_test.c
sdr_test: Update to have separate ESM configuration for different SOCs
[processor-sdk/pdk.git] / packages / ti / diag / sdr / test / sdtf-test / src / sdtf_test.c
1 /*
2  * SDR TEST
3  *
4  * Software Diagnostics Reference Test
5  *
6  *  Copyright (c) Texas Instruments Incorporated 2018-2020
7  *
8  *  Redistribution and use in source and binary forms, with or without
9  *  modification, are permitted provided that the following conditions
10  *  are met:
11  *
12  *    Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  *
15  *    Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the
18  *    distribution.
19  *
20  *    Neither the name of Texas Instruments Incorporated nor the names of
21  *    its contributors may be used to endorse or promote products derived
22  *    from this software without specific prior written permission.
23  *
24  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 #include <stdio.h>
38 #include <string.h>
40 #include <sdr_common.h>
41 #include <sdr_ecc.h>
42 #include <sdr_esm.h>
44 #include <ti/drv/uart/src/UART_utils_defs.h>
45 #include <ti/drv/uart/UART_stdio.h>
46 #include <ti/drv/uart/UART.h>
48 #include "sdtf_common.h"
49 #include "sdtf_esm.h"
50 #include "sdtf_ecc.h"
51 #include "sdtf_profile.h"
52 #include "sdtf_test.h"
53 #include "sdtf_errortype.h"
54 #include "sdtf_injecterr.h"
55 #include "sdtf_wdt.h"
56 #include "sdtf_rat.h"
57 #include "sdtf_ccm.h"
58 #include "sdtf_crc.h"
59 #include "sdtf_mpu.h"
60 #include "sdtf_exception.h"
62 #define SDTF_MAX_PERIODIC_TEST_RUN 10
64 #define SDTF_PERIODIC_TASK_TRIGGER_OFF (0u)
65 #define SDTF_PERIODIC_TASK_TRIGGER_ENABLE (1u)
67 /* Global variables */
68 static uint32_t SDTF_periodicTaskCount=0;
69 static uint32_t SDTF_interactiveTaskCount=0;
70 static uint32_t SDTF_periodicExecutionTimeMin=0xffffffffu, SDTF_periodicExecutionTimeMax=0u;
71 static uint32_t SDTF_periodicExecutionTime, SDTF_periodicExecutionTimeAvg;
72 static uint32_t SDTF_periodicExecutionFirstTime=0;
74 /* Flag to track all tasks ended */
75 volatile uint32_t SDTF_allTasksEnded=0u;
76 volatile uint32_t SDTF_periodTaskTrigger = 0u;
78 #ifdef UNITY_INCLUDE_CONFIG_H
79 #include <ti/build/unit-test/Unity/src/unity.h>
80 #include <ti/build/unit-test/config/unity_config.h>
81 #endif
83 /*********************************************************************
84  * @fn      SDTF_oneShotTestAllModules
85  *
86   * @brief   Executes all one shot tests
87  *
88  * @param   None
89  *
90  * @return  0 : Success; < 0 for failures
91  */
93 int32_t SDTF_oneShotTestAllModules(void)
94 {
96     SDR_ECC_InjectErrorConfig_t injectErrorConfig;
97     SDR_Result result;
99     SDTF_printf("\nStarting: One Shot tests");
101     SDTF_printf("\n Starting: ATCM Double bit error fixed location once test ");
103     SDTF_profileBegin(SDTF_PROFILE_ONESHOT);
104     /* -------------- OneShot Tests start ------------------------- */
105     /* Run one shot test for ATCM 2 bit error */
106     /* Note the address is relative to start of ram */
107     injectErrorConfig.pErrMem = (uint32_t *)(0x200u);
109     injectErrorConfig.flipBitMask = 0x101;
110     result = SDR_ECC_selfTest(SDR_ECC_MEMTYPE_MCU_R5F0_CORE,
111                               SDR_ECC_R5F_MEM_SUBTYPE_ATCM0_BANK0_VECTOR_ID,
112                               SDR_INJECT_ECC_ERROR_FORCING_2BIT_ONCE,
113                               &injectErrorConfig,
114                               1000);
115     SDTF_profileEnd(SDTF_PROFILE_ONESHOT);
117     if (result != SDR_PASS ) {
118         SDTF_printf("\n ATCM Double bit error: at pErrMem 0x%p: fixed location once test failed",
119                     injectErrorConfig.pErrMem);
120         return -1;
121     }
122     SDTF_printf("\n ATCM Double bit error: pErrMem 0x%p fixed location once test complete",
123                 injectErrorConfig.pErrMem);
124     SDTF_printf("\n Cycles taken %u", SDTF_profileDelta(SDTF_PROFILE_ONESHOT));
126     SDTF_printf("\n Starting: ATCM Single bit error test");
128     SDTF_profileBegin(SDTF_PROFILE_ONESHOT);
129     /* Note the address is relative to start of ram */
130     injectErrorConfig.pErrMem = (uint32_t *)(0x00);
132     /* Run one shot test for ATCM 1 bit error */
133     injectErrorConfig.flipBitMask = 0x10;
134     result = SDR_ECC_selfTest(SDR_ECC_MEMTYPE_MCU_R5F0_CORE,
135                                     SDR_ECC_R5F_MEM_SUBTYPE_ATCM0_BANK0_VECTOR_ID,
136                                     SDR_INJECT_ECC_ERROR_FORCING_1BIT_ONCE,
137                                     &injectErrorConfig,
138                                     100000);
139     SDTF_profileEnd(SDTF_PROFILE_ONESHOT);
140     if (result != SDR_PASS ) {
141         SDTF_printf("\n ATCM Single bit error at pErrMem 0x%p test failed",
142                     injectErrorConfig.pErrMem);
143         return -1;
144     }
145     SDTF_printf("\n ATCM Single bit error  at pErrMem 0x%p: test complete",
146                 injectErrorConfig.pErrMem);
147     SDTF_printf("\n Cycles taken %u", SDTF_profileDelta(SDTF_PROFILE_ONESHOT));
149     SDTF_printf("\n Starting: ESM test");
150     SDTF_profileBegin(SDTF_PROFILE_ONESHOT);
151     /* Run one shot self test of ESM */
152     result = SDR_ESM_selfTest(SDR_ESM_INSTANCE_MCU, 1000);
153     SDTF_profileEnd(SDTF_PROFILE_ONESHOT);
154     if (result != SDR_PASS ) {
155         SDTF_printf("\n ESM self test failed");
156         return -1;
157     }
158     SDTF_printf("\n ESM Self test complete");
159     SDTF_printf("\n Cycles taken %u", SDTF_profileDelta(SDTF_PROFILE_ONESHOT));
161     /* -------------- OneShot Tests end ------------------------- */
162     SDTF_printf("\nOne shot tests complete");
164     return 0; 
168 /*********************************************************************
169  * @fn      SDTF_configPeriodicTests
170  *
171  * @brief   Execute all the configured periodic tests
172  *
173  * @param   periodicConfig - configuration structure for periodic tests
174  *
175  * @return  0 : Success; < 0 for failures
176  */
177 int32_t SDTF_configPeriodicTests(SDTF_periodic_config_t periodic_config)
179     /* Reset periodic Task count */
180     SDTF_periodicTaskCount=0;
182     /* Reset flag for periodic tests */
183     SDTF_periodTaskTrigger = SDTF_PERIODIC_TASK_TRIGGER_OFF;
185     return 0; 
187 /*********************************************************************
188  * @fn      SDTF_triggerPeriodicTests
189  *
190  * @brief   Trigger the periodic tests
191  *
192  * @param   arg: Input argument
194 * @return  None
195 */
196 void SDTF_triggerPeriodicTests(uintptr_t arg)
198     volatile uintptr_t storeArg = arg;
200     /* Set the flag to trigger periodic tests */
201     SDTF_periodTaskTrigger = SDTF_PERIODIC_TASK_TRIGGER_ENABLE;
203     /* Feed watchdog timer */
204     SDTF_WDT_feedWatchdogTimer();
206 /*********************************************************************
207  * @fn      SDTF_runPeriodicTests
208  *
209  * @brief   Execute all the configured periodic tests
210  *
211  * @param   None
213 * @return  0 : Success; < 0 for failures
214 */
215 int32_t SDTF_runPeriodicTests(void)
217     SDR_Result result;
219     if (( SDTF_periodTaskTrigger == SDTF_PERIODIC_TASK_TRIGGER_ENABLE)
220         && (SDTF_allTasksEnded != 1u) ) {
222         /* Increment task count */
223         SDTF_periodicTaskCount++;
225         /* If max runs are reached print results */
226         if (SDTF_periodicTaskCount >= SDTF_MAX_PERIODIC_TEST_RUN) {
227             /* Mark all tasks_ended */
228             SDTF_allTasksEnded = 1u;
229             SDTF_printf("\n Periodic Tests: Cycle measurements");
230             SDTF_printf("\n Min: %d, Max %d Avg %d Last %d",
231                         SDTF_periodicExecutionTimeMin, SDTF_periodicExecutionTimeMax,
232                         SDTF_periodicExecutionTimeAvg, SDTF_periodicExecutionTime);
234         }
236         SDTF_profileBegin(SDTF_PROFILE_PERIODIC);
237         /* -------------- Periodic Test start ------------------------- */
238         {
239             /* Run test for ECC */
240             SDR_ECC_InjectErrorConfig_t injectErrorConfig;
242             /* Note the address is relative to start of ram */
243             injectErrorConfig.pErrMem = (uint32_t *)(0x00);
245             /* Run one shot test for ATCM 1 bit error */
246             injectErrorConfig.flipBitMask = 0x10;
247             result = SDR_ECC_selfTest(SDR_ECC_MEMTYPE_MCU_R5F0_CORE,
248                                            SDR_ECC_R5F_MEM_SUBTYPE_ATCM0_BANK0_VECTOR_ID,
249                                            SDR_INJECT_ECC_ERROR_FORCING_1BIT_ONCE,
250                                            &injectErrorConfig,
251                                            100000);
254             if (result != SDR_PASS ) {
255                 SDTF_printf("\n ATCM Single bit error at pErrMem 0x%p test failed",
256                             injectErrorConfig.pErrMem);
257                 return -1;
258              }
259         }
260         {
261              /* Run esm test 1*/
262              result = SDR_ESM_selfTest(SDR_ESM_INSTANCE_MCU,1000);
263              if (result != SDR_PASS ) {
264                  SDTF_printf("\n ESM self test 1 failed");
265                  return -1;
266              }
267         }
269         /* -------------- Periodic Tests end ------------------------- */
270         SDTF_profileEnd(SDTF_PROFILE_PERIODIC);
272         /* Get the time taken for periodic tests */
273         SDTF_periodicExecutionTime = SDTF_profileDelta(SDTF_PROFILE_PERIODIC);
274         /* First time initialiaze average data */
275         if (SDTF_periodicExecutionFirstTime == 0u) {
276             SDTF_periodicExecutionTimeAvg = SDTF_periodicExecutionFirstTime;
277             SDTF_periodicExecutionFirstTime = 1u;
278         }
279         /* Record the minimum, maximum and average values of time taken */
280         if (SDTF_periodicExecutionTime < SDTF_periodicExecutionTimeMin) {
281             SDTF_periodicExecutionTimeMin = SDTF_periodicExecutionTime;
282         }
283         if (SDTF_periodicExecutionTime > SDTF_periodicExecutionTimeMax) {
284             SDTF_periodicExecutionTimeMax = SDTF_periodicExecutionTime;
285         }
286         SDTF_periodicExecutionTimeAvg = (SDTF_periodicExecutionTimeAvg + SDTF_periodicExecutionTime) >> 1u;
288         /* Clear flag which triggered periodic task */
289         SDTF_periodTaskTrigger = SDTF_PERIODIC_TASK_TRIGGER_OFF;
290     }
291     return 0; 
294 /* Maxumum number of special commands
295  * Should match number of items in the special commands array below
296  */
297 #define SDTF_MAX_SPECIAL_COMMANDS (5u)
299 #ifdef SOC_AM65XX
300 /* Number of commands run by the "run_all" command
301  * Note: This should match number of entries in the tables below
302  */
303 #define SDTF_NUM_RUNALL_TEST_COMMANDS (41u)
305 /* Other commands not covered by run_all */
306 #define SDTF_NUM_OTHER_TEST_COMMANDS (0u)
307 #endif
309 #ifdef SOC_J721E
310 /* Number of commands run by the "run_all" command
311  * Note: This should match number of entries in the tables below
312  */
313 #define SDTF_NUM_RUNALL_TEST_COMMANDS (39u)
315 /* Other commands not covered by run_all */
316 #define SDTF_NUM_OTHER_TEST_COMMANDS (0u)
317 #endif
319 /* Maxumum number of commands
320  * Note: This should match maximumum number of entries in the tables below
321  */
322 #define SDTF_MAX_COMMANDS (SDTF_NUM_RUNALL_TEST_COMMANDS+SDTF_NUM_OTHER_TEST_COMMANDS)
324 #define SDTF_MAX_COMMAND_LEN (64u)
326 /* prototype type for test functions */
327 typedef int32_t (* SDTF_testFunctionPtr_t) (void);
329 typedef struct SDTF_commandList_s
331     char commandString[SDTF_MAX_COMMAND_LEN+1];
332     SDTF_testFunctionPtr_t commandFunction;
333 }SDTF_commandList_t;
335 /* Full list of commands */
336 SDTF_commandList_t SDTF_commandList[SDTF_MAX_COMMANDS] =
338     { "esm_selftest_MCU",            SDTF_runESMSelfTest_MCU},
339     { "esm_inject_MCU",              SDTF_runESMInject_MCU },
340     { "esm_apitest_MCU",             SDTF_runESMAPITest },
341     { "esm_negativetest_MCU",        SDTF_runESMNegativeTest},
342     { "esm_selftest_WKUP",           SDTF_runESMSelfTest_WKUP},
343     { "esm_inject_WKUP",             SDTF_runESMInject_WKUP },
344     { "esm_selftest_MAIN",           SDTF_runESMSelfTest_MAIN},
345     { "esm_inject_MAIN",             SDTF_runESMInject_MAIN },
346     { "ecc1_selftest",               SDTF_runECC1BitSelfTest },
347     { "ecc2_selftest",               SDTF_runECC2BitSelfTest },
348     { "ecc2_inject",                 SDTF_runECC2BitInjectTest },
349     { "ecc1_b0tcm0selftest",         SDTF_runECC1BitB0TCM0Bank0SelfTest },
350     { "ecc2_b0tcm0selftest",         SDTF_runECC2BitB0TCM0Bank0SelfTest },
351     { "ecc1_b0tcm0_b1selftest",      SDTF_runECC1BitB0TCM0Bank1SelfTest },
352     { "ecc2_b0tcm0_b1selftest",      SDTF_runECC2BitB0TCM0Bank1SelfTest },
353     { "ecc1_b1tcm0selftest",         SDTF_runECC1BitB1TCM0Bank0SelfTest },
354     { "ecc2_b1tcm0selftest",         SDTF_runECC2BitB1TCM0Bank0SelfTest },
355     { "ecc1_b1tcm0_b1selftest",      SDTF_runECC1BitB1TCM0Bank1SelfTest },
356     { "ecc2_b1tcm0_b1selftest",      SDTF_runECC2BitB1TCM0Bank1SelfTest },
357     { "ecc1_vimraminject",           SDTF_runECC1BitVIMRAMInjectTest },
358     { "ecc2_vimraminject",           SDTF_runECC2BitVIMRAMInjectTest },
359     { "ecc1_vimramselftest",         SDTF_runECC1BitVIMRAMSelfTest },
360     { "ecc2_vimramselftest",         SDTF_runECC2BitVIMRAMSelfTest },
361     { "crc_selftest",                SDTF_runCRCSelfTest },
362     { "crc_negativetest",            SDTF_runCRCNegativeTest },
363     { "mpu_selftest",                SDTF_runMPUSelfTest},
364     { "wdt_selftestendviolation",    SDTF_runWDTSelfTestEndViolation },
365     { "wdt_selftestwindowviolation", SDTF_runWDTSelfTestWindowViolation },
366     { "wdt_negativetests",           SDTF_runWDTNegativeTests },
367     { "RAT_test",                    SDTF_runtestRAT },
368     { "ecc_runnegativetests",        SDTF_ECC_runNegativeTests },
369     { "ecc2_programinject",          SDTF_runECC2BitCodeInjectTest },
370     { "exception_runapitests",       SDTF_runExceptionApiTests },
371     { "ecc1_inject",                 SDTF_runECC1BitInjectTest },
372 #ifdef SOC_J721E
373     { "cbass_1bitinject",            SDTF_runECC1BitCBASSInjectTest },
374     { "cbass_1bitselftest",          SDTF_runECC1BitCBASSSelfTest },
375     { "cbass_2bitinject",            SDTF_runECC2BitCBASSInjectTest },
376     { "cbass_2bitselftest",          SDTF_runECC2BitCBASSSelfTest },
377 #endif
378 #ifdef SOC_AM65XX
379     { "ccm_selftest",                SDTF_runCCMSelfTest },
380     { "ccm_selftest_polarityinvert", SDTF_runCCMSelfTestErrorForce },
381     { "ccm_vimselftest",             SDTF_runCCMVIMSelfTest },
382     { "ccm_inactivityselftest",      SDTF_runCCMInactivitySelfTest },
383     { "ccm_inject",                  SDTF_runCCMInjectError },
384     { "ccm_selftest_errorforce",     SDTF_runCCMSelftestPolarityInvert },
385 #endif
386     /* This needs to be last as it is destructive */
387     { "ecc2_vimramdedvector",        SDTF_runECC2BitVIMRAMDEDvector },
390      /* The following tests are not covered by run all */
392 };
394 char SDTF_specialCommands[SDTF_MAX_SPECIAL_COMMANDS][SDTF_MAX_COMMAND_LEN+1] =
396     /* The following are special commands */
397     "read_reg",
398     "write_reg",
399     "debug_test",
400     "run_all",
401     "help",
402 };
404 /*********************************************************************
405  * @fn      SDTF_runInteractiveTests
406  *
407  * @brief   Execute interactive tests
408  *
409  * @param   None
410  *
411  * @return  0 : Success; < 0 for failures
412  */
413 int32_t SDTF_runInteractiveTests(void)
415     char buffPointer[256];
416     char echoPrompt[] = "\n Interactive test :Enter a command or Esc to quit >";
417     char echoPrompt1[] = "Data received is:";
418     uint32_t endInteractiveTestsFlag=0;
419     int32_t retVal = 0;
420     uint32_t i;
422     SDTF_interactiveTaskCount++;
424     while(endInteractiveTestsFlag == 0)
425     {
426         /* Print prompt to UART port */
427         UART_printf(echoPrompt);
429         /* Scan input word from user */
430         if (UART_scanFmt("%s", &buffPointer) != S_PASS)
431         {
432             SDTF_printf("\n ERROR: UART_scanFmt failed");
433             endInteractiveTestsFlag = 1;
434             continue;
435         }
437         /* Check on word entered here */
438         /* If needed a command parser can be added here */
439         switch(buffPointer[0]) {
440         case '\0': /*Ignore empty string */
441             break;
443         case 27: /* Exit on ESC character */
444             endInteractiveTestsFlag = 1;
445             break;
447         default:
448             /* Display prompt  */
449             UART_printf(echoPrompt1);
450             /* Display received word */
451             UART_printf(buffPointer);
452             /* Print new line */
453             UART_printf("\n");
454             break;
455         }
457         /* Help command to display all commands */
458         if (strncmp(buffPointer, "help", SDTF_MAX_COMMAND_LEN) == 0) {
459             uint32_t i;
461             SDTF_printf("\n Here are the commands supported");
462             for(i=0u; i< SDTF_NUM_RUNALL_TEST_COMMANDS; i++) {
463                 SDTF_printf("\n %s", SDTF_commandList[i].commandString);
464             }
465             SDTF_printf("\n --------------------------------");
466             SDTF_printf("\n Other commands");
467             for(; i< SDTF_MAX_COMMANDS; i++) {
468                 SDTF_printf("\n %s", SDTF_commandList[i].commandString);
469             }
470             SDTF_printf("\n --------------------------------");
471             SDTF_printf("\n Special commands");
472             for(i=0u; i< SDTF_MAX_SPECIAL_COMMANDS; i++) {
473                 SDTF_printf("\n %s", SDTF_specialCommands[i]);
474             }
475             SDTF_printf("\n --------------------------------");
476             SDTF_printf("\n [ESC]<enter> to quit");
477         }
480         /* Help command to display all commands */
481         if ((strncmp(buffPointer, "read_reg", SDTF_MAX_COMMAND_LEN) == 0)
482             || (strncmp(buffPointer, "write_reg", SDTF_MAX_COMMAND_LEN) == 0)) {
483             char buffPointer2[256];
484             uintptr_t regAddress;
486             /* Print prompt to UART port */
487             UART_printf("Enter address in hex: ");
489             /* Scan input word from user */
490             if (UART_scanFmt("%s", &buffPointer2) != S_PASS)
491             {
492                 SDTF_printf("\n ERROR: UART_scanFmt failed");
493                 endInteractiveTestsFlag = 1;
494                 continue;
495             }
496             sscanf(buffPointer2, "%x", &regAddress);
498             if (strncmp(buffPointer, "read_reg", SDTF_MAX_COMMAND_LEN) == 0) {
499                 SDTF_printf("\n Read value at 0x%x is 0x%x", regAddress, *((volatile uint32_t *)regAddress));
500             } else {
501                 char buffPointer3[256];
502                 uint32_t regValue;
504                 /* Print prompt to UART port */
505                 UART_printf("Enter value: ");
507                 /* Scan input word from user */
508                 if (UART_scanFmt("%s", &buffPointer3) != S_PASS)
509                 {
510                     SDTF_printf("\n ERROR: UART_scanFmt failed");
511                     endInteractiveTestsFlag = 1;
512                     continue;
513                 }
514                 sscanf(buffPointer3, "%x", &regValue);
515                 *((volatile uint32_t *)regAddress) = regValue;
516                 SDTF_printf("\n Written address 0x%x with value: 0x%x read value 0x%x",
517                             regAddress, regValue, *((volatile uint32_t *)regAddress));
518             }
520         }
522         /* Command to Run all commands */
523         if (strncmp(buffPointer, "debug_test", SDTF_MAX_COMMAND_LEN) == 0) {
524             /* Add any debug test here */
526         }
527         /* Command to Run all commands */
528         if (strncmp(buffPointer, "run_all", SDTF_MAX_COMMAND_LEN) == 0) {
530             SDTF_printf("\n Running all test commands supported");
531             for(i=0u; i< SDTF_NUM_RUNALL_TEST_COMMANDS; i++) {
532                 if (SDTF_commandList[i].commandFunction!= ((void *)(0u))) {
533                     retVal = (*SDTF_commandList[i].commandFunction)();
534                     if ( retVal != 0) {
535                         break;
536                     }
537                 }
538             }
539         }
541         /* Search through all commands to execute appropriate functions */
542         for(i=0u; i< SDTF_MAX_COMMANDS; i++) {
543             if (strncmp(buffPointer, SDTF_commandList[i].commandString, SDTF_MAX_COMMAND_LEN) == 0) {
544                 if (SDTF_commandList[i].commandFunction != ((void *)(0u))) {
545                     retVal = (*SDTF_commandList[i].commandFunction)();
546                     break;
547                 }
548             }
549         }
550         if (retVal < 0) {
551             /* Print error message and check to continue*/
552             UART_printf("\n Error occurred: Enter \"continue\" command to continue");
553             /* Scan input word from user */
554             if (UART_scanFmt("%s", &buffPointer) != S_PASS)
555             {
556                 SDTF_printf("\n ERROR: UART_scanFmt failed");
557                 endInteractiveTestsFlag = 1;
558                 continue;
559             }
560             /* If continue in spite of error */
561              if (strncmp(buffPointer, "continue", SDTF_MAX_COMMAND_LEN) == 0) {
562                  /* Reset return value, so that test can continue*/
563                  retVal = 0;
564                  continue;
565              } else {
566                  /* Else end test */
567                  endInteractiveTestsFlag = 1;
568                  continue;
569              }
570         }
571     }
573     return retVal;
576 /*********************************************************************
577  * @fn      test_sdr_test
578  *
579  * @brief   Execute all sdr tests
580  *
581  * @param   None
582  *
583  * @return  None
584  */
585 void test_sdr_test(void)
587     /* Declarations of variables */
588     int32_t retVal = 0;
589     int32_t i;
591     SDTF_printf("\n Running all sdr test commands supported");
592     for(i = 0u; i< SDTF_NUM_RUNALL_TEST_COMMANDS; i++) {
593         if (SDTF_commandList[i].commandFunction!= ((void *)(0u))) {
594             retVal = (*SDTF_commandList[i].commandFunction)();
595             if ( retVal != 0) {
596                 break;
597             }
598         }
599     }
601     if (retVal == 0)
602     {
603         UART_printStatus("\n All tests have passed. \n");
604     }
605     else
606     {
607         UART_printStatus("\n Few/all tests Failed \n");
608     }
610 #if defined (UNITY_INCLUDE_CONFIG_H)
611     TEST_ASSERT_EQUAL_INT32(0, retVal);
612 #endif