Загрузка данных


    /* Parse Line */
    MONITOR_ParseLine(line, &argc, argv);

    /* Parse command */
    if (argc != 0)
    {
        int32_t sub = MONITOR_FindN(cmds, (int32_t) ARRAY_SIZE(cmds),
            argv[0]);

        switch (sub)
        {
            case 0:  /* ? */
            case 1:  /* help */
                for (uint8_t idx = 0U; idx < ARRAY_SIZE(cmds); idx++)
                {
                    printf("    %s\n", cmds[idx]);
                }
                break;
            case 2:  /* exit */
            case 3:  /* quit */
                status = SM_ERR_LAST;
                break;
            case 4:  /* info */
                status = MONITOR_CmdInfo(argc - 1, &argv[1]);
                break;
            case 5:  /* ele */
                status = MONITOR_CmdEle(argc - 1, &argv[1]);
                break;
#ifdef DEVICE_HAS_V2X
            case 6: /* v2x */
                status = MONITOR_CmdV2x(argc - 1, &argv[1]);
                break;
#endif
            case 7:  /* err */
                status = MONITOR_CmdErr(argc - 1, &argv[1]);
                break;
            case 8:  /* btime */
                status = MONITOR_CmdBtime(argc - 1, &argv[1]);
                break;
#ifdef DEVICE_HAS_TRDC
            case 9:  /* trdc.raw */
                status = MONITOR_CmdTrdcRaw(argc - 1, &argv[1]);
                break;
            case 10:  /* trdc */
                status = MONITOR_CmdTrdc(argc - 1, &argv[1]);
                break;
#endif
            case 11:  /* reset reason */
                status = MONITOR_CmdReason(argc - 1, &argv[1]);
                break;
            case 12:  /* shutdown */
                status = MONITOR_CmdShutdown(argc - 1, &argv[1]);
                break;
            case 13:  /* reset */
                status = MONITOR_CmdReset(argc - 1, &argv[1]);
                break;
            case 14:  /* stage */
                status = MONITOR_CmdStage(argc - 1, &argv[1]);
                break;
            case 15:  /* suspend */
                status = MONITOR_CmdSuspend(argc - 1, &argv[1]);
                break;
            case 16:  /* wake */
                status = MONITOR_CmdWake(argc - 1, &argv[1]);
                break;
#ifdef BOARD_HAS_WDOG
            case 17:  /* wdog */
                status = MONITOR_CmdWdog(argc - 1, &argv[1]);
                break;
#endif
            case 18:  /* fault */
                status = MONITOR_CmdFault(argc - 1, &argv[1]);
                break;
            case 19:  /* lm */
                status = MONITOR_CmdLm(argc - 1, &argv[1]);
                break;
            case 20:  /* power.r */
                status = MONITOR_CmdPower(argc - 1, &argv[1], READ);
                break;
            case 21:  /* power.w */
                status = MONITOR_CmdPower(argc - 1, &argv[1], WRITE);
                break;
            case 22:  /* perf.r */
                status = MONITOR_CmdPerf(argc - 1, &argv[1], READ);
                break;
            case 23:  /* perf.w */
                status = MONITOR_CmdPerf(argc - 1, &argv[1], WRITE);
                break;
            case 24:  /* clock.reset */
                status = MONITOR_CmdClock(argc - 1, &argv[1], RESET);
                break;
            case 25:  /* clock.r */
                status = MONITOR_CmdClock(argc - 1, &argv[1], READ);
                break;
            case 26:  /* clock.w */
                status = MONITOR_CmdClock(argc - 1, &argv[1], WRITE);
                break;
            case 27:  /* sensor.r */
                status = MONITOR_CmdSensor(argc - 1, &argv[1], READ);
                break;
            case 28:  /* sensor.w */
                status = MONITOR_CmdSensor(argc - 1, &argv[1], WRITE);
                break;
            case 29:  /* rst.r */
                status = MONITOR_CmdRst(argc - 1, &argv[1], READ);
                break;
            case 30:  /* rst.w */
                status = MONITOR_CmdRst(argc - 1, &argv[1], WRITE);
                break;
            case 31:  /* volt.r */
                status = MONITOR_CmdVolt(argc - 1, &argv[1], READ);
                break;
            case 32:  /* volt.w */
                status = MONITOR_CmdVolt(argc - 1, &argv[1], WRITE);
                break;
            case 33:  /* bb.r */
                status = MONITOR_CmdBb(argc - 1, &argv[1], READ);
                break;
            case 34:  /* bb.w */
                status = MONITOR_CmdBb(argc - 1, &argv[1], WRITE);
                break;
            case 35:  /* cpu.r */
                status = MONITOR_CmdCpu(argc - 1, &argv[1], READ);
                break;
            case 36:  /* cpu.w */
                status = MONITOR_CmdCpu(argc - 1, &argv[1], WRITE);
                break;
            case 37:  /* ctrl.r */
                status = MONITOR_CmdCtrl(argc - 1, &argv[1], READ);
                break;
            case 38:  /* ctrl.w */
                status = MONITOR_CmdCtrl(argc - 1, &argv[1], WRITE);
                break;
            case 39:  /* ctrl.action */
                status = MONITOR_CmdCtrl(argc - 1, &argv[1], ACTION);
                break;
            case 40:  /* ctrl.notify */
                status = MONITOR_CmdCtrl(argc - 1, &argv[1], NOTIFY);
                break;
            case 41:  /* extctrl.r */
                status = MONITOR_CmdExtCtrl(argc - 1, &argv[1], READ);
                break;
            case 42:  /* extctrl.w */
                status = MONITOR_CmdExtCtrl(argc - 1, &argv[1], WRITE);
                break;
            case 43:  /* md.b */
                status = MONITOR_CmdMd(argc - 1, &argv[1], BYTE);
                break;
            case 44:  /* md.w */
                status = MONITOR_CmdMd(argc - 1, &argv[1], WORD);
                break;
            case 45:  /* md.l */
                status = MONITOR_CmdMd(argc - 1, &argv[1], LONG);
                break;
            case 46:  /* mm.b */
                status = MONITOR_CmdMm(argc - 1, &argv[1], BYTE);
                break;
            case 47:  /* mm.w */
                status = MONITOR_CmdMm(argc - 1, &argv[1], WORD);
                break;
            case 48:  /* mm.l */
                status = MONITOR_CmdMm(argc - 1, &argv[1], LONG);
                break;
            case 49:  /* fuse.r */
                status = MONITOR_CmdFuse(argc - 1, &argv[1], READ);
                break;
            case 50:  /* fuse.w */
                status = MONITOR_CmdFuse(argc - 1, &argv[1], WRITE);
                break;
#ifdef BOARD_HAS_PMIC
            case 51:  /* pmic.r */
                status = MONITOR_CmdPmic(argc - 1, &argv[1], READ);
                break;
            case 52:  /* pmic.w */
                status = MONITOR_CmdPmic(argc - 1, &argv[1], WRITE);
                break;
#endif
            case 53:  /* idle */
                status = MONITOR_CmdIdle(argc - 1, &argv[1]);
                break;
            case 54:  /* assert */
                status = MONITOR_CmdAssert(argc - 1, &argv[1]);
                break;
            case 55:  /* syslog */
                status = MONITOR_CmdSyslog(argc - 1, &argv[1]);
                break;
            case 56:  /* group */
                status = MONITOR_CmdGroup(argc - 1, &argv[1]);
                break;
            case 57:  /* ssm */
                status = MONITOR_CmdSsm(argc - 1, &argv[1]);
                break;
            case 58:  /* custom */
                status = MONITOR_CmdCustom(argc - 1, &argv[1]);
                break;
            case 59:  /* test */
                status = MONITOR_CmdTest(argc - 1, &argv[1]);
                break;
            case 60:  /* delay */
                status = MONITOR_CmdDelay(argc - 1, &argv[1]);
                break;
            case 61:  /* ddr */
                status = MONITOR_CmdDdr(argc - 1, &argv[1]);
                break;
#if defined(GCOV) && !defined(SIMU)
            case 62:  /* gcov */
                GCOV_InfoDump();
                break;
#endif
            case 63: /* start_a55 */
                printf("%s(%d) START A55\n",__FUNCTION__,__LINE__);
                LMM_Boot_core(2U); // 2U = LM2(AP)
                break;
            case 64: /*reboot_m7*/
                {
                    uint32_t boot_vector = DEFAULT_M7_VECTOR;
                    if (argc > 1)
                    {
                        boot_vector = strtoul(argv[1], NULL, 0);
                        if (boot_vector == 0)
                        {
                            printf("[MONITOR] Warning: Invalid boot_vector 0 specified. Using default boot_vector.\n");
                        }
                    }
                    else
                    {
                        printf("[MONITOR] No boot_vector specified. Using default boot_vector.\n");
                    }

                    printf("%s(%d) reboot M7 (vector: 0x%X)\n", __FUNCTION__, __LINE__,boot_vector);
                    sm_m7_vector_reboot(1U, boot_vector);
                }
                break;
            default:
                status = SM_ERR_NOT_FOUND;
                break;
        }
    }

    /* Return status */
    return status;
}