Arm Mbed OS Documentation

repository·master·Indexed 26 days ago

https://github.com/armmbed/mbed-os

An open-source embedded operating system optimized for Arm Cortex-M microcontrollers. It provides essential IoT features including security, connectivity, and an RTOS. The documentation covers the CMSIS directory structure, cellular connectivity APIs and debugging, 802.15.4 RF drivers (Atmel, MCR20A, STM S2-LP), and BLE HCI drivers for BlueNRG-2 and BlueNRG-MS, including hardware configuration and firmware update procedures for various expansion boards and Nordic platforms.

Tokens
91.5K
Snippets
187
Records
485
Agent score
89%

What's inside Mbed OS

  1. Overview of TDBStore

    master

    TDBStore (Tiny Database Storage) is a lightweight module for storing data on flash storage. It belongs to the KVStore class family and provides a get/set interface. It is optimized for speed, reduced flash wear, minimal storage overhead, and power-failure resilience.

    Requirement: TDBStore assumes the underlying block device is fully dedicated to it (starting at offset 0). To use only a portion of a device, you must use a sliced block device, typically via SlicingBlockDevice.

  2. Overview of Mbed OS

    master
    Arm Mbed OS is an open source embedded operating system designed for Internet of Things (IoT) applications. It is built for Arm Cortex-M microcontrollers and provides a platform including security foundations, cloud management services, an RTOS, and drivers for sensors, I/O devices, and connectivity.
  3. Overview of MTB CAT1A Peripheral Driver Library (PDL)

    master

    The MTB CAT1A Peripheral Driver Library (PDL) is designed for the PSoC 6 (or CAT1A) family of devices. It simplifies software development by providing a single package that integrates device header files, startup code, and peripheral drivers. The drivers abstract hardware functions into easy-to-use APIs, reducing the need for direct register and bit structure manipulation.

    Key Features:

    • Standard set of PSoC 6 digital and analog peripheral drivers for rapid development in third-party IDEs.
    • CMSIS core access header files and CMSIS-compliant device header files.
    • Startup code (platform initialization) and device configuration header files.
    • Fully compatible with the ModusToolbox™ software environment.

    Compatibility Note: This version is compatible with ModusToolbox but is not compatible with PSoC Creator.

  4. Overview of the Cordio BLE Link Layer Implementation

    master

    The Cordio link layer implementation provides a complete, Bluetooth 5 compliant BLE stack for Cordio licensees using Mbed OS. It enables vendors to deliver up-to-date BLE functionality by integrating a specific HCI driver for their hardware.

    The library includes:

    • Controller HCI
    • Bluetooth 5 compliant link layer protocol core
    • Scheduler
    • Baseband porting layer
    • Portable software foundation
  5. Overview of littlefs filesystem

    master

    littlefs is a fail-safe filesystem designed specifically for microcontrollers. Key features include:

    • Power-loss resilience: Uses strong copy-on-write guarantees to ensure the filesystem falls back to the last known good state if power is lost during operations.
    • Dynamic wear leveling: Designed for flash memory, providing wear leveling over dynamic blocks and the ability to detect and work around bad blocks.
    • Bounded RAM/ROM: RAM usage is strictly bounded and does not increase as the filesystem grows. It avoids unbounded recursion and can use static buffers to avoid dynamic memory allocation.

    It is written in C and requires a compiler that conforms to the C99 standard.

  6. Overview of Mbed OS Build Tools

    master

    The tools/ directory contains the Python-based tooling used to build Mbed OS and Mbed 2. These tools power the Mbed CLI commands for compiling, exporting, detecting targets, and managing devices. Key functional areas include:

    • Build Operations: make.py (implements mbed compile), build.py (implements mbed compile --library), and build_api.py (full-project builds).
    • Target & Device Management: detect_targets.py (implements mbed detect) and device_management.py (implements mbed device-management).
    • Project Exporting: project.py (implements mbed export) and the export directory for export plugins.
    • Configuration: The config directory implements the Mbed Config System, while get_config.py implements mbed compile --config.
    • Testing: tests.py (implements mbed test --greentea) and run_icetea.py (implements mbed test --icetea).
    • Analysis & Debugging: memap.py (map file parser), debug_tools (crash log parsing), and flash_algo (CMSIS flash algorithm parser).
  7. Overview of littlefs

    master

    littlefs is a fail-safe filesystem designed specifically for embedded systems with the following characteristics:

    • Bounded RAM/ROM: Designed for limited memory. It avoids recursion and uses configurable buffers that can be provided statically to limit dynamic memory usage.
    • Power-loss resilience: Uses strong copy-on-write guarantees to ensure storage remains in a valid state even after random power failures.
    • Wear leveling: Provides dynamic wear leveling for erodible flash memories, making it suitable for systems without a full flash translation layer.
  8. Overview of littlefs design requirements

    master

    littlefs is a fail-safe filesystem designed specifically for microcontrollers. It is engineered to address the constraints of embedded systems, such as 32-bit microcontrollers with limited RAM (e.g., 32 KiB) and ROM (e.g., 512 KiB) paired with SPI NOR flash.

    To be effective in these environments, littlefs meets three core requirements:

    1. Power-loss resilience: The filesystem is designed to recover from a power loss during any write operation, preventing data corruption that could render a device unrecoverable.
    2. Wear leveling: It manages flash wear by preventing repeated writes to the same blocks, which is critical for extending the life of flash storage.
    3. Bounded RAM/ROM:
      • ROM: The design is kept simple to minimize code size.
      • RAM: All RAM usage is bounded, meaning memory consumption does not grow as the filesystem size or the number of files increases.
  9. Overview of BlueNRG_MS BLE components

    master

    The BlueNRG_MS driver provides an HCI interface for BlueNRG-MS BLE components using the ARM Cordio stack. Supported modules and their status include:

    • SPBTLE-RF (BlueNRG-MS): Bluetooth v4.1. Not recommended for new designs. Used in X-NUCLEO-IDB05A1, DISCO-L475VG-IOT01A, and DISCO-L562QE.
    • BlueNRG-M0 (BlueNRG-MS): Bluetooth v4.2. Active (ST Longevity Program). Used in X-NUCLEO-BNRG02A2.
    • BlueNRG-M2SP (BlueNRG-2): Bluetooth v5.0. Active (ST Longevity Program). Used in X-NUCLEO-BNRG2A1.
  10. Understand STM32 Sleep and Deepsleep modes

    master

    Mbed OS sleep modes map to specific STM32 hardware states:

    • MBED sleep: Maps to ST SLEEP mode. The CPU clock is off, but peripherals can run and wake the CPU via interrupts.
    • MBED deepsleep: Maps to ST STOP2 mode. All clocks in the VCORE domain are stopped (PLL, MSI, HSI, HSE are disabled). LSI, LSE, and the RTC can remain active.

    Note: The debug profile disables deepsleep. You can also prevent deepsleep in your application using sleep_manager_lock_deep_sleep().