Project DIY Soldering table is a firmware for the STM32G031F6P6 microcontroller used to control the temperature and the output information to the OLED display . It is written in CMSIS and includes written libraries for configuring and controlling peripherals.
flowchart LR
A[core] --> B(device) -->|stm32g0xx.h| H[src, inc]
A[core] --> C(arm) -->|core_cm0plus.h| H[src, inc]
A[core] --> E(sys) -->|linker.ld, startup.s..| H[src, inc]
F[common] --> |menu.h, tempControl.h...| H[src, inc]
H[src, inc] -->|i2c.c, timer.c, i2c.h, timer.h...| D{Decision}
- Workspace is organized as in the picture. The main loop of the program is executed in main.c in the /src/ directory
Note: But in future it will be RTOS management...
The project was based on the concept of FSM (finite state machine), although it is redundant. The principle of its operation is that we have event pool, in which events from different subroutines are added and processed in an endless loop. Each event has its own transition state that handles the event. In the future, the state table will be involved and the code in C ++ will probably be rewritten. The principle is shown on the slide below and you can find out more about it by following this link:
In addition, the DMA and EXTI principles are implemented in the project, which allow receiving input data without loading the main computing thread.
To build the program you need execute the make command in the terminal from the main working directory:
$ make build=Release
The result is 3 main formats of executable programs - .hex, .bin and .elf.
To flash the microcontroller, you need the stlink software. To install it use the command:
$ sudo apt-get -y install stlink-tools
After it from main directory run this command:
$ st-flash write build/Release/table.bin 0x08000000
or
$ st-flash --format ihex write build/Release/table.hex