STM32 Smart Home Project Design and Secure Boot Concepts

Click on the “Microcontroller” above, then click the upper right corner… select “Pin/StarOfficial Account to receive the latest tweets!

  • Introduction

    • Implementing High Cohesion and Low Coupling with C Language

    • Microcontroller Study: Typical 8051 Chip Pins

    • Secure Boot (Part 2) Basic Concepts and Framework

    • STM32G4 NVIC Interrupt System

    • STM32 Smart Home Project Design

    • Project Practice Part 4: STM32 Smart Car Hardware Connections (Wiring Part)

    • A Billionaire Beauty Asked a Junior Developer, Can the Serial Port Transmit My Love?

    • Countless Real Attempts, Resolved – Error: Flash Download Failed

    • STM32 GPIO Ports

    • ESP32S Compilation Error for Development Board Node32S.

  • Microcontroller Recruitment Bulletin

  • Microcontroller Project Supply and Demand Information

Implementing High Cohesion and Low Coupling with C Language

1. Principles

Low coupling means that modules should exist as independently as possible. While some connection between modules is inevitable, the interfaces between them should be minimal and simple. Thus, high cohesion from the perspective of each module’s internal characteristics, and low coupling from the perspective of the relationships between modules, impose requirements on our design.

Many technologies and design principles that have emerged in the development process of program design and software engineering can be interpreted from the perspective of cohesion and coupling. As beginners in C programming, we will explore how to achieve high cohesion and low coupling based on our current understanding of functions.

Regarding low coupling, the lowest degree of coupling is non-direct coupling, meaning that the relationship between two functions is entirely achieved through the control and invocation of a common calling function, resulting in the weakest coupling and the strongest independence of functions. However, it is clearly unrealistic for a group of functions to have no data transfer. Next, we pursue data coupling, where only simple data parameters are passed between the calling function and the called function, such as functions that use value-passing methods.

Some functions…

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

Microcontroller Study: Typical 8051 Chip Pins 2022-08-05 16:18:40

Related Articles

The four groups of I/O ports of the 8051 microcontroller are the channels for input and output signals. The 8051 microcontroller has four groups of I/O ports: P0, P1, P2, and P3, each with 8 pins. 2022-08-05 16:18:40 842

An Analysis of the PROTEUS Simulation Design of 8051 Series Microcontroller Application Systems An analysis of the PROTEUS simulation design of 8051 series microcontroller application systems 2021-12-26 10:08:21 1

8051 Microcontroller 1 (Overview Part 1) The Electronic Enthusiast website provides free download of “8051 Microcontroller 1 (Overview Part 1).pdf” materials 2021-11-25 11:21:07 11

8051 Microcontroller 2 (Overview Part 2) The Electronic Enthusiast website provides free download of “8051 Microcontroller 2 (Overview Part 2).pdf” materials 2021-11-25 11:21:08 3

Microcontroller Principles and Practice Learning Records Coordination of components is necessary to exert their…

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

Secure Boot (Part 2) Basic Concepts and Framework 2022-09-21 10:16:57

What is Secure Boot?

Secure boot refers to the process or mechanism that ensures the integrity of programs running on a platform. Secure boot establishes a trust relationship between firmware and applications. When secure boot is enabled, unsigned firmware or programs cannot run on the device.

This mechanism can protect the operating system from malicious attacks. Secure boot generally uses public/private keys to verify the legitimacy of firmware and application signatures.

Why is Secure Boot Needed?

Embedded devices typically start from bootrom, progressively loading spl, uboot, linux, and application programs.

This process begins with bootrom, progressively launching the linux operating system through spl and uboot.

Assuming that spl, uboot, and the linux image are stored on flash, during startup, each level of boot program needs to load the next level of boot image from flash.

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

STM32G4 NVIC Interrupt System 2022-09-21

Introduction

The STM32G431 has a total of 111 interrupt sources, so it is inevitable that two or more interrupts may occur simultaneously, or that a new interrupt may arrive while handling an interrupt service function. How should the microcontroller operate in such situations?

Microcontrollers have a mechanism for handling interrupts, and the mechanism used in STM32 series chips is: NVIC.

NVIC: Nested Vectored Interrupt Controller

In STM32, NVIC is a peripheral tightly coupled with the CM4 core. NVIC controls all interrupt-related functions in the chip and is an integral part of the core.

However, various chip manufacturers may trim the NVIC in the CM4 core during chip design, removing unnecessary parts. Therefore, the STM32 NVIC is a subset of the CM4 NVIC.

The CM4 core supports 256 interrupts, including 16 system exceptions and 240 external interrupts.

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

STM32 Smart Home Project Design 2021-10-29 21:03:10

Article Directory [Hide] Introduction

STM32 End Program Design Function Introduction Specific Implementation Temperature and Humidity Collection Light Intensity Collection Receiving and Processing Serial USART2 Data Controlling LEDs and Buzzers

ESP8266 End Program Design Function Introduction Specific Implementation Complete Code

Android End Program Design Function Introduction Specific Implementation Adding MQTT Dependencies Permissions Configuration Display Interface Interface Control

Effect Preview

Introduction

This project is the final project design for the embedded course. It did not turn out well (please don’t criticize too harshly…), especially the STM32 data processing part, as I just started learning STM32 and I am also a bit rusty with using pointers in C language (although I have learned it before, I forgot most of it). I was hesitant to use it casually, so some code designs are not good and can only accomplish simple functions. The ESP8266 uses the NodeMCU development board, developed with Arduino IDE (because there are many existing libraries and abundant materials). The APP was made using Android Studio, from the network.

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

Project Practice Part 4: STM32 Smart Car Hardware Connections (Wiring Part) 2022-09-21

STM32 Smart Home Project Design and Secure Boot Concepts

From the previous articles, we have roughly understood the basic hardware selection and composition framework of the car. The next step is to begin the practical part, and the first part of the practical work is the basic wiring of the hardware, which is mainly divided into the power drive part, the development board part, and the sensor part.

First, let’s look at the wiring methods for the driver module, motor, and power supply. Refer to the driver module in the image below:

1) First, the left and right sides have output A and output B, which connect to two motors.

2) The three-terminal blue wiring base has 12V input, GND, and 5V output. The 12V connects to the battery for power supply, while the 5V can be used to power the development board.

3) Logic input: This is the 4P black pin header part, which connects to the 4 IOs of the development board, corresponding to the IO configuration in the code.

Thus, the wiring for a single driver board is completed. However, our car is 4WD, requiring two driver boards for 4WD control. How should the wiring be done? I have drawn a simple diagram for reference.

Copyright Notice: This article is authored by CSDN blogger ‘nandyco’

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

A Billionaire Beauty Asked a Junior Developer, Can the Serial Port Transmit My Love? 2022-09-21

In the previous section, we briefly discussed the memory-to-memory routine in DMA. This section explains how to configure DMA for data transfer from memory to peripherals. WB32 has many peripherals, but when it comes to DMA transferring data from memory to peripherals, it generally refers to using the serial port as the peripheral. In this section, we…

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

Countless Real Attempts, Resolved – Error: Flash Download Failed 2022-09-21

Record of the Learning Process

After learning STM32, I completed the task assigned by my teacher to verify my learning. After soldering the STM32 minimum system and the USB power supply and 5V-3.3V module, I found that the 3.3V module had issues.

Later, I blew the STM32 down due to a technical issue, losing two pins—truly heartbreaking for a poor student!

Always verify that the 3.3V module is working properly before soldering the STM32 minimum system. The 1117 is very fragile, and be careful not to mess up the pin packaging!

Next, I will explain the STM32 SWD download mode. I am using STM32F103RCT6.

After confirming that the minimum module and voltage conversion are working correctly, I attempted to download the program, which worked at the time. However, later, while debugging the LCD display module, I… well, things went downhill.

As you can see, the pink one failed, while the red one downloaded successfully.

But later, no matter what I did, it just wouldn’t work. I spent a long time on it, searched for a lot of information online, and everything regarding the magic wand settings was fine, but I just couldn’t download!

Plus, at that time, my soldering station was being used by a classmate, and I didn’t believe it. How did it start?

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

STM32 GPIO Ports 2022-09-21

STM32 Smart Home Project Design and Secure Boot Concepts

Article Directory [Hide] Pull-up Resistor Structure

Pull-up Resistor Structure

Push-pull Output

GPIO: General Purpose Input & Output

STM32 chips have GPIOA, GPIOB…GPIOG, etc., with a maximum of 16 pins (Pin0, Pin1…Pin15) for each port.

Each I/O port of STM32 can be programmed freely, but the I/O port registers must be accessed in 32-bit words. Each I/O port of STM32 is controlled by 7 registers.

STM32 GPIO ports can be configured by software into 8 modes:

Push-pull output, open-drain output, push-pull multiplexed functions, open-drain multiplexed functions;

Analog input, floating input, pull-down input, pull-up input.

GPIO Level Output HAL Library Function

void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

ESP32S Compilation Error for Development Board Node32S 2022-09-21 00:23:09

Source Code

#include

#define led_type WS2812 // LED type

#define led_pin 14 // Control pin

#define color GRB // RGB LED order: red, green, blue

#define num 30 // Number of LEDs

#include

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)

#error Bluetooth is not enabled! Please run ‘make menuconfig’ to enable it

#endif // Check if Bluetooth is enabled, if not, please run to enable it

…… Long press the QR code to access the original text

STM32 Smart Home Project Design and Secure Boot Concepts

Microcontroller Recruitment Bulletin

Microcontroller Development Engineer 09-21 10,000-15,000, Shenzhen-Longgang District | 2 years experience | Associate Degree Embedded Software Engineer 09-21 15,000-30,000, Shenzhen-Longhua District | 3-4 years experience | Associate Degree Electronic Engineer 09-21 8,500-13,000·13 salaries, Shenzhen-Longgang District | 3-4 years experience | Associate Degree Microcontroller Development Engineer 09-21 6,000-8,000, Changsha-Changsha County | 3-4 years experience | Associate Degree Electronic Testing Engineer 09-21 150,000-200,000/year, Xi’an | 2 years experience | Bachelor’s Degree SCADA Application Developer 09-21 10,000-20,000, Nantong-Rugao City | 2 years experience | Bachelor’s Degree Senior Electronic Engineer 09-21 15,000-25,000·13 salaries, Dongguan-Huangjiang Town | 10+ years experience | Bachelor’s Degree Embedded Software Engineer (Smart Card) 09-21 13,000-25,000, Beijing-Haidian District | 3-4 years experience | Bachelor’s Degree Electronic R&D Supervisor/Senior Electronic Engineer (Instrument Development) 09-21 20,000-40,000, Suzhou-Industrial Park | 5-7 years experience | Bachelor’s Degree Electronic Engineer/Technician 09-21 80,000-150,000/year, Ningbo-Ninghai County | 2 years experience | Associate Degree Electronic R&D Engineer 09-21 300,000-600,000/year, Shanghai-MinHang District | 1 year experience | Bachelor’s Degree Hardware Engineer 09-21 10,000-15,000·14 salaries, Wuhan | 3-4 years experience | Associate Degree Senior Embedded Software Engineer (J10051) 09-21 20,000-35,000, Shanghai-MinHang District | 5-7 years experience | Bachelor’s Degree

For more details, please reply in the official account background:zp220921

Microcontroller Project Supply and Demand Information

¥ 79,999.00 Visual Intercom Terminal Development , Hunan/Changsha, Industry: Security Monitoring Status: Bidding 263 views/7people have bid¥ 10,000.00 ELM327 Solution , Beijing/Beijing, Industry: Smart Home Status: Bidding 67 views/0people have bid¥ 10,000.00 Embedded Measurement Instruments , Beijing/Beijing, Industry: Smart Home Status: Bidding 106 views/1people have bid¥ 300.00 Two Hard Drives Configured as Disk Array RAID1 on Server , Guangdong/Shenzhen, Industry: Software Development Status: Bidding 52 views/1people have bid¥ 50,000.00 FPGA Network Communication Card Development Project , Beijing/Beijing, Industry: Smart Home Status: Bidding 109 views/2people have bid¥ 40,000.00 Android Development , Guangdong/Shenzhen, Industry: Software Development Status: Bidding 134 views/4people have bid¥ 3,000.00 Capacitive Measurement Technical Support for PCAP04 , Beijing/Beijing, Industry: Industrial Electronics Status: Bidding 92 views/1people have bid¥ 30,000.00 Relay Control for Digital and Analog Signals , Beijing/Beijing, Industry: Smart Home Status: Bidding 178 views/10people have bid¥ 15,000.00 Emergency Internet Portable Package , Sichuan/Ganzi, Industry: Communications and Broadcasting Status: Bidding 124 views/4people have bid¥ 20,000.00 Smart Diaper , Beijing/Beijing, Industry: Smart Home Status: Bidding 170 views/8people have bid¥ 6,000.00 Environmental Sound Source Collection and Analysis, Audio Processing , Guangdong/Shenzhen, Industry: Consumer Electronics Status: Bidding 153 views/6people have bid¥ 10,000.00 MX880 Senior Heart Rate Blood Oxygen Temperature Blood Pressure Watch Solution , Beijing/Beijing, Industry: Smart Home Status: Bidding 106 views/3people have bid¥ 29,996.00 Car Audio , Guangdong/Guangzhou, Industry: Automotive Electronics Status: Bidding 98 views/1people have bid¥ 15,000.00 PCB Design , Beijing/Beijing, Industry: Smart Home Status: Bidding 161 views/8people have bid¥ 9,000.00 Bluetooth Power Switch , Guangdong/Zhongshan, Industry: Consumer Electronics Status: Bidding 176 views/10people have bid

For more details, please reply in the official account background:xq220921

Recommended Good Articles Click the title to jump

Microcontroller Beginner Must Read

Words from Zhou Ligong to Young People Learning Microcontrollers

Experts Talk: The Difficulty of Entry and Mastery Time Span for Software and Hardware

Reflections on Learning the 51 Microcontroller; Recommended Learning Materials; Several Essential Programs to Write

Comparison of Several Microcontrollers Used

ARM+LINUX Learning Path (Learning Order, Knowledge Points, and Recommended Books)”

Differences and Connections between ARM/DSP/FPGA/CPLD/SOPC/SOC”

Fun Electronic Production: Food Power Generation in the Hands of Artists – Electronic DIY

My Experience: From a Production Line Worker to a Microcontroller Engineer

Things Hardware Engineers Need to Learn

“Learning the Essence of Analog Electronics”

“7 Mechanical Principles Experiments for Boys to Learn How to Flirt”

All conditioned phenomena are like a dream, an illusion, a bubble, a shadow, like dew or a flash. One should contemplate them like this!
STM32 Smart Home Project Design and Secure Boot ConceptsWelcome to forward, comment, like, and share, thank you for your support!

Leave a Comment