Skip to content
CEC Semester Twenty One 2022

STM32MP1 Primer

Fred Eady -
Owner, EDTP Electronics Inc. and Principal Engineer, Ongoing Systems LLC.
February 28,
2022
Tooling Up..
Today's goal is to get familiar with the STM32MP157x hardwareinstall the STM32CubeProgrammer and STM32CubeIDE applications and ultimately install the STM32MP1 Developer Package and the OpenSTLinux SDK. We will also assemble our first STM32MP157x embedded Linux application. The host flavor of Linux we will use for the entire lecture series will be the latest spin of Ubuntu LTS. We will depend on the STM32MP1 Wiki as a guide to establishing our Ubuntu-based STM32MP157x cross compilation environmentwhich will consist of source codes of all software components. The cross compilation environment installation will result in the creation of a pair of very important working directories (Starter-Package and Developer-Package) collectively known as the STM32MP15-Ecosystemwhich will contain the bulk of the necessary source codes. The Starter-Package directory will be used primarily to supply prebuilt trusted embedded Linux images to the STM32CubeProgrammer application. The Starter-Package directory contains a trusted Linux image for each hardware variant of the STM32MP1 family. Normallywe will only use the services of the Starter-Package directory when we need to generate an untouched clean and trusted Linux imagewhich will be ultimately loaded onto a microSD card via the STM32CubeProgrammer application. Most of our time will be spent tapping the resources contained within the Developer-Package directory. The SDKLinux sources and latest STM32Cube STM32MP1 firmware load are housed in the Developer-Package directory. There is a tremendous amount of typing involved with setting up the STM32MP15-Ecosystem. Howeverwithin the lecture you will be shown how to eliminate most all of the word-by-word typingwhich will avoid typing errors and greatly reduce the time needed to complete the cross compilation installation.
Course Resources
Special Educational Materials
Search Videos Introducing the nRF5340 PDK The nRF5340 PDK is a preview development kit for the nRF5340 SoC. This is our new dualNordic Semi RF5340 Bluetooth® with Arm® Cortex®-M33Nordic Semi nRF5340-PDK Dual-Processor
March 1,
2022
Swinging Around in the STM32MP1 Device Tree..
STM32CubeMXwhich front ends STM32CubeIDEdoes not allow us to directly assign STM32MP157x GPIO pins to the Cortex-A7 or Cortex-M4 cores. Thusblinking LEDs is simply a matter of manually configuring the desired core's GPIO pins that drive the discovery kit's on-board LEDs. HoweverSTM32CubeMX does allow us to assign communications peripherals such as I2C to a specific core. To accomplish this peripheral assignmentwe must use the resources provided by the kernel device tree. The device tree describes almost every aspect of a peripheral as it relates to the host STM32MP157x hardware. The level of detail contained within the device tree makes it a difficult thing for us to manually create. FortunatelySTM32CubeMX in conjunction with STM32CubeIDE generates a detailed device tree automatically based on our inputs to STM32CubeMX during the initial project development process. Todaywe will generate an STM32MP1 embedded Linux project aimed at driving an Accel6 click using the STM32MP157D's I2C peripheral I2C5. We will use STM32CubeMX to generate a device tree that includes our desired I2C5 peripheral. The Accel 6 click's physical interface to the STM32MP157D's I2C peripheral is realized using a Pi 4 click shield attached to the STM32MP157D-DK1's on-board Raspberry Pi compatible pin set.
Course Resources
Special Educational Materials
Search Videos Introducing the nRF5340 PDK The nRF5340 PDK is a preview development kit for the nRF5340 SoC. This is our new dualNordic Semi RF5340 Bluetooth® with Arm® Cortex®-M33Nordic Semi nRF5340-PDK Dual-Processor
March 2,
2022
STM32MP1 Interprocessor Communications
The STM32MP157x dual core design pairs up a powerful Linux-enabled Cortex-A7 MPU with a speedy Cortex-M4 MCU. At first glanceone would think that the Cortex-M4 is a luxury as the Cortex-A7 is fully capable of handling complex applications without any help from the Cortex-M4. Howeverthe Cortex-A7 running under the control of a Linux kernel is not very good when it comes to precise millisecond and microsecond timing within the application. On the other handthe Cortex-M4 can turn on a microsecond. An ideal situation would exist if we could run our heavy application loads using the Cortex-A7 and use the Cortex-M4 as a real-time coprocessor for the tasks that require more accurate time resolution. The application we will build in today's lecture will enable an interprocessor communications link between the Cortex-A7 and the Cortex-M4 cores.
Course Resources
Special Educational Materials
Search Videos Introducing the nRF5340 PDK The nRF5340 PDK is a preview development kit for the nRF5340 SoC. This is our new dualNordic Semi RF5340 Bluetooth® with Arm® Cortex®-M33Nordic Semi nRF5340-PDK Dual-Processor
March 3,
2022
Flying Solo with the STM32MP1 Cortex-M4..
This is Day 4 of our lecture series and thus far the stars of the show has been OpenSTLinux and the Cortex-A7. Wait a minute. We have access to a Cortex-M4 capable of running in excess of 200 MHz. With thattoday's discussion will focus on loading up the Cortex-M4 with a TOF (Time of Flight) application. We'll start the project from scratch and take a look at what it takes to configure our Cortex-M4 using the same STM32CubeMX and STM32CubeIDE environment we have been using all week. The Cortex-M4 that is native to the STM32MP157x hardware does not have access to standard flash program memory. Insteadwe have 448K of embedded SRAM that we can fill with our Cortex-M4 application code. Despite the talents possessed by the Cortex-M4we still need OpenSTLinux to assist us in getting the Cortex-M4 code loaded and kicked off. Since OpenSTLinux must be running anywayalong the way we'll see if we can offload any of the TOF application tasks to the Cortex-A7. The STM32MP157x-DKx discovery boards are fitted with an Arduino pin set on the bottom side of the board. This is a great time to introduce some home brewed Arduino-click-STM32MP1 interface hardware.
Course Resources
Special Educational Materials
Search Videos Introducing the nRF5340 PDK The nRF5340 PDK is a preview development kit for the nRF5340 SoC. This is our new dualNordic Semi RF5340 Bluetooth® with Arm® Cortex®-M33Nordic Semi nRF5340-PDK Dual-Processor
March 3,
2022
Coding STM32MP1 Embedded Linux SPI Drivers..
This week's lectures have thus far taught us how to configure and use the STM32MP157x GPIO that is common to both the Cortex-A7 and Cortex-M4 cores. We have also experienced the sensation of sitting on the I2C and USART limbs of the STM32MP157x device tree. Today we will climb the device tree one more time. There's a limb dedicated to providing leaves and branches that enable the STM32MP157x's OpenSTLinux-based SPI peripherals. The configuration of the SPI peripherals within the device tree is quite unique and must be understood thoroughly to enable any of the STM32MP157x SPI peripherals. Today's lecture will be built upon a couple of projects. Firstwe will code an embedded Linux driver for the popular SSD1306-based display. The SSD1306 is heavily data output-only oriented. The second project will assemble a number of embedded Linux routines designed to drive a MCP23S17 16-bit Expander with Serial Interface. The MCP23S17 driver will contain input capture algorithms as well as standard SPI output routines. Just as we have done all weekwe will utilize STM32CubeMX and STM32CubeIDE to generate the device treeassign SPI peripheral GPIO pins and compile our SPI driver source code. The SPI driver code will be capable of interfacing to SPI hardware on the STM32MP157x discovery board's Raspberry Pi 4 and Arduino physical interfaces.
Course Resources
Special Educational Materials
Search Videos Introducing the nRF5340 PDK The nRF5340 PDK is a preview development kit for the nRF5340 SoC. This is our new dualNordic Semi RF5340 Bluetooth® with Arm® Cortex®-M33Nordic Semi nRF5340-PDK Dual-Processor
Instructor
Fred Eady
Owner, EDTP Electronics Inc. and Principal Engineer, Ongoing Systems LLC.

Fred Eady is the owner of EDTP Electronics Inc. and is the principal engineer at the Georgia branch of Ongoing Systems LLC. EDTP Electronics was established in 1988. In the meantime, Fred has written thousands of magazine articles. He has written for all of the major electronic magazines, including Radio Electronics, Electronics Now, Nuts and Volts, Servo, MicroComputer Journal, and Circuit Cellar. Fred has even done a few short feature articles for Design News. To date, he has authored four books and contributed to a fifth. He currently works as a PIC microcontroller consultant and is a Microchip Authorized Design Partner. Fred’s expertise also extends into the ARM community where he is a hardware and firmware design consultant. His customers include aerospace companies, machine shops, specialty startup companies, medical machine manufacturers, coin-operated device businesses, and various other research and development companies. He has a very close working relationship with Microchip Technology, the manufacturer of PIC microcontrollers, and has taught multiple Ethernet and WiFi classes at Microchip's annual Masters Conference.