📜 ⬆️ ⬇️

How I tested the IDE of the company "Multiklet"

As a development environment, Multiklet selected the Geany text editor with the main functions of an integrated development environment. To support the tools needed for debugging by the developers of the Multiklet company, the MC-DBG plugin was written, testing the capabilities of which will be discussed in this article.

We will start by installing the proposed development environment in the Windows operating system, for which, according to the documentation, the following steps should be performed:

  1. Download geany-1.23.1_nogtk_setup.exe and install it.
  2. Download GTK + 2.24 all-in-one bundle and unpack it into the folder with Geany.
  3. Install MSYS 1.0.11 and add the path to the make.exe utility to the Path variable.
  4. Download the plugin from the Multiclet website and unpack it into the folder with Geany.
  5. Launch Geany.
  6. In the tab "Tools / Module Manager" activate the module MC-DBG.


After activating the MC-DBG module, the MC-Files tab will appear in the side window, the MC-DBG tab in the message window, additional menu items in the Project tab of the main menu, as shown in the figure below.
')
image

Before proceeding with direct testing of the plugin, consider its main functions:
  1. Project configuration.
  2. Generate build file and build project.
  3. Navigating the list of errors encountered during the build project.
  4. Execution of the assembled project on the functional model.
  5. Debugging a project by paragraphs.
  6. Setting breakpoints in program memory.
  7. Forcing the address of the next executable paragraph.
  8. Reading data from memory and registers in the process of debugging.
  9. Writing values ​​to the data memory and registers during debugging.


It should be noted that the proposed functionality is not very wide, however, it implements all the tools I use most often, so I find the provided set is quite sufficient.

Now, we are ready to start the actual testing. Let's write on the assembler the simplest echo server, working through Uart. As the client side, we will use tcp_client.exe from the standard set of the developer of the company Multiklet.
To begin, create a new EXO.s file using standard Geany tools. We write in it the server echo code, written on the basis of the example uart0_inv.asm, available in the archive. The code is below:

.include "HDL50001_pcf.inc" .alias Get_byte 2 .text start: jmp initUART0 getl 0x00000300 wrl @1, GPIOB_BPS getl 0x00000104 wrl @1, UART0_BDR complete ;;;;; Configurate Uart ;;;;; initUART0: jmp MainLoop getl 0x0000000A wrl @1, UART0_DATA getl 0x00000003 wrl @1, UART0_CR complete ;RXD handler Rxd_int: jmp buf_TXD rdl UART0_DATA setl #Get_byte, @1 complete ;test FIFO on full buf_TXD: rdl UART0_ST getl 0x00000200 and @2 jne @1, buf_TXD je @2, Send_byte complete ;Send inverse byte Send_byte: jmp MainLoop getl #Get_byte wrl @1, UART0_DATA complete ;;Loop MainLoop: rdl UART0_ST getl 0x00000001 and @2,@1 je @1, MainLoop jne @2, Rxd_int complete 


Create a new project EXOProject. This action can be performed either by calling the context menu of the list of current projects and selecting the “New” item, or through the main menu “Project / New MC-Project”. A dialog box opens in which you want to specify the name of the new project file. After the project is successfully created, its name will appear in the MC-Files window.

Add the EXO.s file to our project using the “Add File” button of the project context menu in the MC-Files window. The result is:

image

Then you need to customize the project. Call the "Project / MC-Project Properties" and add to the "Files / Include directories" folder with HDL50001_pcf.inc. I have this C: \ MultiClet \ SDK \ include \ MCp0411100101. I left the rest of the settings by default.

Now you can try to build a project. To do this, click the Make button:

image

Errors in the compilation process:

image
In line 34, the and command must have 2 arguments. Replace "and @ 2" with "and @ 1, @ 2"

When all errors are fixed, re-build the project:

image

Now that the build is successful, we can start debugging. We execute the program on paragraphs with the Step button. The first command in the next paragraph is highlighted in green.

image

We see that the program is fixated on the MainLoop section until new data arrives on the Uart. Run tcp_client.exe and send via Uart 0x1.

image

We return to Geany. Put a breakpoint on the first command of the Send_byte paragraph and click Continue. Program execution is terminated before the Send_byte paragraph. The second register contains the Uart value. In order to get its value, enter # 2 in the left field of Watches (# denotes a register, just an address such as 2 or 0x2 is entered from the DM for reading).
Important note.

The mechanism of the breakpoints has an important feature due to the nuances of the multicellular architecture. It consists in the fact that if a breakpoint is set on the first command in a paragraph, the program will be suspended twice (before and after the execution of the paragraph). If a breakpoint is not set on the first command in a paragraph, the program will be suspended once after the execution of this paragraph.

image

Now we write the number 5 in the second register by means of the debugger. To do this, replace the number 1 with the number 5 in the right field and press the Set button (the left arrow is drawn on it).

image

Click Continue again (the program will continue). In tcp_client.exe we get a natural result.

image

Stop debugging with the Stop button.

Instead of conclusion


Thus, despite the simplicity of implementation, the proposed functionality is quite enough to fully debug even large and complex projects. The updated functionality of the toolkit allows you to significantly increase the speed of development by providing an intuitive and user-friendly interface. You can talk a lot about the advantages of one IDE over another, but all of them, by and large, provide the same features. The question of their choice is a matter of habit and taste. In the future, I would like to wish Multiclet to develop the possibility of debugging programs through JTAG on hardware, and not only on the functional model.

Source: https://habr.com/ru/post/209346/


All Articles