STM32G0 cube例程

所需积分/C币:50 2019-03-07 11:09:10 336KB PDF
302
收藏 收藏
举报

官方文档,新发布的STM32G0使用cube开发的基础例程,英文文档
AN5110 STM32Cube GO examples 2 STM32Cube GO examples The examples are classified depending on the STM32Cube level they apply to. They are named as follows xamples These examples use only the HAL and BSP drivers(middleware not used). Their objective is to demonstrate the product/peripherals features and usage. They are organized per peripheral (one folder per peripheral e.g. TIM). Their complexity level ranges from the basic usage of a given peripheral(e.g. PWM generation using timer) to the integration of several peripherals(e.g. how to use DAC for signal generation with synchronization from TIM6 and DMA). The usage of the board resources is reduced to the strict minimum Examples LL optimum implementation of typical use cases of the peripheral features and configuration sequences. h an These examples use only the Ll drivers hal drivers and middleware components not used). They offer Nucleo board 9 examples are organized per peripheral (one folder for each peripheral, e.g. TIM)and run exclusively on Examples MIX These examples use only HAL, BsP and ll drivers(middleware components not used). They aim at demonstrating how to use both HAL and ll aPis in the same application to combine the advantages of both APIs HAL offers high-level function-oriented APls with high portability level by hiding product/IPs complexity for end users LL provides low-level APIs at register level with better optimization The examples are organized per peripheral (one folder for each peripheral, e.g. TIM)and run exclusively on Nucleo board Applicatio The applications demonstrate the product performance and how to use the available middleware stacks They are organized either by middleware(a folder per middleware, e.g. USB Host) or by product feature that require high-level firmware bricks(e.g. Audio). The integration of applications that use several middleware stacks is also si rted Demonstrations The demonstrations aim at integrating and running the maximum number of peripherals and middleware stacks to showcase the product features and performance Template project The template project is provided to allow the user to quickly build a firmware application using HAl and bsP drivers on a given board Template LL project The template LL projects are provided to allow the user to quickly build a firmware application using LL drivers on a given board The examples are located under STM32Cube FWGo VXYz Projects. They all have the same structure Inc folder, containing all header files ISrc folder, containing the sources code EWARM, WDK-ARM and ISW4STM32 folders, containing the preconfigured project for each toolchain readme. txt file, describing the example behavior and the environment required to run the example ioc file that allows users to open most of firmware examples within STM32CubeMX(starting from STM32CubeMX version v5.0.0 To run the example, proceed as follows 1. Open the example using your preferred toolchain 2. Rebuild all files and load the image into target memory 3. Run the example by following the readme. txt instructions lote Refer to Development toolchains and compilers" and Supported devices and evaluation boards"sections of the firmware package release notes to know more about the software/hardware environment used for the McU AN5110- Rev 3 page 3/23 AN5110 STM32Cube GO examples Package development and validation The correct operation of the provided examples is not guaranteed in other environments, for example when using different compiler or board versions The examples can be tailored to run on any compatible hardware: simply update the BsP drivers for your board provided it has the same hardware functions(LED, LCD display, pushbuttons, etc. The BSP is based on a modular architecture that can be easily ported to any hardware by implementing the low-level routines Table 1 contains the list of examples provided with the STM32CubeGO MCU Package Note STM32CubeMX-generated examples are highlighted with the MX STM32CubeMX icon AN5110- Rev 3 page 4/23 Table 1. STM32CubeG0 firmware examples Level Module Name Project Ni Description 三mαoou2z >um∞NE 三o0mes tarter project This projects provides a reference template that can be used to buid any firmwareMXMXMXMX Templates applicatIoN Total number of template Starter project This projects provides a reference template through the LL API that can be used to build MX MXMXMX Templates LL any firmware app ication Total number of templates I: 4 ADC_ AnalogWatchdog How to use the adc peripheral to perform conversions with an analog watchdog and out-ot-window interrupts enabled MX ADC_MuntChanneisingleConversion Corv efbc ta a ar t s fever by mn ntls ar ar ay ndence y dicar moe), mode, I MX MXMX ADC ADC_Oversampling Use Adc to convert a single channel but using oversampling feature to increase MX ADC. Singl-Conversion,_Tigersw_IT porg Hamming rodet interupt example configuration: ADc is configu red io con venn a MX single channel in single conversion mode from sw trigger ADC_SingleConversion_TriggerTimer- Use ADC to convert a single channel at each trig from timer. conversion data are DMA transferred by DMA into an array, indefinitely(circular mode MX Examples BSP BSP EXample This example provides a description of how to use the different BSP drivers. MX CEC Data Exchange Device_ This example shows how to configure and use the cec peripheral to receive and MX transmIt messages CEC Data Exchange Device_ 2 This example shows how to configure and use the cec peripheral to receive and transmit messages MX This example shows how to configure and use the CEc peripheral to receive and CEC cEC Listen mode device 1 transmit messages between two boards while a third one(the spy device) listens but MX doesn't acknowledge the received messages This example shows how to configure and usc the CEc peripheral to receive and CEC Listen Mode Device 2 ransmit messages between lwo boards while a third one(the spy device) listens but MX doesn t acknowledge the received messages This example shows how to configure and use the cec peripheral to receive and CEC Listen M evice 3 transmit messages between two boards while a third one(the spy device)listens but MX doesnt acknowledge the received messages oQ≌am= Leyel Module namc Project Namc Description This example shows how to configure and use the CEc peripheral to receive and CEC MultiAddress Device 1 transmit messages in the case where one device supports two distinct logical addresses MX at the same time This cxample shows how to configure and usc the CEc peripheral to receive and CEC MuLtiAddress device 2 transmit messages in the case where one device supports two distinct logical addresses MX at the same time COMP CompareGpioVs VrefInt IT How to configure the COMP peripheral to compare the extemal valtage applied on a specitic pin with the Internal Voltage Reterence MXMX COMP COMP_Compare GpioVsVreflnt_Windo How to make window comparator using the COMP peripherals in window mode lI MX CORTEXM MPI Presentation of the MP U feature. This example configures a memory area as privileged MX MX CORTEXM Mode privilege How to mod ify the Thread made privilege access and stack. Thread mode is entered on reset or when returning from an exception IMXMX MX CORTEX CORTEXM Process Stack How to modify the thread mode stack. Thread mode is entered on resot, and can beMXMX MX Examples CORTEXM_ SysTick How to use the default Sys Tick configuration with a 1 ms timebase to toggle LEDs MXMX How to configure the CRC using the HAL APl. The CRC (cyclic redundancy check) CRC Bytes stream 7bit CRC 减 unit computes 7-bit CRC codes derived from b+地 she Mx MxMX X 2+1, as used in the Train Communication Network, IEC 60870-5[171 How to configure the CRC using the HAL API. The CRC (cyclic redundancy check imputes a 16-bit CRC code derived from a buffer of 8-bit data(bytes) CRC Data Reversing._ 16bit CRC nput and output data reversal features are enabled. The user-defned generatingMX MX MXMX palynomial is manually set to 0x1021, that is, X16+ X12+X 5+ 1 which is the CRC CCiTT generating polynomial How to configure the CRC using the HAL APl. The Crc (cyclic redundancy check CRC- EXample alculation unit computes the CRc code of a given buffer of 32-bit data words, using a MX MXMXMX Fixed generator polynomial (Cx4C11DB How to configure the CRc using the hAl aPl. the crc (cyclic redundancy check CRC UserDefinec Polynom calculation unit computes the 8-bit CRC code for a given buffer of 32-bit data words, MXMXMXMX based on a user-defined generating polynomial How to use the CRYP peripheral to encrypt and decrypt data using AES in chaining modes(eCB, cBC, ctr) MX CRYP CRYP DMA How to use the CRYP peripheral to encrypt and decrypt data using the AES-128 lgorithm with ecb chaini MX oQ≌am= Leyel Module namc Project Namc Description DAC Signals Generation How to use the DAc peripheral to generate several signals using the DMa controller and the dac internal wave generator MXMX DAC DAC Simple Conversion How to use the dac peripheral to do a simple conversion. MX MX DMA DMA FLASHTORAM How to usc a DMA to transfcr a word data buffer from Flash memory to cmbedded SRAM through the HAL API MX MXMX FLASH FLASH EraseProgram How to configure and use the FLASH HAL API to erase and program the internal FlashMX MXM GPIO E How to configure external interrupt lines MXMX GPIO GPIO IOToggle How to configure and use PLoS through the HAl aPl. MXMXMXMX HAL Time Base How to customize HAL using a general-purpose timer as main source of time base, MXMXMX Example HAL Time Base RTC ALARM How to customize HAL using RTC alarm as main source of time basc, instead of Systick. MXMXMX HAL HAL Time Base RTC WKUP How to customize HAL using RTC wakeup as main source of time base, instead ot Systick MX MX M HAL Time Base TIM How to customize HAL using a general-purpose timer as main source of time base MX MXMX 12C Two Boards AdvComIT How to handle 12C da a buffer tranismission/reception batween two boards, using anMXMX 12C TWoBoards comMA How to handle 12C data buffer transmission/reception between two boards, via DMA. MXMXMX 12C TwoBoards comIT How to handle 12C data buffer transmission/reception between two boards, using anMX MXMX 2C TwoBoards com Polling How to handle l2c data buffer transmission'reception betiveen two boards, in polling MXMX 12C_-TwoBoardsRestarlAdvComlT How to perform multile 2c data buffer transmission 'reception between two boards. in MXMX oQ≌am= Leyel Module namc Project Namc Description ec TwoBoards restartcomIt How to handle single (2C data buffer transmission reception botween two boards, inMXIMX 12C WakeUpFromStop How to handle 12c data buffor transmission/reception betwcen two boards, using an interrupt when the device is in Stop mode WDG Reset How to handle the IWDG reload counter and simulatc a software fault that gcncrates an MCU IWDG reset after a preset lapis of time MX MXMX IWDG WDG Window Mode How to perodically date the IwDG reload counter and simulate a sotware fault that MX MX MXMX LPTIM PWMEXterna Clock How to configure and use, through the HAL LPTIM API, the LPTiM peripheral using an external counter clock, to generate a PWM signal at the lowest power consumption MXMX LPTIM PWM LSE How to configure and use, through the HAL LPTIM API, the LPTIM peripheral using LSE as counter clock, to generate a PWM signal, in a low-power mode MX LPTIM LPTIM Pulsc Counter How to configure and use. through the LPtIM HAL APl, the LPTIM peripheral to count MXMX Example LPTIM Timeout How to implement, through the HAL LPTIM APl, a timeout with the LPTIMER peripheral to wake up the system from a low-power moce MXMX PWR LPRUN How to enter and exit the Low-power run mode MX MX M MX PWR LPSLEEP How to enter the Low-power sleep mode and wake up from this mode by using an MX MXMX PWR PWR PVD How to configure the program mable voltage delector by using an external interrupt line Extemal DC supply must be used to supply Vdd MX M PWR SLEEP How to enter the Sleep mode and wake up from this mode by using an interrupt MXMX MX PWR STANDB ow to enter the Standby mode and wake up from this mode by using an external resetMXMXMX RCC_ Clock Config Configuration of the system clock (SYSCLK)and modification of the clock settings inMX MXMX Run mode, using the RCC HAL API RCC_ LSEConfig ng of the w-speed externa (LSE)Rc oscillator ( time, using the RCC HAL API In MX oQ≌am= Leyel Module namc Project Namc Description RCC LS COt Enabling/disabling of the low spoed intornal (L SI) RC osillator (about 32 KHz)at runMXMX ne, using RCC Switch Clock Switch of the system clock (SYSCLK) from Low froquency clock to high frequency clock, sing the RCC HAL API MX MX RNG MultIRNG Configuration of the RNG using the HAL APl. This cxample uses the RNG to generate 32-bit long random numbers MX RNG RNG MultiRNG IT Contiguration ct the RNG using the HAL APl. This example uses RNG interrupts generate 32-bit long ranDom numbers MX RTC Alarm Configuration and generation of an RTC alarm using the RTC HAL API MXMXMX RTC Calendar Configuration of the calendar using the rtc HAl apl MXMXMX RTC IntcrnalTimestamp Demonstration the internal timestamp foature using the RTC HAL APL. MX Example RTC RTC LSI Use of the LSI clock source autocalibration to get a precise RTC clock MXMXMX RTC Low Powcr STAND BY How to enter STANDBY mode and wake up from this mode using the Rtc alarm event M RIC Tamper Contiguration of the RIC HAL API to write/read data to/trom RIC Backup registers MXIMXMX RTC Time Stamp Configuration of the RTC HAL API to demonstrate the timestamp feature MX MX M SMBUS SMBUS TSENSOR This example shows how to ensure SMBUS Data buffer transmission and reception with IT. The communication is done with a SMBUs temperature sensor. MX SPI Full Duplex ComDMA Master Data buffer transmission/reception between two boards via SPI using DMA. MX MX SPI FullDuplex ComDMA Slave Data buffer transmission/reception between two boards via sPl using DMA. MXMXMX SPI FullDuplex ComIT_ Master Data buffer transmission /reception between two boards via SPl using Interrupt mode. MX MXMX oQ≌am= Leyel Module namc Project Namc Description SPI Full Duplex ComIT Slave Data buffer transmission/reception between two boards via SPI using Interrupt mode MXMXMX SPI SPI_FullDuplex_ComPolling_Master Data buffer transmission/reception between two boards via SPI using Polling mode SPI Ful Duplex ComPolling slave Data buffer transmission/reception between two boards via SPl using Polling mode MX MX TIM DMA Use of the DMA with TIMER Update request to transfer data from memary to TIMERMX MXIMX Capture Compare Regisler 3(TIMX_ CCR3) TIM DMABurst How to update the TIMER channel 1 period anc duty cycle using the TIMER DMA burst MXMXMX TIM ExtTrigger Synchro is exampe shows how to synchronize TIM peripherals in cascade mode with anMXMXMX TIM Inputcapture How to use the TIM peripheral to measure an external signal frequency MX MXMX Configuration of the TIM peripheral in Output Compare Active mode (when the counter Examples TIM OCActive matches the capture/compare register. the corresponding output pin is set to its activeMX MXIMX TIM INActive Configuration of the TIM peripheral in Output Compare Inactive mode with the corresponding Interrupt requests far each channel MX TIM OC Toggle Configuration of the TiM peripheral to generate four different signals at four differentMX XMX TIM Onc Pulsc Use of the TIM peripheral to generate a single pulse when an external signal rising edge X X X TIM PWMInput How to use M TIM PWMOutput Configuration of the tiM peripheral in PWM(pulse width modulation)mode. MX MX M TIM TimeBase iguration of the tiM peripheral to generale a tirne tase of one second with the sponding interrupt request MXMXMX UART LPUART WakeUpFrom Stop Configuration of an LPUART to wake up the MCU frorn Stop node when a given stimulus is received MX MX

...展开详情
试读 23P STM32G0 cube例程
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
STM32G0 cube例程 50积分/C币 立即下载
1/23
STM32G0 cube例程第1页
STM32G0 cube例程第2页
STM32G0 cube例程第3页
STM32G0 cube例程第4页
STM32G0 cube例程第5页

试读结束, 可继续读2页

50积分/C币 立即下载