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