zoukankan      html  css  js  c++  java
  • [RTT例程练习] 6.1 Finsh 的基本使用

    Finsh是调试的利器,它可以获取系统运行时信息,对任意寄存器和内存地址进行读写操作,还能直接调用系统函数访问系统变量。

    要使用这个功能,需要开启

    /* SECTION: Finsh, a C-Express shell */
    #define RT_USING_FINSH
    /* Using symbol table */
    #define FINSH_USING_SYMTAB
    #define FINSH_USING_DESCRIPTION

    并在startup.c 中添加启动函数

    #ifdef RT_USING_FINSH
        /* initialize Finsh */
        Finsh_system_init();
        Finsh_set_device(RT_CONSOLE_DEVICE_NAME);
    #endif


    下面举些例子。

    使用list()命令打印出当前注册到Finsh系统的所有shell命令

    Finsh>>list()
    --Function List:
    list_mem         -- list memory usage information
    version          -- show RT-Thread version information
    list_thread      -- list thread
    list_sem         -- list semaphone in system
    list_event       -- list event in system
    list_mutex       -- list mutex in system
    list_mailbox     -- list mail box in system
    list_msgqueue    -- list message queue in system
    list_mempool     -- list memory pool in system
    list_timer       -- list timer in system
    list_device      -- list device in system
    list             -- list all symbol in system
    --Variable List:
    dummy            -- dummy variable for Finsh
            0, 0x00000000

    list_thread() ,查看当前系统中运行的所有线程

    Finsh>>list_thread()
    thread  pri  status      sp     stack size max used   left tick  error
    -------- ---- ------- ---------- ---------- ---------- ---------- ---
    tshell   0x14 ready   0x00000110 0x00000800 0x000001e8 0x00000008 -04
    tidle    0x1f ready   0x000000e0 0x00000400 0x000000e0 0x00000010 000
    thread1  0x0b suspend 0x00000100 0x00000400 0x00000100 0x00000005 000
            0, 0x00000000


  • 相关阅读:
    改造vant日期选择
    css3元素垂直居中
    npm综合
    (转)网页加水印方法
    Mac下IDEA自带MAVEN插件的全局环境配置
    隐藏注册控件窗口
    High performance optimization and acceleration for randomWalk, deepwalk, node2vec (Python)
    How to add conda env into jupyter notebook installed by pip
    The Power of WordNet and How to Use It in Python
    背单词app测评,2018年
  • 原文地址:https://www.cnblogs.com/lyyyuna/p/4123913.html
Copyright © 2011-2022 走看看