+ +
- -
Systèmes d'Exploitation
Calendrier  Détails
Programmation
 
Calendrier  Détails
Processeurs ARM
 
Calendrier  Détails
Processeurs PowerPC
 
 
 
 
Calendrier  Détails
Communications
 
Calendrier  Détails
+ +
> >
- -

 
ac6 >> ac6-formation >> Programmation >> Langages >> STM32 + FreeRTOS + LwIP/EmWin Télécharger le catalogue Télécharger la page Ecrivez nous Version imprimable

STG STM32 + FreeRTOS + LwIP/EmWin

This course covers the STM32 ARM-based MCU family, the FreeRTOS Real Time OS, the LWIP TCP/IP Stack and/or the EmWin GUI Stack

formateur
Objectives
  • Get an overview on the Cortex-M architecture
  • Understand the Cortex-M software implementation and debug
  • Learn how to deal with interrupts
  • Get an overview on STM32F4 architecture
  • Describing the units which are interconnected to other modules, such as clocking, interrupt controller and DMA controller
  • Describing some independent I/O modules like the ADC and GPIOs
  • Getting started with the ST Drivers to program STM32 peripherals (The STM32Cube Library or ST Standard Peripheral Library)
  • Understand the FreeRTOS architecture
  • Discover the various FreeRTOS services and APIs
  • Learn how to develop and debug FreeRTOS applications
  • Getting started with the lwIP TCP/IP stack (Describing the STM32 Ethernet Controller, having a look on porting, describing the parameterizing, and developping application based on UDP and TCP protocols) (not available for STM32F0 family)
  • Getting started with EmWin GUI library, learn to develop a GUI for STM32
This course can be based on STM32F4xx, STM32F2xx, STM32F1xx, or STM32F0xx families
Course environment
  • Convenient course material with space for taking notes
  • Example code, labs and solutions
  • A STM32-Eval Board (like the STM3240G-Eval Board (Cortex-M4)) with the SW4STM32 IDE (Keil, IAR or Trace32 (Lauterbach) can also be used)
Prerequisites
  • Familiarity with C concepts and programming targeting the embedded world
  • Basic knowledge of embedded processors
  • Basic knowledge of multi-task scheduling

First Day
Cortex-M Architecture Overview
  • V7-M Architecture Overview
  • Core Architecture
    • Harvard Architecture, I-Code, D-Code and System Bus
    • Write Buffer
    • Bit-Banding
    • Registers (Two stacks pointers)
    • States
    • Different Running-modes and Privileged Levels
    • System Control Block
    • Systick Timer
    • MPU Overview
  • Programming
    • Alignment and Endianness
    • CMSIS Library
  • Exception / Interrupt Mechanism Overview
    • Vector Table
    • Interrut entry and return Overview
    • Tail-Chaining
    • Pre-emption (Nesting)
    • NVIC Integrated Interrupt Controller
    • Exception Priority Management
    • Fault escalation
  • Debug Interface
Exercise :  Becoming familiar with the IDE and clarifying the boot sequence
Exercise :  Changing the use stack pointer and the privilege mode with the CMSIS library
Exercise :  Interrupt Management on Cortex-M core (put in evidence tail-chaining/nesting)
STM32F2 MCUs Architecture Overview
  • ARM core based architecture
  • Description of STM32FX SoC architecture
  • Clarifying the internal data and instruction paths: Bus Matrix, AHB-lite interconnect, peripheral buses, AHB-to-APB bridges, DMAs
  • Memory Organization
    • Flash memory read interface
    • Adaptive Real-Time memory accelerator, instruction prefetch queue and branch cache
    • Sector and mass erase
    • Concurrent access to RAM blocks
  • SoC mapping
  • Flash Programming methods
  • Boot Configuration
Second Day
Reset, Power and Clocking
  • Reset
    • Reset sources
    • Boot configuration, physical remap
    • Embedded boot loader
  • Clocking
    • Clock sources, HSI, HSE, LSI, LSE
    • Integrated PLLs
    • Clock outputs
    • Clock security system
  • Power control
    • Power supplies, integrated regulator
    • Battery backup domain, backup SRAM
    • Independent A/D converter supply and reference voltage
    • Power supply supervisor
    • Brownout reset
    • Programmable voltage detector
  • Low power modes
    • Entering a low power mode, WFI vs WFE
    • Sleep mode
    • Stop mode
    • Standby mode
Exercise :  Initialize the system at different frequencies
Exercise :  Enter Low power modes and wake up (optional)
ST Firmware Library Description
DMA
  • Dual AHB master bus architecture, one dedicated to memory accesses and one dedicated to peripheral accesses
  • 8 streams for each DMA controller, up to 8 channels (requests) per stream
  • Priorities between DMA stream requests
  • FIFO structure
  • Independent source and destination transfer width
  • Circular buffer management
  • Double buffer mode
  • DMA1 and DMA2 request mapping
Exercise :  Initialize memory-to-memory DMA transfers
Communicate with the world external to the chip
  • Power pins
  • Pinout
    • Pin Muxing, alternate functions
  • GPIO module
    • Configuring a GPIO
    • Speed selection
    • Locking mechanism
    • Analog function
    • Integrated pull-up / pull-down
    • I/O pin multiplexer and mapping
  • System configuration controller
    • I/O compensation cell
    • External Interrupts / Wakeup lines selection
    • Ethernet PHY interface selection
  • External Interrupts
Exercise :  Configure an external Interrupt
Exercise :  Configure a timer interrupt
12-bit Analog-to-Digital Converter
  • 12-bit, 10-bit, 8-bit or 6-bit configurable resolution
  • Regular channel group vs Injected channel group
  • Single and continuous conversion modes
  • Scan mode for automatic conversion of channel 0 to channel ‘n’
  • External trigger option with configurable polarity for both regular and injected conversions
  • Discontinuous mode
  • Analog watchdog’s guarded area
  • Dual/Triple mode (on devices with 2 ADCs or more)
  • Configurable delay between conversions in Dual/Triple interleaved mode
  • DMA request generation during regular channel conversion
Exercise :  Get voltage from the potentiometer using, DMA transfer generation, display the result on LCD screen
Timers Overview (optional)
  • Advanced-control timers TIM1 and TIM8
    • 16-bit up, down, up/down auto-reload counter; 16-bit programmable prescaler
    • Input Capture, Output Compare, PWM generation, One-pulse mode
    • Synchronization circuit/ Controlling Timers external signals / Interconnecting several timers
    • Interrupt/DMA generation
  • Real Time Clock
    • Independent BCD timer/counter; 16-bit programmable prescaler
    • Daylight saving compensation programmable by software
    • Two programmable alarms with interrupt function
    • Automatic wakeup unit
    • Reference clock detection / Digital calibration circuit
    • Tamper detection
Exercise :  Input Capture, Output Compare, PWM generation, Interrupt and DMA transfer generation (optional)
Exercise :  Configuring the RTC (optional)
Third Day
The FreeRTOS source code
  • Introduction to FreeRTOS
    • The FreeRTOS architecture and features
  • Getting FreeRTOS source code
    • Files and directories structure
  • Data types and coding style
    • Naming conventions
  • FreeRTOS on the Cortex/M processors
Task Management
  • Prioritized Pre-emptive Scheduling / Co-operative scheduling
  • The Task life-cycle
    • Task Functions
    • Creating tasks
    • Using the task parameter
    • The Task State Machine
    • Deleting tasks
  • Task Priorities
    • Assigning task priorities
    • Changing task priorities
  • The idle task
    • Idle task hook
  • Blocking a task for a specific delay
  • Editing the FreeRTOSConfig.h header file
  • Suspending a task
  • The Kernel Structures Overview
  • FreeRTOS Debug Capabilities (Hook, Trace)
Exercise :  Managing tasks, get trace information
Memory Management
  • Memory management algorithms
    • Best fit / First Fit
  • FreeRTOS-provided memory allocation schemes
    • Choosing the heap_x.c file depending on the application
  • Adding an application-specific memory allocator
  • Checking remaining free memory
  • Stack monitoring
  • Dimensioning Stack and Heap
Fourth Day
Queue Management
  • Blocking on queue Reads
  • Blocking on queue Writes
  • Queue Creation
  • Sending on a queue
  • Receiving from a queue
  • Sending compound types
  • Transfering large data
  • Queue Set Overview/ Blocking on multiple objects
  • Semaphores and Events Introduction
Exercise :  Synchronizing and communicating between tasks through queues to send datas to a bus communication
Resource Management
  • Conflict examples
  • Mutual exclusion
  • Critical sections
    • Disabling the interrupts
    • Suspending (locking) the scheduler
  • Mutexes
    • Mutual exclusion scenario
    • API functions for Mutexes
    • Recursive Mutexes
    • Priority inversion
    • Priority inheritance
    • Deadlock
  • Gatekeeper tasks
Exercise :  Implement mutual exclusion between different tasks
Interrupt Management
  • Binary semaphore used for interrupt synchronization
    • API function for binary semaphore
  • Counting semaphores
  • Using queues within an ISR
  • Interrupt Nesting
    • Interrupts on Cortex-M
  • Low Power Support
Exercise :  Synchronize Interrupts with tasks
Fifth Day
Software Timer
  • The Timer Daemon Task
  • Timer Configuration
  • One-shot / Auto-reload Timer
  • Software Timer API
Exercise :  Implement Software Timers with a semaphore
FreeRTOS MPU
  • User Mode and Privilege Mode
    • Access Permission Attributes
  • Defining an MPU region
  • Creating a non-privileged task
  • Linker configuration
  • Practical Usage Tips
STM32 Fast Ethernet Controller Overview
  • Architecture of the MAC
  • Connection to PHY, RMII / MII
  • Transmit and receive FIFO threshold setting
  • Multicast and unicast address filtering
  • Management interface
  • Buffer and Buffer Descriptor organization
  • Low level Drivers for STM32
LwIP TCP/IP Stack Presentation
  • Overview
  • Buffer and memory management
  • LwIP configuration options
  • Network interfaces
  • MAC and IP address settings
  • IP processing
  • UDP processing
  • TCP processing
  • Interfacing the stack
  • Application Program Interface (API)
    • Standalone
    • Netconn and BSD socket library
  • STM32/FreeRTOS Port Overview
Exercise :  TCP/UDP echo server netconn
Exercise :  ST HTTP server (optional)
EmWin GUI Stack Presentation (optional)
  • Library and package description
  • How to use the library
    • Configuration
    • Initialization
    • Core functions
    • Developing a multi-task application with EmWin
    • Working with some widgets (as the Windows, Buttons, Multipage, Image, ListBox, CheckBox)
    • Using the EmWinGuiBuilder software
Exercise :  Getting started with the emWin stack, create a GUI to control input/output from the touch screen