35. Experiment of USMART debugging component

Publisher:科技创客Latest update time:2017-11-10 Source: eefocusKeywords:USMART Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Basic process of USMART debugging components

     USMART is a smart serial port debugging interactive component developed by ALIENTEK. Through it, you can call any function in the program through the serial port assistant and execute it.

1. What is USMART

35. Experiment with USMART debugging components
       You can send commands to the microcontroller through the serial port. After receiving the command, the microcontroller will call the corresponding function. This can speed up the debugging of the program and is more convenient.

35. Experiment with USMART debugging components
2. Characteristics of USMART

35. Experiment with USMART debugging components


35. Experiment with USMART debugging components
Functions that need to be debugged with USMART need to be registered in usmart_config.c.

example:

// Initialize the function name list (added by the user)

//Users directly enter the function name and search string to be executed here

struct _m_usmart_nametab usmart_nametab[]=

{

#if USMART_USE_WRFUNS==1 //If read and write operations are enabled

(void*)read_addr,"u32 read_addr(u32 addr)",

(void*)write_addr,"void write_addr(u32 addr,u32 val)",  

#endif

(void*)delay_ms,"void delay_ms(u16 nms)",

(void*)delay_us,"void delay_us(u32 nus)",

(void*)LCD_Clear,"void LCD_Clear(u16 Color)",

(void*)LCD_Fill,"void LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)",

(void*)LCD_DrawLine,"void LCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2)",

(void*)LCD_DrawRectangle,"void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2)",

(void*)LCD_Draw_Circle,"void Draw_Circle(u16 x0,u16 y0,u8 r)",

(void*)LCD_ShowNum,"void LCD_ShowNum(u16 x,u16 y,u32 num,u8 len,u8 size)",

(void*)LCD_ShowString,"void LCD_ShowString(u16 x,u16 y,u16 width,u16 height,u8 size,u8 *p)",

(void*)led_set,"void led_set(u8 sta)",

(void*)test_fun,"void test_fun(void(*ledset)(u8),u8 sta)",      

(void*)LCD_ReadPoint,"u16 LCD_ReadPoint(u16 x,u16 y)",

};   

2. USMART Configuration

35. Experiment with USMART debugging components
Note: Different platforms use different USMART packages, for example, the Battleship version cannot be used on the Mini version.

Take LCD experiment as an example:

1. Copy the USMART folder to the LCD experiment.

2. Open the LCD project, create a new USMART group in Groups, then add the three .c files in USMART, and add the path of the header file to the project path.

35. Experiment with USMART debugging components

3. Register the function to be debugged

Note that you need to comment out the two external declarations and the two functions that have been declared.

4. Initialize USMART in the main() function

Now the compilation fails.

Because the timer is used in USMART, the timer library function needs to be added to the project.

After adding it, compile it.

Initialize USMART

usmart_dev.init(72); //The entry parameter is the system clock.

In the main() function, include the USMART header file.

Then register the function to be called in usmart_config.c

For example:

(void*)LCD_Clear,"void LCD_Clear(u16 Color)",

Pay attention to the format when registering.


35. Experiment with USMART debugging components


3. USMART debugging experiment

First use list to list the available functions

Enter the function in the serial debugging assistant and observe the phenomenon.

You can debug functions through the serial port debugging assistant, without having to re-write new programs into the microcontroller every time, which is very convenient.


Keywords:USMART Reference address:35. Experiment of USMART debugging component

Previous article:34. Memory Management
Next article:I2C bus learning and EEPROM

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号