You are on page 1of 48

How to make STM32MP1

configuration easy thanks to ST


ecosystem
借助ST 强大的生态系统让
STM32MP1的配置如此简单
STM32MP1 summit Agenda 2

Presentation
Speaker
Time

10:30 Marketing introduction Alexandre Mengeaud

Technical marketing Mathieu Belou


presentation
Configuration easy thanks to ST Mathieu Belou
ecosystem example
11:30 Conclusion & QA Felix Shi/Mathieu
Belou
STM32 Performance Continuum 3

Microprocessors

Dual Cortex-A7 @ 650MHz (2470 DMIPS)


Cortex-M4 @ 209MHz (261 DMIPS)

Microcontrollers
Cortex-M7 @ 400MHz (856 DMIPS)
Cortex-M4 @ 200MHz (250 DMIPS)

Cortex-M7 @ 216MHz (462 DMIPS)

Cortex-M4 @ 180MHz (225 DMIPS)

Cortex-M3 @ 120MHz (150 DMIPS)

STM32 High Performance Portfolio


STM32MP1 Product Positioning 4

• Roadmap extension of STM32H7 and 1st ST’s Mass Market MPU


• Low to Mid range MPU class

STM32MP1

STM32 MCUs Reuse

Arm dual Cortex-A7 Arm Cortex-M4

3D GPU STM32 IPs

DRAM Interface STM32 Connectivity

Linux Ecosystem STM32 Ecosystem


STM32MP157 Block Diagram 5

System Dual Cortex-A7 @ 650MHz


Open GL ES2.0 GPU
Power supply Core 1 @ 650MHz Core 2 @ 650MHz
Regulators (5x LDOs) L1 32KB I / 32KB D L1 32KB I / 32KB D 26Mtri/sec, 133Mpix/sec
NEON SIMD MPE NEON SIMD MPE
Xtal oscillator
32 kHz + 4~26 MHz VFPv4 (single/double precision) VFPv4 (single/double precision)
Connectivity
Internal RC oscillators 256KB L2 cache MMU
32 kHz + 4 MHz + 64 MHz Display I/F 24-bit RGB Gigabit Ethernet IEEE1588V2 RGMII,
+ DSI MIPI transceiver GMII, MII, RMII
GIC Debug (JTAG & ETM)
6x PLLs
6x I²C FM+ (SMBus/PMBus) Camera interface
Clock control
TrustZone DMA
DFSDM 8 channels / 6 filters
4x USART + 4x UART
RTC (Vbat) / AWU
LIN, Smartcard, IrDA, Modem
16-bit FMC (NAND 8-bit ECC)
DDR3/L 32b @ 533MHz / lpDDR2/lpDDR3 32b @ 533MHz Control
3x watchdogs
(independent and window) SPDIF 4 channels

Cortex-M4 @ 209MHz 6x SPI / 3x I²S (Full duplex)


Up to 176 GPIOs 2x CAN2.0B / TTCAN / FDCAN
4x SAI
Cyclic redundancy check (CRC) FPU MPU 2x USB2.0 Host EHCI + 2x HS
PHY
3x SDIO3.0 / SD card 3.01 /
96-bit unique ID NVIC JTAG/SWD debug & ETM eMMC4.51
USB2.0 OTG HS + FS PHY

Dual Quad SPI HDMI-CEC


System RAM 256KB MCU System RAM 384KB

Backup RAM 4KB / Retention RAM 64KB / OTP fuse 2Kb

Cryptography Control Analog

3DES, AES256, GCM, CCM 2x 16-bit motor control PWM synchronized AC timer 2x 16/14bit ADC 7.2MSPS 22 channels

SHA-1, SHA-256, MD5, HMAC 10x 16-bit timer 5x 16-bit LP timer 2x 12-bit DAC

Analog true RNG 2x 32-bit timer Temperature sensor

Not Available on all product lines


STM32MP1 Hardware Solutions 6

Speed-up evaluation, prototyping and design

DK2

EV1

DK1

Evaluation Board Discovery Board Boards & SoM*s

Full feature STM32MP1 evaluation Flexible prototyping & demo 3rd Parties Boards for prototyping
• STM32MP157A-EV1 2 • STM32MP157A-DK1 2 and production
• STM32MP157C-EV1 Versions • STM32MP157C-DK2 Versions • Board Specification from Linaro
+ MIPI DSI WVGA display (96boards.org)
+ Wi-Fi/BT combo module • Commercial SoM w/ different forms

*System on Module
A Fully Integrated Design Suite 7
Leveraging the STM32Cube Environment

Cortex-A7 Cortex-M4

STM32MPU Embedded Software Distribution


Cortex-M4 : STM32CubeMP1 Package 8

Full re-use of STM32 MCU Cube firmware on Arm Cortex-M

Several APIs to access peripherals

Collection of Middleware components for Cortex-M

Hundreds of Examples

Production-ready Quality

Business-friendly license terms


Cortex-A7 : Simplify your Linux Development 9

Fully mainlined open source Linux distribution for Arm Cortex-A7

STM32MP1 SoC drivers


already adopted by the Linux community
STM32MP1 supported in Linux 4.19 LTS

Fully compliant
with Pre-integrated
open-source Secure OS
standards
One distribution, three packages 10

• Starter Package
• To quickly and easily start with any
STM32MP microprocessor device

• Developer Package
• To add your own developments on top of
the STM32MPU Embedded Software
distribution

• Distribution Package
• To create your own Linux® distribution,
your own Starter Package and your own
Developer Package
STM32MP1 Software Tools 11

Complete support of Arm Cortex-A + Cortex-M architecture

IDEs
STM32CubeMX STM32 Programming Tool
Compile and Debug
STM32CubeMX enhanced for MPU Multi-Core Solutions STM32CubeProgrammer
• Configure and generate Code • Partners IDE • Flash, DRAM and/or system memory
• DRAM interface tuning tool • Free IDE based on Eclipse • OTP programming
• Device Tree generation • Multi-core debugging • Signing tool & Keys generation
STM32MP1 boot architecture
A trusted boot chain 13
Loads
3rd Party

Legend
(Loads &) Calls
(Loads &) Calls options
ST Community
: Configured via STM32CubeMX
Community + ST adds-on : Authentication (optional)

Note : a Basic boot chain is also available, fully relying on U-Boot (instead of TF-A + U-Boot)
Cortex-A7 / Cortex-M4
Relationship
A7 / M4 IP Sharing 15

Cortex-A7 Coprocessor
Cortex-A7
(master) Cortex-M4
(master) IPCC (co-processor)
Cortex M
Core Security
Interrupts Watchdog DMA

STGEN EXTI IWDG1 DMAMUX BSEC RNG2 HASH2

SysCfg GIC IWDG2 DMA1 DMA2 ETZPC CRYP2 CRC2

RTC NVIC WWDG MDMA TZC400 RNG1 HASH1

TAMP CRYP1 CRC1


RAM
SYSRAM Backup SRAM MCUSRAM1-2 MCUSRAM3 RETRAM
DDR CTRL
(256KB) (4KB) (256KB) (128KB) (64KB)
Visual

Timers IOs Debug GPU DSI LTDC

TIM (x15) LPTIM (x5) GPIOA-K GPIOZ HDP STM DCMI CEC

Power Low speed interfaces Analog

RCC PWR TEMP USART1 USART (x3) UART (x4) SPI6 VREFBUF DAC (x2)

Networking I2C6 I2C4 I2C (x4) SPI (x5) DFSDM ADC (x2)

Ethernet FDCAN

SPDIF-RX SAI (x4)


Mass Storage
Audio
Dual QSPI FMC SDMMC1/2 SDMMC3 USB Host USB OTG

High speed interfaces Assigned

Legend
Assigned to A7 Assigned to M4
Assigned IP to A7 or M4

Shared IP Shared by
A7 & M4
Configuration easy thanks to ST
ecosystem example
Goals 17

• Use the USART3 from the GPIO expander of the discovery board to
communicate with a laptop.

• Steps :
• Get board information from ST wiki
• Flash the starter package on the boards thanks to the STM32Programmer
• Generate the Linux device tree thanks to CubeMx
• Rebuild the device tree thanks to the developer package
• Update the device tree (DTB).
• Test the UART
Wiki 18

• All the information are available on st.com and/or wiki.st.com.

• For this example we have to get


the USART3 information of the
Discovery board GPIO
expansion on the wiki.

• https://wiki.st.com/stm32mpu/wiki
/STM32MP157X-DKX_-
_hardware_description#GPIO_e
xpansion_connector
Starter package 19

• The starter package is the full system image containing all the binaries
and all the file systems.

• To get the discovery board starter package from the wiki :


• https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package

• Lot of explanation regarding the starter package are available on the


wiki as :
• How to plug all the cable of you discovery boards
• How to program the discovery board
• Some basic Linux use case
• Examples running on A7 and on M4
Starter package Flow 20

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Download image for his


Starter package board from ST site
User

Starter kit
packages of image

zip
git
Starter package Flow 21

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Download tool from


Starter package ST site
User

Starter kit STM32


packages of image Tools

zip
git
Starter package Flow 22

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Starter package
User

Program the board with the downloaded image

Starter kit STM32


packages of image Tools

zip
git
STM32Programmer 23

• The STM32MP1 is supported by STM32Programmer (from version


v2.0.0) available on st.com

• STM32Programmer is available for Linux (CLI) and for Windows (CLI


& GUI)

• To flash the starter package in the discovery board through the USB
port you have to enter this command :
• STM32_Programmer_CLI -c port=usb1 -w ./flashlayout_st-image-
weston/FlashLayout_sdcard_stm32mp157c-dk2-trusted.tsv

• SD card Tip : you can also copy the image directly on the SDcard if
you plug the SD card in your laptop and you can use the DD
command on Linux laptop.
Boot the starter package 24

• As soon as the starter package has been flashed you can boot the
board and enjoy Linux world.

• Check the number of UART used by the system.

• The USART3 is not configured in the system.

• 0x4000E000  Uart2 /*Bluetooth*/


• 0x40010000  Uart4 /*Console*/
CubeMx 25

• The STM32MP1 is supported in CubeMx since the version 5.1.0 on


Linux and Windows.

• CubeMx is used for :


• configure pin assignments, the clock tree, or internal peripherals
• configure and tune DDR parameters
• generate HAL initialization code for Cortex-M4
• generate the Device Tree for a Linux kernel, TF-A and U-Boot firmware for Cortex-
A7

• Steps used to add a new UART in CubeMx are :


• Select the board
• Add the peripheral
• Check/modify the pin use for the peripheral
• Check/modify the clock configuration
• Generate the device tree
CubeMx : board selection 26
CubeMx : board selection 27
CubeMx : Same for MCU or MPU 28
CubeMx : peripheral selection 29
CubeMx : peripheral selection 30
CubeMx : pin configuration 31

• Default pin set in cubeMx are not


the one selected on the GPIO
expansion.

• PD8 & PD9 use as default

• PB10 & PB12 used on discovery


board

• Change the UART3 pin is very


easy on CubeMx
CubeMx pin configuration 32
CubeMx Clock configuration 33
CubeMx : DDR plugin 34
CubeMx : Generate Code 35
CubeMx : Generate Code 36
CubeMx : Device tree 37

• This is an extract of the Linux


device tree generated by
CubeMx, as the Discovery
board configuration is already
exiting we have to report only
the USART3 configuration

• There is the pin control


configuration with the pin B12
& B10.

• And the peripheral


configuration with the « okay »
status for the activation
CubeMx : Device tree 38

• This is an extract of the Uboot device tree


generated by cubeMx, we keep only the
clock configuration

• In the system the clock device tree can be


managed by TF-A or u-boot.

• There isn’t USART3 peripheral


configuration in this device tree like we
select only A7NS
developer package 39

• The developer package is available on wiki.st.com:


• https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package

• With the developer package you can rebuild each binary of each
software layer (file system partition can be generated only by
distribution kit).

• We have to modify the existing device tree adding the USART3


device tree configuration.

• In this example we have to rebuild u-boot (the device tree is included


inside the binary) and the Linux DTS (no need to rebuild the kernel
binary).
• make ARCH=arm dtbs LOADADDR=0xC2000040 O="$PWD/../build"
Developer package Flow 40

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Download and install SDK

Developer package
User
SDK environment

zip
git
Developer package Flow 41

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Download source code


package from ST site

Developer package
User
SDK environment

Source
package

zip
git
Developer package Flow 42

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Download source code


package from Github

Developer package
User
SDK environment

Source
package

zip
git
Developer package Flow 43

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Download source code


package from community
site
Developer package
User
SDK environment

Source
package

zip
git
Developer package Flow 44

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Developer package
User User install his own code
SDK environment and build binaries

Source User
package + Source
User patch code

User Binaries

zip
git
Developer package Flow 45

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Download tools from


Developer package ST site
User
SDK environment

Source User
package + Source STM32
User patch code Tools

User Binaries

zip
git
Developer package Flow 46

Public community

Gits Community
Community Tarballs

Github public ST area www.st.com

Source
Source YoctoST STM32 Release package User Guide &
Starter package STM32 STM32
code Script Cube M4 Note SDK Ref Doc
images Tools Cube M4

Developer package
User
SDK environment Flash the board with the generated
binaries
Source User Board needs to
package + Source STM32
User patch code Tools have the starter
package inside first

User Binaries

zip
git
Update the firmware and test the UART3 47

• To update u-boot you can use the STM32Programmer (flash u-boot


binary only not needed to flash the all system).

• To update the Linux device tree you can simply copy it on the bootfs
file system.(through Ethernet, via an usb key, putting the sdcard on
you laptop…)
Releasing Your Creativity 48

/STM32 @ST_World community.st.com/stm32mpu

www.st.com/STM32MP1

You might also like