STM32 Embedded Application System Design

1. Visual code tracking and debugging

Environment: ubantu

1. Visual front-end kdbg

Installation, terminal input

sudo apt-get install kdbg

If you are prompted about what files are missing, follow the prompts to install the required packages. After the
installation is successful, enter the terminal

kdbg

As shown in the figure after successful operation:
Insert picture description here

2. Based on the cross-platform multi-type code editor VScode

The easiest way is to download it from the software store in ubantu,
Insert picture description here
Insert picture description here
enter the visual studio code,
Insert picture description here
click the first one, and then click download
Insert picture description here
. After a while, it will download automatically.
Command line download method:
download the deb file in windows, and then put it in ubantu
official website download address https://code.visualstudio.com/
Insert picture description here
Insert picture description here
into ubantu, enter the corresponding folder in the terminal, enter:

sudo  dpkg  -i   code_1.51.0-1604600753_amd64.deb

After the command is executed, you may encounter various problems. Baidu has solutions. The author has successfully installed it at one time, so I won’t go into details here.

After successful installation, the command to open vscode, terminal input

code

Insert picture description here

Install code language pack and localization:

Click on the icon at the bottom of the left side of Insert picture description here
the search box, enter the chinese, select the first Chinese Simplified
Insert picture description here
click install (because I am here already installed, uninstall it show, not finished and installed should be displayed install)
Insert picture description here
Also in The search box, enter C++, install the first two
Insert picture description here

The first time you use vscode,
click to open the folder on the initial page, all of them are the same
Insert picture description here

Choose a folder as the folder of your workspace. Here I choose MyFile. After entering the folder, click ok
Insert picture description here
and it's like this.
Insert picture description here
Create a new file hello.cpp,
Insert picture description here
where the file name is the default, click Save (Ctrl+S), Enter hello.cpp to save.
Insert picture description here
Enter the code:

#include<iostream>
using namespace std;
int main()
{
    
    
    cout<<"hello world"<<endl;
    return 0;
}

Click F5, select C++ (GDB/LLDB), select g++, and select the default configuration. At
Insert picture description here
this time, the launch.json file
Insert picture description here
will be generated.

"program": "输入程序名称,例如 ${workspaceFolder}/a.out",

To

"program": "${workspaceFolder}/a.out",

Then click Ctrl + Shift + B, the compiler options pointing arrow will appear, click
Insert picture description here
Insert picture description here
Insert picture description here
after generates tasks, json file
Insert picture description here
will "label": "echo",be changed "label": "build",
will "command": "echo Hello"be changed c "command": "g++"
back to add that

"args": ["-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out"]

The complete tasks.json file:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "command": "g++",
            "args": ["-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out"]
        }
     ]
}

Finally recompile and run

Two, Proteus simulation run stm32 program

Proteus simulation STM32 water lamp experimental routines, detailed steps
This experiment uses two software proteus and keli.
proteus: responsible for circuit design
keli: responsible for code implementation, generate hex file
after the hex file is generated, burn it in proteus, and then you can run it directly

Three, learn to use Altium Designer

Altium Designer2018 download installation and basic use

Guess you like

Origin blog.csdn.net/xianyudewo/article/details/109558994