
Transcription
AN4724Application noteSTM32Cube firmware examples for STM32F1 SeriesIntroductionThe STM32CubeF1 firmware package comes with a rich set of examples running onSTMicroelectronics boards. The examples are organized by board and provided withpreconfigured projects for the main supported toolchains (see Figure 1).Figure 1. STM32CubeF1 firmware components(YDOXDWLRQ ERDUGV'LVFRYHU\ ERDUGV670 1XFOHR ERDUGV'HGLFDWHG ERDUGV8VHU DSSOLFDWLRQ8WLOLWLHV SSOLFDWLRQ OHYHO GHPRQVWUDWLRQV7&3 ,386%*UDSKLFV) 7 ILOH V\VWHP0LGGOHZDUH OHYHO 5726&06,68WLOLWLHV%RDUG 6XSSRUW 3DFNDJH %63/RZ /D\HU // DUGZDUH EVWUDFWLRQ /D\HU / / DQG // 3,V 7KH VHW RI PLGGOHZDUH FRPSRQHQWV GHSHQGV RQ WKH SURGXFW 6HULHV April 2017DocID028025 Rev 206 9 1/31www.st.com1
ContentsAN4724Contents1Reference documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32STM32CubeF1 examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302/31DocID028025 Rev 2
AN47241Reference documentsReference documentsThe following user manuals are available on www.st.com/stm32cubefw: Latest release of STM32CubeF1 firmware package Getting started with the STM32CubeF1 firmware package for the STM32F1 series(UM1847) STM32CubeF1 Nucleo demonstration firmware (UM1853) Description of STM32F1xx HAL and low-layer drivers (UM1850) STM32Cube USB Device library (UM1734) STM32Cube USB host library (UM1720) Developing applications on STM32Cube with FatFs (UM1721) Developing Applications on STM32Cube with RTOS (UM1722) Developing applications on STM32Cube with LwIP TCP/IP stack (UM1713) STM32Cube Ethernet IAP example (UM1709)DocID028025 Rev 23/3130
STM32CubeF1 examples2AN4724STM32CubeF1 examplesThe examples are classified depending on the STM32Cube level they apply to. They arenamed as follows: ExamplesThe examples use only the HAL and BSP drivers (middleware not used). Theirobjective is to demonstrate the product/peripherals features and usage. They areorganized per peripheral (one folder per peripheral, e.g. TIM). Their complexity levelranges from the basic usage of a given peripheral (e.g. PWM generation using timer) tothe integration of several peripherals (e.g. how to use DAC for signal generation withsynchronization from TIM6 and DMA). The usage of the board resources is reduced tothe strict minimum. Examples LLThese examples use only the LL drivers (HAL drivers and middleware components notused). They offer an optimum implementation of typical use cases of the peripheralfeatures and configuration sequences. The examples are organized per peripheral(one folder for each peripheral, e.g. TIM) and run exclusively on Nucleo board. Examples MIXThese examples use only HAL, BSP and LL drivers (middleware components notused). They aim at demonstrating how to use both HAL and LL APIs in the sameapplication to combine the advantages of both APIs: –HAL offers high-level function-oriented APIs with high portability level by hidingproduct/IPs complexity for end users.–LL provides low-level APIs at register level with better optimization. The examplesare organized per peripheral (one folder for each peripheral, e.g. TIM) and runexclusively on Nucleo board.ApplicationsThe applications demonstrate the product performance and how to use the availablemiddleware 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 alsosupported. DemonstrationsThe demonstrations aim at integrating and running the maximum number ofperipherals and middleware stacks to showcase the product features and performance. Template projectThe template project is provided to allow quickly building a firmware application on agiven board.The examples are located under STM32Cube FW F1 VX.Y.Z\Projects\. They all have thesame structure:4/31 \Inc folder containing all header files \Src folder containing the sources code \EWARM, \MDK-ARM, \SW4STM32 and \TrueSTUDIO folders containing thepreconfigured project for each toolchain. readme.txt file describing the example behavior and the environment required to runthe example.DocID028025 Rev 2
AN4724STM32CubeF1 examplesTo run the example, proceed as follows:Note: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 instructionsRefer to "Development toolchains and compilers" and "Supported devices and evaluationboards" sections of the firmware package release notes to know more about thesoftware/hardware environment used for the firmware development and validation. Thecorrect operation of the provided examples is not guaranteed in other environments, forexample when using different compiler or board versions.The examples can be tailored to run on any compatible hardware: simply update the BSPdrivers 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 toany hardware by implementing the low-level routines.Table 1 contains the list of examples provided within STM32CubeF1 firmware package.DocID028025 Rev 25/3130
LevelTemplates LLProject 103RBSTM3210CEVAL-Starter projectThis projects provides a reference template based the LLAPI that can be used to build any firmware application.XXXX1111XXXX1111This example provides a description of how to use thedifferent BSP drivers.-X-XADC AnalogWatchdogThis example provides a short description of how to usethe ADC peripheral to perform conversions with analogwatchdog and out-of-window interruptions enabled.--X-ADC DualModeInterleavedThis example provides a short description of how to usetwo ADC peripherals to perform conversions ininterleaved dual-mode.---XADC Regular injectedgroupsThis example provides a short description of how to usethe ADC peripheral to perform conversions using the twoADC groups: regular group for ADC conversions on mainstream and injected group for ADC conversions limited tospecific events (conversions injected within mainconversions stream).X--XADC SequencerThis example provides a short description of how to usethe ADC peripheral with sequencer, to convert severalchannels.-X--CAN NetworkingThis example shows how to configure the CAN peripheralto send and receive CAN frames in normal mode.-X--CRC ExampleThis example guides you through the differentconfiguration steps by means of the HAL API. The CRC(Cyclic Redundancy Check) calculation unit computes theCRC code of a given buffer of 32-bit data words, using afixed generator polynomial (0x4C11DB7).XXXXTotal number of templates ll: 4Templates-Starter projectThis projects provides a reference template that can beused to build any firmware application.Total number of templates: 4-BSPDocID028025 Rev 2ADCExamplesCANCRC6/31STM32CubeF1 examplesModule NameAN4724Table 1. STM32CubeF1 firmware examples
LevelModule STM3210CEVALCORTEXM MPUThis example presents the MPU feature. The examplepurpose is to configure a memory region as privilegedread-only region and attempt to perform read and writeoperations in different modes.-X--CORTEXM ModePrivilegeThis example shows how to modify Thread modeprivilege access and stack. Thread mode is entered onreset or when returning from an exception.-X--This example shows how to use the default SysTickconfiguration with a 1 ms timebase to toggle LEDs.-X--DAC SignalsGenerationThis example provides a description of how to use theDAC peripheral to generate several signals using theDMA controller.---XDAC SimpleConversionThis example provides a short description of how to usethe DAC peripheral to perform a simple conversion.-X--DMA FLASHToRAMThis example provides a description of how to use a DMAchannel to transfer a word data buffer from Flash memoryto embedded SRAM through the HAL API.-X--FLASH EraseProgramThis example describes how to configure and use theFLASH HAL API to erase and program the internal Flashmemory.--X-FLASH WriteProtectionThis example describes how to configure and use theFLASH HAL API to enable and disable the writeprotection of the internal Flash memory.--X-Project NameCORTEXM SysTickExamplesDACDocID028025 Rev 2DMAFLASHDescriptionSTM32CubeF1 examples7/31Table 1. STM32CubeF1 firmware examples (continued)AN4724
LevelModule NameFSMCProject 103RBSTM3210CEVALFSMC NANDThis example describes how to configure the FSMCcontroller to access the NAND memory.-X--FSMC NORThis example describes how to configure the FSMCcontroller to access the NOR memory.-X--This example describes how to build an application to beloaded into the NOR memory mounted on board and thenexecute it from internal Flash memory.-X--This example describes how to configure the FSMCcontroller to access the SRAM.-X--This example describes how to configure the FSMCcontroller to access the SRAM, including heap and stack.-X--This example shows how to configure external interruptlines.X---GPIO IOToggleThis example describes how to configure and use GPIOsthrough the HAL API.XXXXHAL TimeBase RTCALARMThis example describes how to customize the HALtimebase using the RTC Alarm instead of the SysTick asmain timebase source. The discovery board user button(connected to EXTI Line0) will be used to Suspend orResume tick increment.XXXXThis example describes how to customize the HALtimebase using a general purpose timer instead of theSysTick as main timebase source.XXXXFSMC NOR CodeExecuteFSMC SRAMFSMC SRAM DataMemoryExamplesDocID028025 Rev 2GPIO EXTIGPIOHALHAL TimeBase TIMAN4724Table 1. STM32CubeF1 firmware examples (continued)STM32CubeF1 examples8/31
LevelModule NameI2CExamplesDocID028025 Rev 2I2SIWDGProject 103RBSTM3210CEVALI2C TwoBoardsAdvComITThis example describes how to perform I2C data buffertransmission/reception between two boards, using aninterrupt.-XX-I2C TwoBoardsComDMAThis example describes how to perform I2C data buffertransmission/reception between two boards, via DMA.-XX-I2C TwoBoardsComITThis example describes how to perform I2C data buffertransmission/reception between two boards using aninterrupt.-XX-I2C TwoBoards ComPollingThis example describes how to perform I2C data buffertransmission/reception between two boards in Pollingmode.-XX-I2C TwoBoardsRestartAdvComITThis example describes how to perform I2C data buffersequential transmission/reception between two boardsusing an interrupt.-XX-I2C TwoBoardsRestartComITThis example describes how to perform I2C data buffersequential transmission/reception between two boardsusing an interrupt.-XX-This example provides basic implementation of audiofeatures.---XThis example describes how to reload the IWDG counterand to simulate a software fault by generating an MCUIWDG reset when a programmed time period haselapsed.---XI2S AudioIWDG ExampleSTM32CubeF1 examples9/31Table 1. STM32CubeF1 firmware examples (continued)AN4724
LevelModule NamePWRRCCDocID028025 Rev RBSTM3210CEVALPWR PVDThis example shows how to configure the programmablevoltage detector using an external interrupt line. ExternalDC supply has to be used to power VDD.-X--PWR SLEEPThis example shows how to enter Sleep mode and wakeup from this mode by using an interrupt.X---PWR STANDBYThis example shows how to enters the system to Standbymode and wake up from this mode using external RESETor WKUP pin.--X-RCC ClockConfigThis example describes how to use the RCC HAL API toconfigure the system clock (SYSCLK) and modify theclock settings in Run mode.XXXXThis example guides you through the differentconfiguration steps by means of the RTC HAL API toconfigure and generate an RTC alarm.--X-This example guides you through the differentconfiguration steps by mean of HAL API to ensureCalendar configuration using the RTC peripheral.-X--This example demonstrates and explains how to use theLSI clock source auto-calibration to get a precise RTCclock.---XRTC LowPowerSTANDBYThis example shows how to enter Standby mode andwake up from this mode using RTC Alarm Eventconnected to EXTI Line17.X---RTC TamperThis example guides you through the differentconfiguration steps by means of the RTC HAL API towrite/read data to/from RTC Backup registers anddemonstrate the tamper detection feature.-X--This example describes a firmware Smartcard Interfacebased on the USART peripheral. The main purpose ofthis firmware example is to provide resources thatfacilitate the development of an application using theUSART peripheral in Smartcard mode.-X-XRTC AlarmRTC CalendarExamplesRTCSMARTCARDRTC LSISMARTCARD T010/31STM32CubeF1 examplesProject NameAN4724Table 1. STM32CubeF1 firmware examples (continued)
LevelModule 0CEVALThis example shows how to perform SPI data buffertransmission/reception between two boards via DMA.X-X-This example shows how to ensure SPI data buffertransmission/reception between two boards by using aninterrupt.X-X-SPI FullDuplex ComPollingThis example shows how to ensure SPI data buffertransmission/reception in Polling mode between twoboards.X-X-TIM ComplementarySignalsThis example shows how to configure the TIM1 peripheralto generate three complementary TIM1 signals, insert adefined dead time value, and use the break feature andlock the desired parameters.-X--TIM DMAThis example provides a description of how to use DMAwith TIM1 Update request to transfer data from memoryto TIM1 Capture Compare Register 3 (TIM1 CCR3).-XX-TIM InputCaptureThis example shows how to use the TIM peripheral tomeasure the frequency of an external signal.-X--TIM PWMOutputThis example shows how to configure the TIM peripheralin PWM (Pulse Width Modulation) mode.-X--TIM TimeBaseThis example shows how to configure the TIM peripheralto generate a 1 second timebase with the correspondingInterrupt request.XXXXProject NameSPI FullDuplex ComDMASPIExamplesSPI FullDuplexComITDocID028025 Rev 2TIMDescriptionSTM32CubeF1 examples11/31Table 1. STM32CubeF1 firmware examples (continued)AN4724
LevelModule NameProject NameDocID028025 Rev 10CEVALUART HyperTerminalDMAThis example shows how to perform UART data buffertransmission and reception with DMA. Thecommunication is done with the HyperTerminal PCapplication.X-XXUART PrintfThis example shows how to reroute the C library printffunction to the UART. It outputs a message sent by theUART to the HyperTerminal.XXXXUART TwoBoardsComDMAThis example describes an UART transmission(transmit/receive) in DMA mode between two boards.X-XXUART TwoBoardsComITThis example describes an UART transmission(transmit/receive) in Interrupt mode between two boards.X-XXUART TwoBoardsComPollingThis example describes an UART transmission(transmit/receive) in Polling mode between two boards.X-XXThis example guides you through the differentconfiguration steps by means of the HAL API to performperiodic WWDG counter update and simulate a softwarefault that generates an MCU WWDG reset when apredefined time period has elapsed.--X-18342719UARTExamplesDescriptionWWDG ExampleTotal number of examples: 98AN4724Table 1. STM32CubeF1 firmware examples (continued)STM32CubeF1 examples12/31
LevelDocID028025 Rev 2ExamplesLLModule 103RBSTM3210CEVALADC AnalogWatchdogThis example describes how to use a ADC peripheral withADC analog watchdog to monitor a channel and detectwhen the corresponding conversion data is out of windowthresholds; This example is based on the STM32F1xxADC LL API. The peripheral initialization is done using LLunitary services functions for optimization purpose(performance and size).--X-ADC ContinuousConversion TriggerSWThis example describes how to use a ADC peripheral toperform continuous ADC conversions of a channel, froma software start. This example is based on theSTM32F1xx ADC LL API. The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-ADC ContinuousConversion TriggerSW InitThis example describes how to use a ADC peripheral toperform continuous ADC conversions of a channel, froma software start. This example is based on theSTM32F1xx ADC LL API. The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-ADC GroupsRegularInjectedThis example describes how to use a ADC peripheral withboth ADC groups (ADC group regular and ADC groupinjected) in their intended use case. This example isbased on the STM32F1xx ADC LL API. The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-ADC MultiChannelSingleConversionThis example describes how to use a ADC peripheral toconvert several channels. ADC conversions areperformed successively in a scan sequence. Thisexample is based on the STM32F1xx ADC LL API. Theperipheral initialization is done using LL unitary servicesfunctions for optimization purpose (performance andsize).--X-ADC MultimodeDualInterleavedThis example describes how to use several ADCperipherals in multimode mode interleaved. This exampleis based on the STM32F1xx ADC LL API. The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-ADCAN4724Project NameSTM32CubeF1 examples13/31Table 1. STM32CubeF1 firmware examples (continued)
LevelDocID028025 Rev 2ExamplesLLModule 103RBSTM3210CEVALADC SingleConversion TriggerSWThis example describes how to use a ADC peripheral toperform a single ADC channel conversion at eachsoftware start. It uses the polling programming model (fordetails on interrupt or DMA transfer programming models,refer to other examples). This example is based on theSTM32F1xx ADC LL API. The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-ADC SingleConversion TriggerSW DMAThis example describes how to use an ADC peripheral toperform a single ADC channel conversion at eachsoftware start. It uses the DMA transfer programmingmodel (for details on polling or interrupt programmingmodels, refer to other examples); This example is basedon the STM32F1xx ADC LL API. The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-ADC SingleConversion TriggerSW ITThis example describes how to use an ADC peripheral toperform a single ADC channel conversion at eachsoftware start. It uses the interrupt programming model(for details on polling or DMA transfer programmingmodels, refer to other examples).This example is basedon the STM32F1xx ADC LL API. The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-ADC SingleConversion TriggerTimer DMAThis example describes how to use an ADC peripheral toperform a single ADC channel conversion at each timertrigger event. Converted data are indefinitely transferredby DMA into a table (circular mode); This example isbased on the STM32F1xx ADC LL API. The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-ADC14/31STM32CubeF1 examplesProject NameAN4724Table 1. STM32CubeF1 firmware examples (continued)
LevelDocID028025 Rev RBSTM3210CEVALADCADC TemperatureSensorThis example describes how to use an ADC peripheral toperform a single ADC conversion of the internaltemperature sensor and to calculate the temperature inCelsius degrees. This example using the pollingprogramming model (for details on interrupt or DMAtransfer programming models, refer to other examples).This example is based on the STM32F1xx ADC LL API.The peripheral initialization is done using LL unitaryservices functions for optimization purpose (performanceand size).--X-CORTEXCORTEX MPUThis example presents the MPU feature. Its purpose is toconfigure a memory area as privileged read-only areaand attempt to perform read and write operations indifferent modes.-X--This example shows how to configure the CRCcalculation unit to get the CRC code of a given databuffer, based on a fixed generator polynomial (defaultvalue 0x4C11DB7). The peripheral initialization is doneusing LL unitary services functions for optimizationpurpose (performance and size).--X-DAC GenerateConstantSignalTriggerSWThis example describes how to use the DAC peripheral togenerate a constant voltage signal.This example is basedon the STM32F1xx DAC LL API. The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).-X--DAC GenerateWaveform TriggerHWThis example describes how to use the DAC peripheral togenerate a waveform voltage from a digital data streamtransferred by DMA. This example is based on theSTM32F1xx DAC LL API. The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).-X--DAC GenerateWaveform TriggerHWInitThis example describes how to use the DAC peripheral togenerate a waveform voltage from a digital data streamtransfered by DMA. This example is based on theSTM32F1xx DAC LL API. The peripheral initialization isdone using LL initialization function to demonstrate LL initusage.-X--CRCExamplesCRC CalculateAndCheckLLDACAN4724Project NameModule NameSTM32CubeF1 examples15/31Table 1. STM32CubeF1 firmware examples (continued)
LevelModule NameDMADocID028025 Rev s example describes how to use a DMA channel totransfer a word data buffer from Flash memory toDMA CopyFromFlashToembedded SRAM. The peripheral initialization is doneMemoryusing LL unitary services functions for optimizationpurpose (performance and size).--X-This example describes how to use a DMA channel totransfer a word data buffer from Flash memory toDMA CopyFromFlashToembedded SRAM. The peripheral initialization is doneMemory Initusing LL initialization function to demonstrate LL initusage.--X-EXTI ToggleLedOnITThis example describes how to configure the EXTI anduse GPIOs to toggle the user LEDs available on theboard when a user button is pressed. It is based on theSTM32F1xx LL API. The peripheral initialization is doneusing LL unitary services functions for optimizationpurpose (performance and size).--X-EXTI ToggleLedOnITInitThis example describes how to configure the EXTI anduse GPIOs to toggle the user LEDs available on theboard when a user button is pressed. This example isbased on the STM32F1xx LL API. The peripheralinitialization is done using LL initialization function todemonstrate LL init usage.--X-GPIO InfiniteLedTogglingThis example describes how to configure and use GPIOsto toggle the user LEDs available on the board every250 ms. This example is based on the STM32F1xx LLAPI. The peripheral initialization is done using LL unitaryservices functions for optimization purpose (performanceand size).--X-GPIO InfiniteLedToggling InitThis example describes how to configure and use GPIOsto toggle the user LEDs available on the board every 250ms. This example is based on the STM32F1xx LL API.The peripheral initialization is done using LL initializationfunction to demonstrate LL init usage.--X-EXTIGPIODescription16/31STM32CubeF1 examplesSTM32VLDISCOVERYProject NameAN4724Table 1. STM32CubeF1 firmware examples (continued)
LevelDocID028025 Rev 2ExamplesLLModule NameI2CProject 103RBSTM3210CEVALThis example describes how to exchange data betweenan I2C Master device in DMA mode and an I2C Slavedevice in Interrupt mode.The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-I2C OneBoardCommunication DMAAndITThis example describes how to transmit data bytes froman I2C Master device using DMA mode to an I2C Slavedevice using Interrupt mode.The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-I2C OneBoardCommunication ITThis example describes how to receive one data bytefrom an I2C Slave device to an I2C Master device. Bothdevices operate in Interrupt mode.The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-I2C OneBoardCommunication ITInitThis example describes how to receive one data bytefrom an I2C Slave device to an I2C Master device. Bothdevices operate in Interrupt mode.The peripheralinitialization is done using LL initialization function todemonstrate LL init usage.--X-I2C OneBoardCommunicationPollingAndITThis example describes how to transmit data bytes froman I2C Master device using Polling mode to an I2C Slavedevice using Interrupt mode.The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-I2C TwoBoardsMasterRx SlaveTx ITThis example describes how to receive one data bytefrom an I2C Slave device to an I2C Master device. Bothdevices operate in Interrupt mode.The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-I2C TwoBoardsMasterTx SlaveRxThis example describes how to transmit data bytes froman I2C Master device using Polling mode to an I2C Slavedevice using Interrupt mode.The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-AN4724I2C OneBoard AdvCommunication DMAAndITSTM32CubeF1 examples17/31Table 1. STM32CubeF1 firmware examples (continued)
LevelSTM3210EEVALNUCLEOF103RBSTM3210CEVALThis example describes how to transmit data bytes froman I2C Master device using DMA mode to an I2C Slavedevice using DMA mode.The peripheral initialization isdone using LL unitary services functions for optimizationpurpose (performance and size).--X-IWDG RefreshUntilUserEventThis example describes how to configure the IWDG toensure period counter update and generate an MCUIWDG reset when a user button is pressed.The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-PWR EnterStandbyModeThis example shows how to enter Standby mode andwake up from this mode using external RESET or wakeupinterrupt.--X-This example shows how to enter STOP MAINREGUmode.--X-This example describes how to configure MCO pin (PA8)to output the system clock.--X-This example describes how to use the RCC LL API tostart the HSE and use it as system clock.--X---X-Project NameI2CI2C TwoBoardsMasterTx SlaveRxDMAIWDGExamplesLLPWRDocID028025 Rev 2STM32VLDISCOVERYModule NamePWR EnterStopModeRCC OutputSystemClockOnMCORCCRCC UseHSEasSystemClockDescriptionRCC UseHSI PLLasSys This example shows how to modify the PLL parameters intemClockrun time.AN4724Table 1. STM32CubeF1 firmware examples (continued)STM32CubeF1 examples18/31
LevelExamplesLLModule NameDocID028025 Rev 2Project 103RBSTM3210CEVALRTC AlarmThis example guides you through the differentconfiguration steps by mean of LL API to ensure Alarmconfiguration and generation using the RTC peripheral.The peripheral initialization is done using LL unitaryservices functions for optimization purpose (performanceand size).--X-RTC Alarm InitThis example guides you through the differentconfiguration steps by mean of LL API to ensure Alarmconfiguration and generation using the RTC peripheral.The peripheral initialization is done using LL initializationfunction to demonstrate LL init usage.--X-RTC CalendarThis example guides you through the differentconfiguration steps by mean of HAL API to configure theRTC calendar. The peripheral initialization is done usingLL unitary services functions for optimization purpose(performance and size).--X-RTC TamperThis example guides you through the differentconfiguration steps by mean of LL API to ensure Tamperconfiguration using the RTC peripheral. The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-RTCSTM32CubeF1 examples19/31Table 1. STM32CubeF1 firmware examples (continued)AN4724
LevelDocID028025 Rev 2ExamplesLLModule EOF103RBSTM3210CEVALSPI OneBoard HalfDuplex DMAThis example shows how to configure GPIO and SPIperipherals to transmit bytes from an SPI Master deviceto an SPI Slave device in DMA mode. The example isbased on the STM32F1xx SPI LL API.The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-SPI OneBoard HalfDuplex DMA InitThis example shows how to configure GPIO and SPIperipherals to transmit bytes from an SPI Master deviceto an SPI Slave device in DMA mode. The example isbased on the STM32F1xx SPI LL API.The peripheralinitialization is done using LL initialization function todemonstrate LL init usage.--X-SPI OneBoard HalfDuplex ITThis example shows how to configure GPIO and SPIperipherals to transmit bytes from an SPI Master deviceto an SPI Slave device in Interrupt mode. The example isbased on the STM32F1xx SPI LL API.The peripheralinitialization is done using LL unitary services functions foroptimization purpose (performance and size).--X-SPI TwoBoards FullDuplex DMAThis example shows how to ensure SPI data buffertransmission and reception in DMA mode. The example isbased on the STM32F
DocID028025 Rev 2 5/31. AN4724 STM32CubeF1 examples. 30. To run the example, proceed as follows: 1. Open the example using your preferred toolchain. 2.