Es32 graphical debugging software es-dap-viewer

There are many ways for MCU to output information to debugging terminal. Today we will introduce a more dazzling and cool debugging magic weapon that can graphically display data – es-dap-viewer. Es DAP viewer is a PC software launched by essemi, which can analyze data in real time and display graphically when the target MCU is running. Users can simply connect the target es32 chip to the ES link II debugger or ES daplink debugger and start the ES DAP viewer software to display the values of multiple variables like an oscilloscope. It supports data acquisition through the following three modes:

  1.   UART print mode:The user sends the data to the PC in a fixed format through the serial port, and the upper computer software draws the received data into a waveform according to the user interface attribute configuration.
  2.   SWD print mode:In this mode, there is no additional UART pin. PC software obtains data through SWD debugging interface. Users only need to use essemi_ swd_ The printf function writes the data to the target buffer.
  3.   Global variable monitoring mode:This mode also obtains data through SWD debugging interface, and allows a certain number of variables to be selected for visualization by reading an AXF file.

Es DAP viewer download link (copy to browser to open): http://www.essemi.com/index/product/detail ? id=896

1. UART print mode

On the left is the drawing window; On the right is the configuration window, including serial port selection and parameter setting window, data processing window and frame format setting window; At the bottom is the channel selection bar, which supports up to 10 channels.

PC interface operation instructions

The general process of UART print drawing debugging is as follows:

  1. After opening es-dap-viewer, selectUART-PrintTab to enter the UART print interface.
  2. Select the communication serial port in the serial port selection and parameter setting window and configure the communication parameters. According to UART communication protocol, users need to configure baud rate, stop bit, data bit and parity bit.
  3. Set the data type in the frame format setting window, optionalUint8Int8Uint16Int16as well as Uint32and Int32
  4. Click Open serial port To start data transmission, clickStart displayYou can see the real-time waveform of the current debugging data in the drawing window.
  5. ClickpreservationThe received data can be saved. click Clear cacheYou can clear the graphics in the current display interface. clickInitial proportionYou can the display scale of the current view when it returns to the initial state. clickbackground color The color box on the right selects the background color of the current view.
  6. ClickDisplay mode Drop down menu to selectWaveform displayand data display。 It should be noted that when selectingdata displayWhen, the original data sent by the user program (excluding frame header, function code, data length and checksum) is displayed in the data display window, and one frame of data is displayed in each line.
  7. ClickStart displayWaveform or data start dynamic display.
  8. Input boxDisplay durationDefault to50000ms, you can enter the appropriate value according to the actual situation. After pressing enter, the display range of abscissa will be updated.

Communication protocol and program examples

The communication protocol used by UART print is shown in the table below:

The UART print communication protocol of es-dap-viewer is described in detail as follows:

  1. The data frame of UART print is composed of frame header, function code, data length, user data and cumulative checksum. The frame header is fixed as 0xaaaa of two bytes and the function code is fixed as 0xf1.
  2. data_ Len represents the total byte length of user data contained in the data frame, excluding frame header, function code, data length and cumulative checksum.
  3. check_ Sum means the cumulative checksum from the first byte of the data frame, that is, the frame header, to the last byte of user data. The high bit is rounded off and only the low eight bits are reserved.
  4. The upper computer of es-dap-viewer parses the received data according to the above protocol and performs verification to display reliable data, which means that when using UART print function, the user must send data according to the protocol, otherwise the upper computer will discard the data because the verification fails.
  5. UART print supports up to 10 channels, and each channel supports displayUint8Int8Uint16Int16as well asUint32andInt32Format data.

The following procedure can produce the effect shown in the moving picture above.



2. SWD print mode

For the introduction of SWD print interface, please refer to UART print.

instructions

User program needs to useessemi_ swd_ printfFunction writes the data into the target buffer, and es-dap viewer will read the data through the SWD debugging interface and display it on the PC interface. The implementation of SWD print function requires the following four configuration files:

essemi_ swd_ print. h

essemi_ swd_ print_ conf.h

essemi_ swd_ print. c

essemi_ swd_ print_ printf. c

After the user successfully adds the above four configuration files in the project, the following header files are included in the files that need SWD print function#include“essemi_swd_print.h”After, you can callessemi_ swd_ printf()The function puts the data to be printed into the exclusive memory area of SWD, and then the upper computer takes out the data from the memory area and displays it in the drawing window.

The configuration file is placed in the following installation directory of es-dap-viewer: \configure\essemi_ swd_ print。

The following points should be noted:

When using the function of SWD print function, the function must be called first int essemi_ swd_ configupbufferAnd functions int essemi_ swd_ configdownbufferTo initialize the uplink (MCU to PC) and downlink (PC to MCU) buffers. For the first parameter bufferindex = 0, the SWD component has configured the buffer and default size. The size configuration is essemi_ swd_ print_ conf.h By macro definition in#define BUFFER_ SIZE_ UP(1024)and #define BUFFER_ SIZE_ DOWN(16)Therefore, when using buffer 0, the configuration is relatively simple. Follow this format:

SWD print currently only supports byte, halfword and word output, so when using function int essemi_ swd_ printf(unsigned BufferIndex, const char *sFormat, 。..)The output must be formatted with “%. 2x”, “%. 4x” or “%. 8x” according to the output data bit width. Also, the first character of the output must be a space.

When connecting the DAP debugger, you must ensure that the target MCU program is downloaded and reset correctly, otherwise you will not be able to connect the DAP debugger.

Program example

The following procedure can produce the effect shown in the moving picture above.

3. Global variable monitoring mode

instructions

The user first needs to click the select AXF file button to load the AXF file generated by the compiler, and then select the global variable to be monitored at the bottom of the page.

By clicking the drop-down box DAP equipment Select the DAP equipment scanned by the upper computer. When the upper computer scans the target cmsis-dap equipment, click open a connectionCommunication can be established with the device.

On the left is the drawing window; On the right is the configuration window, including AXF file and DAP device selection window, and data display configuration window; The following is a list of global variables resolved to.

The process of global variable monitoring drawing debugging is as follows:

  1. OpenES-DAP-ViewerThen select the global variable monitoring tab to enter the global variable monitoring interface.
  2. Click Select AXF fileButton to load the AXF file generated by the compiler.
  3. Click the drop-down boxDAP equipmentSelect the DAP device scanned by the upper computer. When the upper computer scans the target DAP device, clickopen a connectionEstablish a connection with the device.
  4. In the global variable list below, you can view the name, address and data type size of the resolved global variable. Click the corresponding in the row of the global variable ColorUnit, you can select the color of the global variable in the waveform display window. In addition, although structural variables can be resolved at present, structural members and array members are not supported at present. Therefore, it is invalid to check the global variables of structural type in the global variable list. Checking the array members will have different effects due to different array types.
  5. ClickStart displayButton to see the real-time change waveform of the current debugging data in the drawing window. In the global variable list below Value(0x)Column to view the current value of the global variable.
  6. In addition, users can also choose to save data, display cursor, clear cache and change background color in the data processing window.
  7. For other operations, please refer to the operation instructions of UART print interface.

Program example

The following procedure can produce the effect shown in the moving picture above.

Leave a Reply

Your email address will not be published. Required fields are marked *