MDK-ARM project usage and transplantation

Project experience: Use the project files we provide to experience the corresponding functions of the development board

Project migration: Migrate our underlying driver code files to the project files developed by yourself

Tutorial demonstration case: LED control (GPIO)

Project experience

Use the STM32 Getting Started Tutorial: LED Control (GPIO) to demonstrate how to quickly experience our case functions.

Open the project

After decompressing the corresponding project file, find the file with the .uvprojx suffix and double-click it to open it.

image-20240830141611686

Compile the project

Click the Rebuild option on the toolbar to compile the project, and the compilation output bar will prompt the compilation results.

image-20240821213014404

Download the program

The generated .hex file is located in the OBJ folder of the project file. Use the FlyMCU software to burn the .hex file into the development board.

Project migration

Migrate the driver code of the LED project to the template project (Template) file, and use the template (Template) project to control the LED flashing.

Project files used: 1. Template

Copy file

Copy the contents of the BSP folder of the LED project to the BSP folder of the template project:

image-20240821220020192

In the same steps, copy the AllHeader.h and myenum.h files in the LED project USER folder to the template project folder:

Add header files/paths

Project management directory

Open the template project file and add the files copied from the LED project to:

image-20240821220020193

After adding successfully:

image-20240821220020194

image-20240821220020197Project target option

Add the previously copied folder path to the project header file path: If you copy a new folder into the project later, you need to add a new folder path

image-20240821220020196

Modify the main.c file

Copy the contents of the main.c file of the LED project to the main.c folder of the template project: Since the template project has no functions, you can completely copy the contents of the main.c file of the LED project. If you want to transplant a certain function later, you cannot directly replace it.

image-20240821220020198

Compile the project

If the compilation is successful and there is no error, it is likely that the transplantation is successful.

image-20240821220020199

Download the program

The generated Template.hex file is located in the OBJ folder of the LED project file. Use the FlyMCU software to burn the Template.hex file into the development board.