STM32CubeH7 MCU Firmware Package

repository·master·Indexed 20 days ago

https://github.com/stmicroelectronics/stm32cubeh7

A comprehensive software platform for STM32H7 series microcontrollers. It includes HAL/LL drivers, CMSIS modules (including CMSIS-DSP and CMSIS-NN), middleware such as OpenAMP and libmetal, and board-specific software projects.

Tokens
211.4K
Snippets
226
Records
977
Agent score
68%

What's inside STM32CubeH7

  1. Overview of LwIP HTTP Server Netconn RTOS Application

    master

    This application demonstrates how to implement an HTTP server using the LwIP Netconn API within an RTOS environment on STM32H735xx devices. It allows a remote web browser to interact with the STM32H7 via an Ethernet connection.

    Key Features

    • Static Home Page: Displays information about the STM32H7 and the LwIP stack.
    • Dynamic Page: A second page that refreshes every 1 second to show real-time RTOS statistics.
    • Status Feedback:
      • LCD Mode: If USE_LCD is defined in main.h, Ethernet status and IP address are displayed on the LCD.
      • LED Mode: If LCD is not used, status is indicated via LEDs:
        • LED1: Ethernet cable is connected.
        • LED2: Ethernet cable is not connected.
    • DHCP Support: Dynamic IP allocation can be enabled by setting #define LWIP_DHCP to 1 in lwipopts.h.
  2. Overview of FatFs with RAM disk drive application

    master

    This application demonstrates how to use the STM32Cube firmware with the FatFs middleware to implement a generic FAT file system using a RAM disk (SDRAM) configuration. It provides a complete workflow for managing files in SDRAM, including mounting, formatting, and performing read/write operations.

    Application Workflow

    The application follows these functional steps using FatFs APIs:

    1. Link the SDRAM disk I/O driver.
    2. Mount: Register the file system object to the FatFs module for the SDRAM drive.
    3. Format: Create a FAT file system on the SDRAM drive.
    4. Write Operation: Create and open a new text file with write access, write data, and close the file.
    5. Read Operation: Open the text file with read access, read the data back, and close the file.
    6. Verification: Check the read data against the original data.

    Status Monitoring (Nucleo-H7A3ZI-Q)

    • LED1 ON: Application running successfully.
    • LED3 ON: An error occurred during execution.

    Configuration

    You can fine-tune FatFs features by modifying the defines in ffconf.h located in the project includes directory.

  3. Overview of USB DFU Standalone Application

    master

    The USB Device Firmware Upgrade (DFU) application allows for programming the embedded Flash memory of an STM32H7 device via the USB peripheral. It is a compliant implementation of the DFU capability.

    Operating Modes

    1. DFU Operating Mode: Entered after an MCU reset if:
      • The user forces DFU mode (e.g., by pressing the TAMP button).
      • No valid code is found in the application area. A code is considered valid if the MSB of the initial Main Stack Pointer (MSP) value at the first address of the application area is 0x20000.
    2. Run-time Application Mode: Normal execution of the loaded application (e.g., the provided LED toggle binary).

    Memory Layout

    The internal flash memory is partitioned as follows:

    • DFU area: Located in [0x08000000 : USBD_DFU_APP_DEFAULT_ADD-1]. This area is Read-only.
    • Application area: Located in [USBD_DFU_APP_DEFAULT_ADD : Device's end address]. This area supports Read, Write, and Erase access.
  4. Overview of the USB HID Standalone Application

    master

    This application demonstrates how to use the USB OTG Device peripheral on STM32H747xx devices to emulate a Human Interface Device (HID), specifically a mouse. On the STM32H747I_Discovery board, it uses mounted joystick buttons to emulate mouse directions.

    Key features include:

    • Dual-Core Operation: The application utilizes both the Cortex-M7 and Cortex-M4 cores. The M7 handles system initialization (clocks, voltage, L1-Cache) and can release the M4 from deep sleep via HSEM notification or D2 Domain wakeup sources.
    • USB Modes: Supports both Full Speed and High Speed (HS) modes. In HS mode, the 60 MHz USB clock is driven by the ULPI.
    • Remote Wake-up: Supports bringing a suspended USB bus back to an active state using the board's Key button as the source.
  5. Overview of OpenAMP Framework

    master

    OpenAMP (Open Asymmetric Multi Processing) is a framework providing software components for developing applications on Asymmetric Multiprocessing (AMP) systems.

    Key capabilities include:

    • Life Cycle Management & Inter-Processor Communication (IPC): Manages remote compute resources and software contexts.
    • Standalone Library: Usable with RTOS and Baremetal environments.
    • Linux Compatibility: Compatible with upstream Linux remoteproc and rpmsg components.
    • Supported Configurations:
      • Linux master / Generic (Baremetal) remote
      • Generic (Baremetal) master / Linux remote
    • Proxy Infrastructure: Allows a master processor to handle printf, scanf, open, close, read, and write calls from Baremetal-based remote contexts.
  6. Overview of USB Host HID Standalone Application

    master

    This application demonstrates how to use the STM32H735XX USB OTG Host peripheral to interact with Human Interface Class (HID) devices, specifically mice and keyboards. The STM32 MCU acts as a HID Host, performing device enumeration and extracting metadata such as VID, PID, manufacturer name, serial number, and product name, which are then displayed via a UART Hyperterminal.

    Key Hardware Details:

    • Target Device: STM32H735XX.
    • Clock Configuration: CPU at 520 MHz, HCLK (D1/D2/D3 domains) at 260 MHz, and APB clocks at 130 MHz.
    • USB Clocking: Full speed mode uses an internal 48-MHz clock from PLL3. High Speed (HS) mode uses a 60 MHz clock driven by the ULPI.
  7. Overview of USB HID Standalone Application

    master

    The USB HID Standalone application demonstrates how to use the STM32H7xx USB OTG Device peripheral to emulate a Human Interface Device (HID), specifically a mouse. The STM32 MCU is enumerated by a PC host using native HID drivers. In this specific implementation for the STM32H7B3I-EVAL board, user push-buttons are used to emulate mouse directions.

    Key features include:

    • Remote Wakeup Support: The ability for the USB device to bring a suspended bus back to an active state, triggered by a User push-button.
    • High-Speed Support: Configurable for either USB High Speed (HS) or USB High Speed OTG IP in Full Speed mode.
    • System Configuration: Uses HAL_Init() for peripheral reset and SystemClock_Config() to set the SYSCLK to 280 MHz.
  8. Overview of the LwIP TFTP Server Application

    master

    The LwIP TFTP Server application is designed for STM32H7xx devices. It allows users to send or receive data between a PC (using a TFTP client like TFTPD32) and a micro SD card installed on the STM32H743xI_EVAL board via Ethernet.

    Key Features

    • TFTP Protocol: Facilitates file transfers over the network.
    • SD Card Integration: Uses a micro SD card as the storage medium.
    • Status Monitoring:
      • LCD Mode: If #define USE_LCD is enabled in main.h, log messages including Ethernet cable status and IP address are displayed on the LCD.
      • LED Mode: If the LCD is not used, status is indicated by LEDs:
        • LED1: Ethernet cable is connected.
        • LED2: Ethernet cable is not connected.
    • DHCP Support: Dynamic IP allocation can be enabled by defining #define LWIP_DHCP in lwipopts.h if a DHCP server is available on the network.

    Technical Constraints

    • Filename Limits: Maximum filename length is 8 bytes, with 3 bytes reserved for file type.
    • Block Size: The maximum transfer block size is set to 512 Bytes.
    • SD Card Requirement: The micro SD card must be plugged in before starting the application; the software does not support hot-plugging/unplugging.
  9. Overview of FreeRTOS Mail Application

    master

    The FreeRTOS Mail application demonstrates how to use mail queues using the CMSIS RTOS API on STM32H750Bxx devices. It implements a producer-consumer model where one thread produces mail (a structure containing three variables: var1 (uint32), var2 (uint32), and var3 (uint8)) and a higher-priority consumer thread receives and frees it.

    Application Behavior:

    • The mail queue has a capacity of one item.
    • The consumer thread is set to block on mail receiving.
    • When the producer posts mail, the consumer preempts the producer, retrieves the mail, and frees it.

    Status Monitoring via LEDs:

    • LED_GREEN: Toggles when mail is successfully produced.
    • LED_RED: Toggles when mail is successfully received.
    • Both LEDs ON: Indicates an error has occurred.

    Verification via LiveWatch: To ensure correct operation, monitor these variables; the consumer values must always match the producer values:

    • ConsumerValue1 == ProducerValue1
    • ConsumerValue2 == ProducerValue2
    • ConsumerValue3 == ProducerValue3
  10. Overview of NUCLEO-H745ZI-Q Dual-Core Demonstration

    master

    This demonstration showcases the dual-core capabilities of the STM32H745ZI device by facilitating communication between the Cortex-M7 and Cortex-M4 cores.

    Core Roles:

    • Cortex-M7 (CPU1): Acts as the primary controller. It manages the system clock, voltage scaling, L1-Cache, and handles the display of BMP images on an Adafruit 1.8" TFT shield (via SD card). It notifies the Cortex-M4 using Hardware Semaphores (HSEM).
    • Cortex-M4 (CPU2): Acts as a secondary processor. It waits for notifications from the Cortex-M7 and responds by toggling LED2.

    Hardware Requirements:

    • Board: STM32 Nucleo-H745ZI-Q.
    • Display: Adafruit 1.8" TFT shield connected to CN7, CN8, CN9, and CN10 Arduino connectors.
    • Storage: A microSD card (up to 4GB) containing specific BMP files.

    Operational Modes:

    1. With TFT Shield: The M7 displays images from the SD card (Manual or Automatic mode) and notifies the M4 to blink LED2 upon each new image.
    2. Without TFT Shield: The M7 toggles LED1 at variable frequencies (controlled by the User button) and notifies the M4 to toggle LED2 at the same frequency.
  11. Overview of the LTDC Paint Application

    master

    The LTDC Paint application demonstrates how to configure an LCD touchscreen, handle touch zone actions, and save BMP pictures to a USB Disk. It serves as a functional example of integrating graphics (LTDC), touch interfaces, and USB Mass Storage on the STM32H743xx platform.

    Key Features

    • Touchscreen Interaction: Configures LCD touch screen and attributes actions to specific touch zones.
    • Drawing Interface: A menu-driven UI featuring a color palette, brush size selection, a working rectangle, and clear/save icons.
    • USB Storage: Ability to save drawn pictures as BMP files to a USB Mass Storage device.
    • Visual Feedback:
      • LED1: Indicates the completion of a save operation.
      • LED3: Indicates that an error has occurred.

    Hardware Requirements

    • Target Device: STM32H743xx.
    • Recommended Board: STM32H743I-EVAL.
    • USB Setup: Connect a USB key to the board using a 'USB micro A-Male to A-Female' cable (HS mode via connector CN14).
  12. Overview of the STM32CubeH7 Firmware Package

    master

    The STM32CubeH7 MCU Firmware Package provides a comprehensive embedded software platform for the STM32H7 series. It includes:

    • CMSIS modules: Core and device modules for the ARM core.
    • STM32 HAL-LL drivers: Hardware Abstraction Layer (HAL) and Low-Layer (LL) drivers for portability.
    • BSP drivers: Board Support Package drivers for specific evaluation, demonstration, or Nucleo boards.
    • Middleware libraries: RTOS, USB, FatFS, graphics, touch sensing, etc.
    • Software projects: Applications, demonstrations, and basic examples organized by board in the Projects/*Board_name* directories.