Because I need to create a compilation and release tutorial for product managers who know nothing about technology, let's just delete the product-related parts and write a blog post instead, yay!
Install Software Tools#
Download the packaged portable vscode from the following link
After downloading, place it in any folder and extract it, you will find the following contents
Run 1_首次打开请运行.bat
inside, there may be a permission prompt, just grant administrator permissions, it's safe.
Note that the extracted folder should not be moved afterwards, as the required toolchain paths have been added to the system path after elevation. If you move the entire folder, you need to run 1_首次打开请运行.bat
again.
Open Project in vscode#
Click on Code.exe
to open vscode. The first time you open it, the plugins may not have loaded completely, and it might still be in English. It is recommended to close and reopen it once; the second time it should be fine.
After opening, click on File
in the upper left corner and then click Open Workspace from File
Find the project folder, there is a .vscode folder inside, which contains a .workspace file, select and open it
You may see a pop-up like this, just ignore it for now; we will configure it uniformly later.
Configure Compilation#
The sidebar should have a CMAKE
tab as shown in the picture, click to open it. Click on the first item in the configuration, and a pop-up should appear as shown in the picture, select the toolchain as Unspecified
Click on the second item in the configuration, and a pop-up should appear as shown in the picture, select MinSizeRel
Click the gear icon in the lower bar to compile and generate the products,
The products are in the build folder of the project root folder, with two files, one with a hex
suffix and one with a bin
suffix, which are the actual required products.
Synthesize Release Files#
For all product projects, they should and must consist of two software projects, meaning each product needs to be compiled in two software projects to generate products.
The first part is the software project with keywords boot
, bootload
, or BL
; this part is the firmware and will not be modified after leaving the factory. The second part does not have these keywords and is the upgradable software.
Therefore, the goal is to synthesize a file with a hex
suffix as the factory programming file, which contains the two parts mentioned above. At the same time, release a bin
suffix file that only contains the upgradable software for on-site upgrades of machines that have already been shipped.
This article is synchronized and updated to xLog by Mix Space
The original link is https://www.yono233.cn/posts/shoot/24_12_10_vscodeCMAKE