{"id":4237,"date":"2020-06-02T19:45:11","date_gmt":"2020-06-02T17:45:11","guid":{"rendered":"https:\/\/deepbluembedded.com\/?p=4237"},"modified":"2024-01-21T01:08:00","modified_gmt":"2024-01-20T23:08:00","slug":"getting-started-with-stm32-arm-cortex-mcus","status":"publish","type":"post","link":"https:\/\/deepbluembedded.com\/getting-started-with-stm32-arm-cortex-mcus\/","title":{"rendered":"Getting Started With STM32 ARM Cortex MCUs"},"content":{"rendered":"\n\n\n\n\n
\"Previous<\/a><\/td>\nPrevious Tutorial<\/strong><\/a><\/td>\nTutorial 1<\/span><\/strong><\/span><\/td>\nNext Tutorial<\/strong><\/a><\/td>\n\"Next<\/a><\/td>\n<\/tr>\n
<\/td>\nGetting Started With STM32 ARM Cortex MCUs<\/strong><\/span><\/td>\n<\/td>\n<\/tr>\n
<\/td>\nSTM32 Course Home Page <\/strong><\/span>????<\/a><\/td>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

 <\/p>\n

\"STM32<\/p>\n

 <\/p>\n

In this introductory tutorial, we’ll get a closer look at the STM32 ARM-Cortex based microcontrollers. And it’s internal architecture, bused, and features. We’ll discuss the reset and clock control circuitry with the clock tree, which we’ll configure later on using CubeMX.<\/span><\/p>\n


\n

\u00a0 \u00a0STM32 ARM<\/span><\/strong>\u00ae<\/sup><\/span>-Based Microcontrollers\u00a0 \u00a0<\/span><\/strong><\/span><\/h3>\n

 <\/p>\n

The STM32 series of microcontrollers is one of the most popular ones among the 32-Bit microcontrollers. STMicroelectronics provides multiple of product lines for the STM32 parts. There is a low-power, mainstream, and high-performance product lines. And a more application-specific wide variety of parts that enables you to pick the right part for your project.<\/span><\/p>\n

There are low-cost FullSpeed USB solutions, CAN, LIN, Ethernet, DCMI (Digital Camera Interface), and CryptoEngine for cryptographic applications, and much more powerful peripherals. Both digital and analog such as ADCs, DAC, OPamp, Comparators, etc.<\/span><\/p>\n

The development boards we’ve selected for this series of tutorials are Nucleo32-L432KC and Blue Pill. Here is the hardware peripherals and ARM-Core highlight diagram for the STM32L432KC microcontroller part.<\/span><\/p>\n

\"STM32L432KC<\/p>\n

You can use the STMicroelectronics software tool called “STM32 MCU Finder”. This is basically a parametric searching tool that helps you easily find the convenient microcontroller with the required specs that you select in the GUI tool.<\/span><\/p>\n


\n

\u00a0 \u00a0STM32<\/span><\/strong> MCUs We’ll Be Using\u00a0 \u00a0<\/span><\/strong><\/span><\/h3>\n

 <\/p>\n

In this series of tutorials, we’ll be using a couple of boards shown down below.<\/span><\/p>\n

Nucleo32-L432KC<\/strong><\/span><\/p>\n

\"Nucleo32-L432KC<\/p>\n

STM32L432KC Datasheet & Documents<\/a><\/p>\n

Blue Pill STM32F103<\/strong><\/span><\/p>\n

\"STM32F103-Blue-Pill\"<\/p>\n

STM32F103C8T6 Datasheet & Documents<\/a><\/p>\n

 <\/p>\n


\n

\u00a0 \u00a0ARM Cortex-M4 Processor + FPU\u00a0 \u00a0<\/span><\/strong><\/span><\/h3>\n

Arm\u00ae Cortex\u00ae-M4<\/span><\/strong><\/p>\n

The Arm\u00ae Cortex\u00ae-M4 with FPU processor is the latest generation of Arm\u00ae processors for embedded systems. It was developed to provide a low-cost platform that meets the needs of MCU implementation, with a reduced pin count and low-power consumption, while delivering outstanding computational performance and an advanced response to interrupts.<\/span><\/p>\n

The Arm\u00ae Cortex\u00ae-M4 with FPU 32-bit RISC processor features exceptional code efficiency, delivering the high-performance expected from an Arm\u00ae core. The processor supports a set of DSP instructions that allow efficient signal processing and complex algorithm execution.<\/span><\/p>\n

Its single precision FPU speeds up the software development process and accelerates the target performance. With its embedded Arm\u00ae core, the STM32L432KC microcontroller can be used in a wide range of applications. As we’ll see throughout the course.<\/span><\/p>\n

The other STM32F103C8 microcontroller has a Cortex-M3 core that lacks the FPU and DSP operations which can be a huge miss in certain applications, however, it’s much cheaper target MCU at the end of the day.<\/span><\/p>\n

Adaptive Real-Time (ART) Accelerator\u2122<\/strong><\/span><\/p>\n

The ART Accelerator\u2122 is a memory accelerator that is optimized for STM32 industry-standard Arm\u00ae Cortex\u00ae M4 processors. It balances the inherent performance advantage of the Arm\u00ae Cortex\u00ae-M4 over Flash memory technologies, which normally requires the processor to wait for the Flash memory at higher frequencies.<\/span><\/p>\n

To release the processor near 100 DMIPS performance @ 80MHz, the accelerator implements an instruction prefetch queue and branch cache, which increases program execution speed from the 64-bit Flash memory. Based on the CoreMark benchmark, the performance achieved thanks to the ART accelerator is equivalent to 0 wait state program execution from Flash memory at a CPU frequency up to 80 MHz.<\/span><\/span><\/p>\n

Memory protection unit (MPU)<\/span><\/strong><\/p>\n

The memory protection unit (MPU) is used to manage the CPU accesses to memory to prevent one task to accidentally corrupt the memory or resources used by any other active task. This memory area is organized into up to 8 protected areas that can in turn be divided up into 8 subareas.<\/span><\/p>\n

The MPU is especially helpful for applications where some critical or certified code has to be protected against the misbehavior of other tasks. It is usually managed by an RTOS (realtime operating system). If a program accesses a memory location that is prohibited by the MPU, the RTOS can detect it and take action.<\/span><\/span><\/p>\n

Firewall<\/span><\/strong><\/p>\n

The device embeds a Firewall that protects code sensitive and secure data from any access performed by a code executed outside of the protected areas. Each illegal access generates a reset which kills immediately the detected intrusion.<\/span><\/p>\n

Boot modes<\/span><\/strong><\/p>\n

At startup, BOOT0 pin or nSWBOOT0 option bit, and BOOT1 option bit are used to select <\/span>one of three boot options:<\/span><\/p>\n