[RTT routine exercises] 6.1 basic use of finsh

Source: Internet
Author: User

Finsh is a powerful tool for debugging. It can obtain system runtime information, read and write arbitrary registers and memory addresses, and directly call system functions to access system variables.

To use this function, you must enable

/* Section: finsh, a C-Express shell */
# Define rt_using_finsh
/* Using symbol table */
# Define finsh_using_symtab
# Define finsh_using_description

Add the startup function in startup. C.

# Ifdef rt_using_finsh
/* Initialize finsh */
Finsh_system_init ();
Finsh_set_device (rt_lele_device_name );
# Endif

The following are some examples.

Use the list () command to print all shell commands currently registered to the finsh System

Finsh> List () -- function list: list_mem -- list memory usage informationversion -- show RT-thread version informationlist_thread -- list threadlist_sem -- list semaphone in systemlist_event -- list event in systemlist_mutex -- list mutex in systemlist_mailbox -- list mail box in detail -- List Message queue in systemlist_mempool -- list memory pool in systemlist_timer -- list timer in systemlist_device -- list device in systemlist -- list all symbol in System -- Variable list: dummy -- dummy variable for finsh 0, 0x00000000

List_thread () to view all threads running in the current system

 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 000thread1 0x0b suspend 0x00000100 0x00000400 0x00000100 0x00000005 000 0, 0x00000000 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.