STM32CubeF1 MCU Firmware Package

repository·master·Indexed 20 days ago

https://github.com/stmicroelectronics/stm32cubef1

A complete software ecosystem for STM32F1 series microcontrollers. It includes HAL/LL drivers, CMSIS modules (Core, DAP, Driver, DSP, NN, RTOS), BSP drivers for boards like NUCLEO-F103RB and STM3210C-EVAL, and middleware libraries for USB, FatFS, and FreeRTOS. The package provides a set of basic examples, applications, and demonstrations to reduce development effort.

Tokens
128.1K
Snippets
130
Records
655
Agent score
68%

What's inside STM32CubeF1

  1. Overview of USB Host HID RTOS Example

    master

    This example demonstrates how to use the STM32F105x/107x USB OTG Host peripheral to interact with USB Human Interface Devices (HID), specifically mice and keyboards, within an RTOS environment (FreeRTOS with CMSIS-OS).

    Key Features

    • Device Enumeration: Automatically detects connected HID devices and extracts VID, PID, manufacturer name, serial number, and product name.
    • Mouse Support: Moving a mouse moves a pointer on the LCD; button presses highlight rectangles in blue.
    • Keyboard Support: Tapped characters are displayed on the LCD.
    • RTOS Integration: Uses a normal priority thread to execute the HID routine.
    • User Interface: A menu allows users to start HID applications or re-enumerate the device using joystick buttons.
  2. Overview of the USB Device Mass Storage (MSC) Standalone Example

    master

    The MSC Standalone example demonstrates how to use the STM32F1xx USB Device peripheral to act as a Mass Storage Class (MSC) device. It communicates with a PC Host using Bulk Only Transfer (BOT) and SCSI transparent commands, using a microSD card as the storage media.

    When running, the STM32 MCU is enumerated by the PC Host as a standard removable drive, allowing standard read, write, and format operations.

  3. Overview of the USB Host HID Standalone Example

    master

    This example demonstrates how to use the STM32F105x/107x USB OTG Host peripheral to interact with USB Human Interface Devices (HID), specifically mice and keyboards.

    When a device is connected, the STM32 MCU acts as a HID Host, performing enumeration and extracting device metadata such as:

    • VID (Vendor ID)
    • PID (Product ID)
    • Manufacturer name
    • Serial number
    • Product name

    This information is displayed on the LCD screen. The application provides a menu to switch between different HID modes (Mouse or Keyboard) or to re-enumerate the device.

  4. Overview of I2C One-Board Communication (IT Mode)

    master

    This example demonstrates how an I2C Master device can receive a single data byte from an I2C Slave device using a single STM32F103RB-Nucleo board. Both the Master and Slave peripherals operate in Interrupt (IT) mode.

    Key characteristics:

    • Peripherals: Uses LL (Low-Layer) unitary service functions for optimized performance and size.
    • Master Configuration: I2C1 is configured in Master mode (400kHz clock).
    • Slave Configuration: I2C2 is configured in Slave mode (400kHz clock, 7-bit address enabled).
    • Trigger: A user push-button (linked via EXTI) initiates the Master's Start condition.
    • Feedback:
      • LED2 is ON: Data was successfully received.
      • LED2 blinks: An error occurred during communication.
  5. Overview of the FatFs with uSD card drive example

    master

    This example demonstrates how to use the STM32Cube firmware with the FatFs middleware component as a generic FAT file system module. It specifically implements a microSD drive configuration to perform file operations such as writing and reading text files.

    Key Workflow:

    1. Initialization: Calls HAL_Init() to reset peripherals and initialize Flash/SysTick, followed by SystemClock_Config() to set the system clock (SYSCLK) to 72 MHz.
    2. File Operations: Uses FatFs APIs to:
      • Link the uSD disk I/O driver.
      • Mount the file system object.
      • Format the uSD drive (create FAT file system).
      • Create, open, write to, and close a text file.
      • Open, read from, and close the same text file.
      • Unlink the uSD disk I/O driver.
    3. Error Handling: The application manages errors occurring during FAT volume access via FatFs APIs.

    Hardware Support:

    • Target Device: STM32F103xG
    • Tested Board: STM3210E-EVAL RevD
  6. Overview of the USB HID Standalone Example

    master

    This example demonstrates how to use the STM32F105x/107x USB OTG Device peripheral to emulate a Human Interface Device (HID), specifically a mouse. The STM32 MCU is enumerated by the PC host using native HID drivers. In the provided STM3210C-EVAL implementation, joystick buttons on the board are used to emulate mouse directions.

    Key technical details:

    • Clock Configuration: The system clock (SYSCLK) is configured to 72 MHz. The Full Speed (FS) USB module uses an internal 48-MHz clock generated from an integrated PLL.
    • Remote Wakeup: The example supports remote wakeup (the ability of a USB device to wake a suspended bus). The 'Key' button on the board serves as the remote wakeup source.
    • Target Hardware: Designed for STM32F107xx/STM32F105xx devices, specifically tested on STM3210C-EVAL RevC.
  7. Overview of USB Host Mass Storage (MSC) RTOS Example

    master

    This application demonstrates how to use the USB Host Mass Storage Class (MSC) on STM32F105x/107x devices using an RTOS configuration. It utilizes the USB OTG Host peripheral to interact with a USB flash disk using Bulk Only Transfer (BOT) and SCSI commands, integrated with the FatFs middleware for file system operations.

    Key features include:

    • Device Enumeration: Automatically detects connected USB flash disks and extracts VID, PID, manufacturer name, serial number, and product name.
    • File Operations: Ability to write small text files (< 1 KB) to the disk.
    • Disk Explorer: Ability to explore and display the USB flash disk content on an LCD screen.
    • RTOS Integration: Built around FreeRTOS and the CMSIS-OS wrapping layer.
  8. Overview of the USB Device Custom HID example

    master

    The Custom HID Standalone example demonstrates how to use the STM32F1xx USB Device peripheral to implement a HID (Human Interface Device) compliant device. The STM32 MCU is enumerated by the PC host using native HID drivers.

    In this specific implementation:

    • The STM3210C-EVAL board is used as the target hardware.
    • The system clock (SYSCLK) is configured to 72 MHz.
    • The Full Speed (FS) USB module uses an internal 48-MHz clock generated from an integrated PLL.
    • Data is transferred to the PC host via endpoint1 IN (e.g., ADC values from a potentiometer).
    • Control commands (e.g., LED control) are received from the PC via SET_REPORT or SET_FEATURE requests.
  9. Overview of USB Host Mass Storage (MSC) Standalone Example

    master

    This example demonstrates how to use the STM32F105x/107x USB OTG Host peripheral to operate a USB flash disk. It utilizes the Bulk Only Transfer (BOT) and SCSI transparent commands in conjunction with the FatFs middleware component.

    Key Features:

    • Device Enumeration: Automatically detects connected USB flash disks and extracts VID, PID, manufacturer name, serial number, and product name.
    • File Operations: Includes routines to write and read small text files (< 1 KB) on the USB disk.
    • Disk Exploration: Provides a routine to explore the USB flash disk content (up to 2 levels of recursion) and display it on an LCD.
    • Re-Enumeration: Allows the user to trigger a new enumeration of the connected device.

    Hardware Requirements:

    • Target: STM32F107xx or STM32F105xx devices.
    • Recommended Board: STM3210C-EVAL RevC.
    • Connection: Plug the USB key into the board via a 'USB micro A-Male to A-Female' cable connected to the CN2 connector.
  10. Overview of the Templates_LL project

    master

    The Templates_LL project is a reference template designed to help developers build firmware applications using the STM32 Low-Layer (LL) API.

    What is provided:

    • Inclusion of all LL drivers (via main.h and IDE configuration).
    • Definitions for LEDs and user buttons (in main.h).
    • System clock configuration (in main.c).

    What is NOT provided:

    • Initialization or control functions for LEDs and user buttons.
    • Interrupt handler (IRQ) management for the user button.

    Target Hardware:

    • Designed for STM32F107xC devices.
    • Tested with the STM3210C-EVAL RevC board.
  11. Overview of STM32CubeF1 MCU Firmware Package

    master

    The STM32CubeF1 MCU Firmware Package is a comprehensive embedded software platform designed for the STM32F1 series microcontrollers. It provides a complete ecosystem to reduce development effort, including:

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

    Note on Unavailable Middleware: Due to restrictive licensing, the ./Middlewares/ST/STemWin library and associated projects are not included in this repository. To access them, you must download the full firmware package from st.com.

  12. Overview of USB Host CDC Standalone Example

    master

    This example demonstrates how to use the STM32F10x USB OTG Host peripheral to operate with a USB CDC (Communication Device Class) device. It supports dynamic serial configuration and two-way data transfer:

    • Transmission: The Host selects a file from an SD card via a menu and sends its content to the USB Device. Data to be transmitted is stored in the CDC_TX_Buffer.
    • Reception: Data entered via a Hyperterminal (in ASCII format) is transferred from the Device to the Host and displayed on the Host's LCD screen. Data is stored in the CDC_RX_Buffer.

    Upon startup, the Host enumerates the connected device and extracts metadata including VID, PID, manufacturer name, serial number, and product name, which are displayed on the LCD.