《STM32_in_Zephyr_What_You_Need_to_Know.pdf》由會員分享,可在線閱讀,更多相關《STM32_in_Zephyr_What_You_Need_to_Know.pdf(36頁珍藏版)》請在三個皮匠報告上搜索。
1、Zephyr on STM32:What you need to knowErwan Gouriou-STMicroelectronicsZephyr Developper SummitJune 2023 Prague Working STMicroelectonics,Le Mans Started Zephyr in 2016 Initially contributed as a Linaro assignee Contributed to Device Tree introduction STM32&Shields maintainer ST Zephyr Technical leade
2、r Github:erwango Discord:ErwanGA bit about myselfWhy proposing this talk?3What youll learn from this talk#STM32 parts support#Clock configuration#Peripherals#Trusted Firmware Support#Join the party#Questions#STM32 resources#Power ManagementSTM32 support in Zephyr130+boards supported180+Supported SoC
3、(19 series)40+peripherals supportedWide range of featuresTF-M,USB,Ethernet,CAN,BLE,LoRa.5380+contributors issued 5000+commitsZephyr RTOSSTM32 resourcesMonitorDebugProgrammingComplemented with STM32Cube EcosystemZephyr RTOS6KernelOS ServicesApplication Services3rdParty Librarieshal_stm32SelectFind do
4、csProgrammingHALDriversDebugGDBOpenOCDSTM32Cube Ecosystem STM32CubeMCU packages are stored under zephyr hal_stm32 module Forks of https:/ Updated at each Zephyr release Patches allowed under specific conditions STM32Cube APIs are used for Zephyr drivers developments Allows reuse of validated code an
5、d factorization HAL,LL or CMSIS files used depending on drivers specificsHow were integrating STM32Cube HAL7 Use CMSIS files to populate dts node properties Eg:hal_stm32:stm32cube/stm32l4xx/soc/stm32l431xx.h You can mix Zephyr and STM32Cube APIs in your application See https:/ CONFIG_USE_STM32_ASSER
6、T=yMisc on STM32Cube HALsConfiguring a STM32 based board1-Select a STM32 partIdentify a supported STM32 part11 Series:STM32H7 SoC variant:B3 Pin count:Not used:X SoC Package memory size:I In dts/arm/st/h7,look for stm32h7b3Xi.dtsiXSTM32H7B3I Add a memory size variant:Eg STM32H7B3 1MB Flash variant:A
7、dd a SoC variant:Add a STM32 part not supported yet122-Clock settingsClock tree settings14Fixed clocksHigh Speed(Internal,External)Configurable clocksLow speed,.PLL(s)Input:multiplier,divisorOutput clocks(PLL P,PLL Q,.)and division factorsCore source clockPeripheral bus speedsSTM32 clock configurati
8、on with device tree15More information on https:/docs.zephyrproject.org/latest/build/dts/api/bindings.html#stmicroelectronics-st Reference manuals STM32CubeMXNeed help on clocks?163-Configure peripherals What are the peripherals supported?What are the configurations supported for this peripheral?How
9、to configure usual settings(pinctrl,domain clocks,DMA)?Device tree is the main reference:dts/arm/st/Start from.dtsi file Follow inclusions up to series root file Missing instance of device Add missing node.Get config info from CMSIS files Missing device Check for support in a compatible seriesSuppor
10、ted peripherals18Device configuring optionsCommon STM32 device settings:pinctrl20Generated from https:/ in https:/ If youre getting following error,run west update Pinctrl can also be used to enable MCO See STM32:Configure MCO pin through device tree pinctrl Issue#31912 zephyrproject-rtos/zephyr()Ad
11、ditional points on pinctrl21 See Bindings section in docs.zephyrproject.org:st,stm32-dmamux Note:Plan to configure dma device props in.dtsi files DMA support has to be checked directly in driversCommon STM32 device settings:DMA22 DMA is enabled based on“dmas”prop Config depends on dma“compatible”:st
12、,stm32-dma-v1 st,stm32-dma-v2 st,stm32-dma-v2bis st,stm32-dmamux Use cases:Select a 48MHz clock Select a specific PLL output Select a clock persistent in Stop Mode STM32CubeMx:Common STM32 device settings:domain clock23Note:Analog pinctrl configurations are available for all pinsPower Management PM
13、handling is made available per series basis In/soc/arm/st_stm32/stm32yy/power.c In.dtsi:STM32 Power Management SoC level Requires a kernel tick source available when core clock is gated LPTIM used automatically when CONFIG_PM=y Requires:CONFIG_PM_DEVICE support in GPIO,UART,I2C PM samples available
14、on STM32 PM samples Example of LP-UART device configuration:STM32 Power Management Device levelNote:Analog pinctrl configurations are available for all pinsTrusted Firmware-Mhttps:/docs.zephyrproject.org/latest/services/tfm/overview.html Only STM32 platforms supported in Zephyr TF-M are supported Pa
15、rtitioning is defined in TF-M:Zephyr/TF-M on STM32platform/ext/target/stm/b_u585i_iot02a/include/flash_layout.hboot_partitionslot0_partitionslot0_ns_partitionslot1_partitionslot1_ns_partitionstorage_partitionNext steps and conclusion PM extension/completion XIP on External memories Stick with Zephyr
16、 evolutions(USB,DMA,.)BacklogNext steps31Jump in!32Contribute your changes and fixesWatch changes on the areas you care aboutTake part in reviews50 PR/month Help welcome;-)Questions?STMicroelectronics-All rights reserved.The STMicroelectronics corporate logo is a registered trademark of the STMicroe
17、lectronics group of companies.All other names are the property of their respective owners.Thank youSupported on STM32For further support in creating a PowerPoint presentation,including graphic assets,formatting tools and additional information on the ST brandyou can visit the ST Brand Portalhttps:/36