yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Self-balancing Robot Car📖
00.Get started quickly
  • 01.Balance car manual
  • 02.Balancing car assembly
  • 03.Get started quickly
  • 04.Balance car interface description
  • 05.Common Problem Analysis
  • 06.Balance Car V2 Library Function Development Manual
01.Environment development
  • 01.MDK-ARM installation
  • 02.STM32CubeIDE installation
  • 03.Common driver installation
  • 04.Download the program
  • 05.MDK-ARM project usage
  • 06.Program simulation
  • 07. VSCode Installation
02.STM32 getting started course
  • 01.Project creation
  • 02.LED Control(GPIO)
  • 03.Buzzer control(GPIO)
  • 04.Button control(EXTI)
  • 05.Serial communication(USART)
  • 06.Voltage detection(ADC)
  • 07.Basic timer(TIM)
  • 08.Universal timer(TIM)
  • 09.Advanced Timer(TIM)
  • 10.I2C Communication(I2C)-OLED
  • 11.SPI communication(SPI)-2.4G handle
  • 12.Independent Watchdog (IWDG)
  • 13.Window Watchdog (WWDG)
  • 14.DMA-USART
  • 15.DMA-I2C
03.STM32 expansion course
  • 01.Battery voltage detection (ADC)
  • 02.Ultrasonic module-measuring distance (TIM)
  • 03.Motor drive+encoder (TIM)
  • 04.OLED Data-Display(I2C)
  • 05.MPU6050-Data Read (I2C)
  • 06.Bluetooth module-Data reading (USART)
  • 07.2.4G handle-Data reading (SPI)
  • 08.Tracking module-Read status (GPIO)
  • 09.CCD module-Reading data (ADC)
  • 10.Electromagnetic module-Reading data (ADC)
  • 11.K210 module-Serial communication (USART)
  • 12.Tmini-Plus lidar-Reading data (USART)
04.Robot car PID control course
  • 01.PID basic concept
  • 02.PID example analysis
  • 03.P, PI, PD controller theory
  • 04.Position PID
  • 05.Incremental PID
  • 06.Cascade PID
  • 07.Balance principle of car
  • 08.Car upright control (PD)
  • 09.Car speed ​​control (PI)
  • 10.Car steering control (PD)
  • 11.Got angle and angular velocity (DMP algorithm)
  • 12.Got angle and angular velocity (Kalman filter algorithm)
  • 13.Got angle and angular velocity(Complementary filter algorithm)
05.Robot car basic course
  • 01.Car parameter adjustment
  • 02.Ultrasonic obstacle avoidance
  • 03.Ultrasonic follow
  • 04.Bluetooth remote control
  • 05.Load balance
06.Robot car advanced course
  • 01.4-channel tracking
  • 02.4-channel tracking avoid
  • 03.2.4G handle control
  • 04.CCD tracking
  • 05.CCD tracking avoid
  • 06.Electromagnetic tracking
  • 07.K210-QR code recognition
  • 08.K210-Color line tracking
  • 09.K210-Color follow
  • 10.K210-Self learning
  • 11.K210-Number recognition
  • 12.Lidar avoid
  • 13.Lidar guard
  • 14.Lidar follow
  • 15.Lidar patrol
  • 16.Lidar wall tracking-straight line
  • 17.Lidar wall tracking-multiple walls
  • 18. DIY Automatic driving car
07.Robot car LQR control
  • Robot car LQR control
08.Circuit design
  • 01.Overall circuit design
  • 02.STM32 minimum system
  • 03.Serial port circuit design
  • 04.Power circuit design
  • 05.MPU6050 Circuit Design
  • 06.Motor drive circuit design
09.Mathematical model
  • Mathematical model
10.Expand course
  • Autonomous Driving
Download
  • APP(Android)
  • Codes
  • Hardware-Info
  • SCH
  • Software Tools
  • STM32_Chip_DataSheet
  • 3D_Model_File
  • Video_PPT
Download ZIP

Welcome to Self-balancing Robot Car repository

01.Project creation

Project creation

Project creation

Project creationProject directoryFolder frameworkCMSISFWLibUSERBSPOBJConfigure the projectCreate a new projectChip selectionProject file managementProject target optionsTargetOutputC/C++Compile the projectTemplate.hex

The tutorial demonstrates how to create a new STM32F103RCT6 standard library project.

Project directory

Before using MDK-ARM to create a new project, we need to operate the folders under the project: the operation includes creating a new folder and copying the official standard library firmware package file to the specified folder.

Folder framework

Create a new folder according to the following directory:

  • Template: Project name

  • CMSIS: Kernel driver and startup file

  • FWLib: Standard library function source code file

  • USER: Project file and user file

  • BSP: Development board peripheral driver file

  • OBJ: Compile and generate file

image-20240722144718505

CMSIS

  • core_cm3.c

  • core_cm3.h

  • stm32f10x.h

  • system_stm32f10x.c

  • system_stm32f10x.h

  • startup_stm32f10x_hd.s: can be used with STM32F103RCT6

  • startup_stm32f10x_md.s: can be used with STM32F103C8T6

Note: startup_stm32f10x_hd.s and startup_stm32f10x_md.s cannot be imported into the project directory at the same time, otherwise an error will be reported!

xxxxxxxxxx
The kernel driver and startup files correspond to the path of the STM32 standard firmware library (STM32F10x_StdPeriph_Lib_V3.6.0):
STM32F10x_StdPeriph_Lib_V3.6.0\Libraries\CMSIS\CM3\CoreSupport
STM32F10x_StdPeriph_Lib_V3.6.0\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x
STM32F10x_StdPeriph_Lib_V3.6.0.zip\STM32F10x_StdPeriph_Lib_V3.6.0\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm

image-20240722155524109

FWLib

  • inc

    • misc.h

    • stm32f10x_adc.h

    • stm32f10x_bkp.h

    • stm32f10x_can.h

    • stm32f10x_cec.h

    • stm32f10x_crc.h

    • stm32f10x_dac.h

    • stm32f10x_dbgmcu.h

    • stm32f10x_dma.h

    • stm32f10x_exti.h

    • stm32f10x_flash.h

    • stm32f10x_fsmc.h

    • stm32f10x_gpio.h

    • stm32f10x_i2c.h

    • stm32f10x_iwdg.h

    • stm32f10x_pwr.h

    • stm32f10x_rcc.h

    • stm32f10x_rtc.h

    • stm32f10x_sdio.h

    • stm32f10x_spi.h

    • stm32f10x_tim.h

    • stm32f10x_usart.h

    • stm32f10x_wwdg.h

  • src

    • misc.c

    • stm32f10x_adc.c

    • stm32f10x_bkp.c

    • stm32f10x_can.c

    • stm32f10x_cec.c

    • stm32f10x_crc.c

    • stm32f10x_dac.c

    • stm32f10x_dbgmcu.c

    • stm32f10x_dma.c

    • stm32f10x_exti.c

    • stm32f10x_flash.c

    • stm32f10x_fsmc.c

    • stm32f10x_gpio.c

    • stm32f10x_i2c.c

    • stm32f10x_iwdg.c

    • stm32f10x_pwr.c

    • stm32f10x_rcc.c

    • stm32f10x_rtc.c

    • stm32f10x_sdio.c

    • stm32f10x_spi.c

    • stm32f10x_tim.c

    • stm32f10x_usart.c

    • stm32f10x_wwdg.c

xxxxxxxxxx
The path of the standard library function source code file corresponding to the STM32 standard firmware library (STM32F10x_StdPeriph_Lib_V3.6.0):
STM32F10x_StdPeriph_Lib_V3.6.0\Libraries\STM32F10x_StdPeriph_Driver\inc
STM32F10x_StdPeriph_Lib_V3.6.0\Libraries\STM32F10x_StdPeriph_Driver\src

image-20240722152410912

USER

新建工程时,会将工程放在该目录下。

  • main.c

  • stm32f10x_conf.h

  • stm32f10x_it.c

  • stm32f10x_it.h

xxxxxxxxxx
The path of the user file corresponding to the STM32 standard firmware library (STM32F10x_StdPeriph_Lib_V3.6.0):
STM32F10x_StdPeriph_Lib_V3.6.0\Project\STM32F10x_StdPeriph_Template

BSP

When creating a new project, store the peripheral driver files of the development board

OBJ

When creating a new project, store the compiled files

Configure the project

Create a new project

Double-click to open the Keil uVision5 software on the desktop

image-20240722153340917

New project: Select the newly created USER folder as the project path, and you can define the project file name yourself

image-20240722154024169

image-20240722154226355

Chip selection

Search in the chip search bar: STM32F103RC

xxxxxxxxxx
If you don’t have a chip, you can install the STM32F1 series firmware package yourself

image-20240722154416506

image-20240722154835425

Project file management

It is recommended to add according to the project folder framework

②: Modify according to the project name

③: Modify according to the subfolder name

④: Add the .c and .s files in the corresponding folder

​x
Note:

1. Only one startup file can be added. We use STM32F103RCT6 here, so import the startup_stm32f10x_hd.s file
VSCode Installation
LED Control(GPIO)

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文