STM32F1 - AMBA & DMA

Created:2018-02-09  Last modified:2018-02-09


  1. Introduction

    Bus are used in computing device for transferring data. The bus can be used inside a core, inside a Soc, or externally to connect other peripherals.

    Cortex-M3 interfaces

    The cortex-M3 core has the 3 AHB-Lite bus interfaces for I-Code, D-code, system buses, and 2 APB buses, PPB and DAP, for debugging.

    1. The three buses along with the DMA bus are connects to a bus matrix as masters.
    2. I-code, D-code can only access memory from 0x00000000 to 0x1FFFFFFF.
    3. Prefetch is always fetch 4 byte (1 word) even if it is 16-bit Thumb. In this case, it pre-fetch two. (mov r0, pc will affect the real pc by a positive offset of 4)
    4. System bus can access 0x20000000 to 0xdfffffff and 0xE0100000 to 0xFFFFFFFF. In the slave side of the bus matrix, it connects two APB bridges that extends two APB bus for connecting peripherals.
    5. The external PPB (privatep peripheral bus) can access 0xe0040000 to 0xe00fffff. It connects the Trace Port interface unit and vendor specific peripherals.
    6. DAP bus connects debug interface blocks such as SWJ-DP or SW_DP.

    Inside a STM32F1

    STM32F1's system bus (AHB-lite) connects to two APB buses for on-chip peripherals.

    1. APB1 (low speed peripherals, up to 32MHz)
    2. APB2 (high speed peripherals, up to 72MHz)
    3. STM32 blocks
    4. A general cortex-M3 microcontroller block
  2. AMBA

    Advanced Microcontroller Bus Architecture is a on-chip interconnect bus standard. It defines a set of bus standard used by SoC and ASIC (application-specific IC)

    History

    1. 1996, AMBA introduced ASB (Advanced System Bus) and APB (Advanced Peripheral Bus)
    2. 1999, AMBA2 added AHB (Advanced High-performace Bus)

    * The new AMBA is AMBA 5

  3. Bus clock

    Different from AVR 8-bit microcontroller, STM32 Bus's clock can be configured independently. [see clock note]

    In the perspective of core, buses are just peripherals. Peripheral may need drivers. For example, a PC bus, such as PCI, also needs a driver. But the AMR AHB-Lite and APB do not require.