STM32Cube Efficient Development Tutorial

Our new book “STM32Cube Efficient Development Tutorial (Introduction)” is finally available for sale on major e-commerce platforms. This is a significant book worth acquiring for many STM32 developers, as it is currently the first book on the market to systematically introduce STM32’s HAL library development technology using STM32CubeMX and STM32CubeIDE.

The “STM32Cube Efficient Development Tutorial” is divided into two parts: the “Introduction” and the “Advanced” sections, with the “Advanced” section expected to be printed around October. To summarize, this book has the following characteristics.

1. Utilizing Development Tools and Techniques of the STM32Cube Ecosystem

STMicroelectronics is currently promoting its STM32Cube ecosystem heavily. Each series of STM32 devices has an STM32Cube firmware library, which includes HAL/LL driver libraries and some middleware. ST has stopped updating the standard libraries for devices, and new models do not have standard libraries, thus the standard library development method is bound to be eliminated.

STM32Cube Efficient Development Tutorial

Figure 1: STM32 series devices’ STM32Cube firmware library (from ST official documentation)

The STM32Cube ecosystem includes tool software and embedded software libraries. STM32CubeMX and STM32CubeIDE are the two core software tools of the STM32Cube ecosystem. STM32CubeMX is used for graphical configuration of MCU on-chip resources and peripherals, allowing for the generation of project frameworks and peripheral initialization C code for various IDEs, significantly improving development efficiency. STM32CubeIDE is a programming IDE for STM32, which allows for programming, compiling, downloading, and debugging. STM32CubeIDE can fully replace the functionality of commercial software like Keil or IAR.

For students learning STM32 development or those preparing to design new products with STM32, using STM32CubeMX and STM32CubeIDE, leveraging the resources of the STM32Cube ecosystem for learning and development is the best choice because:

  • STM32CubeMX and STM32CubeIDE software are officially provided free software by ST, eliminating concerns over intellectual property risks associated with unauthorized commercial software.

  • The STM32Cube ecosystem provides a complete set of tool software, in addition to STM32CubeMX and STM32CubeIDE, there is STM32CubeProgrammer for programming, STM32CubeMonitor for system monitoring, and more.

  • The STM32Cube ecosystem has a wealth of embedded software library resources, including ST’s official MCU firmware libraries and extended libraries, as well as many third-party middleware and extended libraries, which can reduce system development difficulty and accelerate system development speed.

STM32Cube Efficient Development Tutorial

Figure 2: STM32Cube ecosystem (from ST official documentation)

2. Comprehensive and Rich Content

The “STM32Cube Efficient Development Tutorial” is divided into “Introduction” and “Advanced” sections, taking the STM32F407 as an example, it comprehensively introduces the use of related tool software, the HAL programming methods for STM32 on-chip resources and peripherals, and the programming development methods for middleware such as FreeRTOS.

The “Introduction” section introduces the tool software used in the STM32Cube development method, as well as the system functions and commonly used peripherals of the STM32F407. The “Introduction” section consists of 22 chapters, divided into two main parts.

  • The first part is the basics of hardware and software, introducing the components of the STM32Cube ecosystem, the use of STM32CubeMX, STM32CubeIDE, and STM32CubeMonitor software, and the basic architecture and minimum system circuit principles of the STM32F407.

  • The second part introduces the principles and programming methods of the STM32F407 system functions and commonly used peripherals, including interrupt system principles and usage, DMA principles and usage, low power principles and usage, as well as programming methods for commonly used peripherals like timers, RTC, ADC, USART, SPI, and I2C.

The “Advanced” section introduces the use of some middleware in the firmware library, along with some advanced interface usage. The “Advanced” section also consists of 22 chapters, numbered from Chapter 1, and is divided into three main parts.

  • The first part covers the use of the embedded operating system FreeRTOS, containing 11 chapters that comprehensively introduce almost all functions of FreeRTOS version 10, including task management, interrupt management, inter-process communication technologies, software timers, low power modes, etc., where inter-process communication technologies include queues, semaphores, mutexes, event groups, task notifications, stream buffers, and message buffers.

  • The second part covers the management of file systems using FatFS, containing 6 chapters. This part introduces the process of porting FatFS onto SPI interface Flash chips, methods for managing file systems using FatFS on SD cards and USB drives, as well as using FatFS within FreeRTOS.

  • The third part covers image acquisition and display, containing 5 chapters. This part introduces reading and displaying BMP and JPG image files, the use of resistive and capacitive touch screens, as well as simple GUI program design methods.

In each chapter introducing specific peripherals or knowledge points, this book first presents the technical principles and HAL driver programs, then writes at least one complete example project, which has been tested and validated on an STM32F407 development board.

3. Providing Rich Supporting Resources

STM32 programming combines hardware and software; programs need to run on development boards to see results. To help readers better understand the principles introduced in the book and see the effects of example runs, this book provides various supporting resources.

  • Source code for all example projects in the book

  • Circuit schematics for the development board

  • Demonstration videos of all example projects running on the development board, which have been uploaded to Bilibili. Search for “STM32Cube Efficient Development Tutorial” to find them.

  • Images of all example runs compiled into a PDF file available for download and viewing at any time.

  • PDF versions of the lecture materials for each chapter. If any readers wish to use this book as a textbook, they can email me to obtain the PPT version of the materials.

Additionally, we have established a reader QQ group, and readers are welcome to join the QQ group for communication and learning.

STM32Cube Efficient Development Tutorial

Figure 3: Demonstration videos of example runs published on Bilibili

4. A Carefully Crafted Book

At the beginning of 2019, in preparation for undergraduate teaching content, we began writing this book, and it wasn’t finalized until the summer of 2020. During this time, there were multiple revisions, and some of the preliminary content was used as course handouts for students in the Automation and Measurement Control majors at China University of Petroleum (East China) in 2016 and 2017. Students generally reported that the handout content was detailed and easy to understand and learn. During the usage process, we adopted some beneficial suggestions from students and revised any errors or omissions found.

After submission, it took another year for editing and proofreading. The editors at the publishing house strictly followed publication requirements, redrawing a large number of circuit diagrams and structural block diagrams in the book, going through multiple rounds of proofreading and revisions to ensure the normativity, rigor, and correctness of the book’s content. The final published book is truly impressive, with excellent printing and binding quality, an attractive cover, and thick paper.

STM32Cube Efficient Development TutorialFigure 4: The printed final book

In summary, this is a fine book crafted with care by the authors, editors, publishing house, and printing factory. The quality of the printing is tangible, and the content quality will not disappoint you.

Appendix: Brief Biographies of the Three Authors.

  • Wang Weibao, PhD, a teacher at the School of Control Science and Engineering, China University of Petroleum (East China). Engaged in teaching and research in the field of measurement and control and instrument development, with main research directions in geophysical detection instrument development, data processing methods, and software development. Participated in multiple research projects such as the National Natural Science Foundation and the Shandong Provincial Key Research and Development Program, and published over 20 papers. Author of “Qt 5.9 C Development Guide” and “Python Qt GUI and Data Visualization Programming”.
  • Yan Zhidan, PhD, a teacher at the School of Control Science and Engineering, China University of Petroleum (East China). Engaged in research on while-drilling measurement and control technology, self-disturbance control methods, downhole instrument development, and weak signal processing. Hosted over 10 research projects including the National Natural Science Foundation, the China Postdoctoral Science Foundation, and the Shandong Provincial Natural Science Foundation, has over 10 authorized invention patents, and published over 30 papers.
  • Wang Zhao, PhD, a teacher at the School of Control Science and Engineering, China University of Petroleum (East China). Engaged in teaching and research related to automation, with main research directions in nonsmooth control of nonlinear systems, fault diagnosis, and industrial process control. Hosted 1 project of the Shandong Provincial Excellent Young and Middle-aged Scientist Research Award Fund, published over 20 papers, and co-edited 1 textbook.

Leave a Comment