connectivity/bluetooth/bluetooth-ctlr-arch.html · connectivity/bluetooth/bluetooth-ctlr-arch.rst 공식 원문 ↗

Zephyr 3.7.0 · Connectivity · Bluetooth Controller

Bluetooth LE Controller Architecture

Soft real-time ticker와 ISR 계층이 microsecond radio event를 준비하고 실행합니다.

Official pathconnectivity/bluetooth/bluetooth-ctlr-arch.html
Source fileconnectivity/bluetooth/bluetooth-ctlr-arch.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

Part 1

요약·해설

HCI·HAL·Ticker·software Link Layer의 실행 우선순위와 radio event scheduling, data flow, Nordic resource 점유를 공식 도식 22개로 읽습니다.

Timing

Ticker · ULL · LLL

Context

Host thread · Mayfly · ISR

Diagrams

22

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 AB753CEFA142956FFA5A558646D28858B7D81496C4C913C821A123A3D6253D70
.. _bluetooth-ctlr-arch:

LE Controller
#############

Overview
********

.. image:: ../../../../connectivity/bluetooth/img/ctlr_overview.png

#. HCI

   * Host Controller Interface, Bluetooth standard
   * Provides Zephyr Bluetooth HCI Driver

#. HAL

   * Hardware Abstraction Layer
   * Vendor Specific, and Zephyr Driver usage

#. Ticker

   * Soft real time radio/resource scheduling

#. LL_SW

   * Software-based Link Layer implementation
   * States and roles, control procedures, packet controller

#. Util

   * Bare metal memory pool management
   * Queues of variable count, lockless usage
   * FIFO of fixed count, lockless usage
   * Mayfly concept based deferred ISR executions


Architecture
************

Execution Overview
==================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_exec_overview.png


Architecture Overview
=====================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_arch_overview.png


Scheduling
**********

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched.png


Ticker
======

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_ticker.png


Upper Link Layer and Lower Link Layer
=====================================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_ull_lll.png


Scheduling Variants
===================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_variant.png


ULL and LLL Timing
==================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_ull_lll_timing.png


Event Handling
**************

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_event_handling.png


Scheduling Closely Spaced Events
================================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_msc_close_events.png


Aborting Active Event
=====================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_msc_event_abort.png


Cancelling Pending Event
========================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_msc_event_cancel.png


Pre-emption of Active Event
===========================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_sched_msc_event_preempt.png


Data Flow
*********

Transmit Data Flow
==================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_dataflow_tx.png


Receive Data Flow
=================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_dataflow_rx.png


Execution Priorities
********************

.. image:: ../../../../connectivity/bluetooth/img/ctlr_exec_prio.png

- Event handle (0, 1) < Event preparation (2, 3) < Event/Rx done (4) < Tx
  request (5) < Role management (6) < Host (7).

- LLL is vendor ISR, ULL is Mayfly ISR concept, Host is kernel thread.


Lower Link Layer
****************

LLL Execution
=============

.. image:: ../../../../connectivity/bluetooth/img/ctlr_exec_lll.png


LLL Resume
----------

.. image:: ../../../../connectivity/bluetooth/img/ctlr_exec_lll_resume_top.png

.. image:: ../../../../connectivity/bluetooth/img/ctlr_exec_lll_resume_bottom.png


Bare metal utilities
********************

Memory FIFO and Memory Queue
============================

.. image:: ../../../../connectivity/bluetooth/img/ctlr_mfifo_memq.png

Mayfly
======

.. image:: ../../../../connectivity/bluetooth/img/ctlr_mayfly.png


* Mayfly are multi-instance scalable ISR execution contexts
* What a Work is to a Thread, Mayfly is to an ISR
* List of functions executing in ISRs
* Execution priorities map to IRQ priorities
* Facilitate cross execution context scheduling
* Race-to-idle execution
* Lock-less, bare metal

Legacy Controller
*****************

.. image:: ../../../../connectivity/bluetooth/img/ctlr_legacy.png

Bluetooth Low Energy Controller - Vendor Specific Details
*********************************************************

Hardware Requirements
=====================

Nordic Semiconductor
--------------------

The Nordic Semiconductor Bluetooth Low Energy Controller implementation
requires the following hardware peripherals.

.. list-table:: SoC Peripheral Use
   :header-rows: 1
   :widths: 15 15 15 10 50

   * - Resource
     - nRF Peripheral
     - # instances
     - Zephyr Driver Accessible
     - Description
   * - Clock
     - NRF_CLOCK
     - 1
     - Yes
     - * A Low Frequency Clock (LFCLOCK) or sleep clock, for low power
         consumption between Bluetooth radio events
       * A High Frequency Clock (HFCLOCK) or active clock, for high precision
         packet timing and software based transceiver state switching with
         inter-frame space (tIFS) timing inside Bluetooth radio events
   * - RTC [a]_
     - NRF_RTC0
     - 1
     - **No**
     - * Uses 2 capture/compare registers
   * - Timer
     - NRF_TIMER0 or NRF_TIMER4 [1]_, and NRF_TIMER1 [0]_
     - 2 or 1 [1]_
     - **No**
     - * 2 instances, one each for packet timing and tIFS software switching,
         respectively
       * 7 capture/compare registers (3 mandatory, 1 optional for ISR profiling,
         4 for single timer tIFS switching) on first instance
       * 4 capture/compare registers for second instance, if single tIFS timer
         is not used.
   * - PPI [b]_
     - NRF_PPI
     - 21 channels (20 [2]_), and 2 channel groups [3]_
     - Yes [4]_
     - * Used for radio mode switching to achieve tIFS timings, for PA/LNA
         control
   * - DPPI [c]_
     - NRF_DPPI
     -  20 channels, and 2 channel groups [3]_
     - Yes [4]_
     - * Used for radio mode switching to achieve tIFS timings, for PA/LNA
         control
   * - SWI [d]_
     - NRF_SWI4 and NRF_SWI5, or NRF_SWI2 and NRF_SWI3 [5]_
     - 2
     - **No**
     - * 2 instances, for Lower Link Layer and Upper Link Layer Low priority
         execution context
   * - Radio
     - NRF_RADIO
     - 1
     - **No**
     - * 2.4 GHz radio transceiver with multiple radio standards such as 1 Mbps,
         2 Mbps and Coded PHY S2/S8 Long Range Bluetooth Low Energy technology
   * - RNG [e]_
     - NRF_RNG
     - 1
     - Yes
     -
   * - ECB [f]_
     - NRF_ECB
     - 1
     - **No**
     -
   * - CBC-CCM [g]_
     - NRF_CCM
     - 1
     - **No**
     -
   * - AAR [h]_
     - NRF_AAR
     - 1
     - **No**
     -
   * - GPIO [i]_
     - NRF_GPIO
     - 2 GPIO pins for PA and LNA, 1 each
     - Yes
     - * Additionally, 10 Debug GPIO pins (optional)
   * - GPIOTE [j]_
     - NRF_GPIOTE
     - 1
     - Yes
     - * Used for PA/LNA
   * - TEMP [k]_
     - NRF_TEMP
     - 1
     - Yes
     - * For RC sourced LFCLOCK calibration
   * - UART [l]_
     - NRF_UART0
     - 1
     - Yes
     - * For HCI interface in Controller only builds
   * - IPC [m]_
     - NRF_IPC [5]_
     - 1
     - Yes
     - * For HCI interface in Controller only builds


.. [a] Real Time Counter (RTC)
.. [b] Programmable Peripheral Interconnect (PPI)
.. [c] Distributed Programmable Peripheral Interconnect (DPPI)
.. [d] Software Interrupt (SWI)
.. [e] Random Number Generator (RNG)
.. [f] AES Electronic Codebook Mode Encryption (ECB)
.. [g] Cipher Block Chaining (CBC) - Message Authentication Code with Counter
       Mode encryption (CCM)
.. [h] Accelerated Address Resolver (AAR)
.. [i] General Purpose Input Output (GPIO)
.. [j] GPIO tasks and events (GPIOTE)
.. [k] Temperature sensor (TEMP)
.. [l] Universal Asynchronous Receiver Transmitter (UART)
.. [m] Interprocess Communication peripheral (IPC)


.. [0] :kconfig:option:`CONFIG_BT_CTLR_TIFS_HW` ``=n``
.. [1] :kconfig:option:`CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER` ``=y``
.. [2] When not using pre-defined PPI channels
.. [3] For software-based tIFS switching
.. [4] Drivers that use nRFx interfaces
.. [5] For nRF53x Series

Part 3

한국어 전문 번역

LE Controller 개요

Zephyr LE Controller component overview
HCI, HAL, Ticker, software Link Layer와 utility의 Controller 구성.
  1. HCI: Bluetooth 표준 Host Controller Interface이며 Zephyr Bluetooth HCI Driver를 제공합니다.
  2. HAL: Vendor-specific Hardware Abstraction Layer이며 Zephyr Driver를 사용합니다.
  3. Ticker: Soft real-time radio/resource scheduling을 담당합니다.
  4. LL_SW: State·role, control procedure와 packet controller를 구현한 software Link Layer입니다.
  5. Util: Bare-metal memory pool, 가변 개수 lockless queue, 고정 개수 lockless FIFO와 Mayfly 기반 deferred ISR 실행을 제공합니다.

Architecture

Execution overview

Controller execution overview
Host thread, ULL Mayfly와 LLL ISR 실행 흐름.

Architecture overview

Controller architecture overview
HCI부터 ULL·LLL·HAL과 radio까지의 architecture.

Scheduling

Controller scheduling overview
Radio event resource scheduling.

Ticker

Controller ticker scheduling
Ticker의 periodic·one-shot event scheduling.

Upper Link Layer와 Lower Link Layer

ULL and LLL scheduling
ULL 준비와 LLL radio event 실행의 분리.

Scheduling variant

Controller scheduling variants
구성에 따른 scheduling variant.

ULL과 LLL timing

ULL and LLL timing
Event preparation과 radio timing 관계.

Event handling

Controller event handling
Scheduled event의 준비·실행·완료 처리.

가까이 붙은 event scheduling

Closely spaced controller events
시간 간격이 짧은 radio event 처리.

Active event abort

Abort an active controller event
실행 중 event abort sequence.

Pending event cancel

Cancel a pending controller event
대기 event cancel sequence.

Active event pre-emption

Preempt an active controller event
더 높은 우선순위 event가 active event를 pre-empt하는 sequence.

Data flow

Transmit data flow

Controller transmit data flow
Host에서 radio까지 transmit buffer와 completion 흐름.

Receive data flow

Controller receive data flow
Radio에서 Host까지 receive buffer와 event 흐름.

Execution priority

Controller execution priorities
LLL ISR, ULL Mayfly와 Host thread priority.
  • Event handle(0, 1) < event preparation(2, 3) < event/Rx done(4) < Tx request(5) < role management(6) < Host(7).
  • LLL은 vendor ISR, ULL은 Mayfly ISR concept, Host는 kernel thread입니다.

Lower Link Layer

LLL execution

Lower Link Layer execution
LLL radio event execution context.

LLL resume

LLL resume upper sequence
LLL resume sequence 상단.
LLL resume lower sequence
LLL resume sequence 하단.

Bare-metal utility

Memory FIFO와 Memory Queue

Controller memory FIFO and queue
Lockless fixed-count FIFO와 variable-count memory queue.

Mayfly

Controller Mayfly ISR contexts
Cross-context deferred ISR execution을 제공하는 Mayfly.
  • Multi-instance로 확장 가능한 ISR execution context
  • Thread에서 Work가 맡는 역할을 ISR에서는 Mayfly가 담당
  • ISR에서 실행할 function 목록
  • Execution priority를 IRQ priority에 mapping
  • 서로 다른 execution context 사이 scheduling 지원
  • Race-to-idle execution
  • Lockless bare-metal 구현

Legacy Controller

Legacy Bluetooth LE Controller
Legacy Controller architecture.

Vendor-specific hardware requirement

Nordic Semiconductor BLE Controller 구현이 요구하는 peripheral입니다.

ResourcenRF peripheralInstanceZephyr driver 접근설명
ClockNRF_CLOCK1YesRadio event 사이 저전력을 위한 LFCLOCK/sleep clock과 정확한 packet timing 및 event 내부 tIFS software switching을 위한 HFCLOCK/active clock.
RTC [a]NRF_RTC01NoCapture/compare register 2개 사용.
TimerNRF_TIMER0 또는 NRF_TIMER4 [1], NRF_TIMER1 [0]2 또는 1 [1]NoPacket timing과 tIFS software switching에 각각 한 instance. 첫 timer는 capture/compare 7개(필수 3, ISR profiling 선택 1, single-timer tIFS 4), 두 번째 timer는 single tIFS timer를 쓰지 않을 때 4개.
PPI [b]NRF_PPI21 channel(20 [2])과 channel group 2개 [3]Yes [4]tIFS timing을 맞추는 radio mode switching과 PA/LNA control.
DPPI [c]NRF_DPPI20 channel과 channel group 2개 [3]Yes [4]tIFS timing을 맞추는 radio mode switching과 PA/LNA control.
SWI [d]NRF_SWI4+NRF_SWI5 또는 NRF_SWI2+NRF_SWI3 [5]2NoLower Link Layer와 Upper Link Layer low-priority execution context용 2 instance.
RadioNRF_RADIO1No1 Mbps, 2 Mbps와 Coded PHY S2/S8 Long Range BLE를 포함한 multi-standard 2.4 GHz transceiver.
RNG [e]NRF_RNG1YesRandom Number Generator.
ECB [f]NRF_ECB1NoAES Electronic Codebook Mode Encryption.
CBC-CCM [g]NRF_CCM1NoCBC Message Authentication Code with Counter Mode encryption.
AAR [h]NRF_AAR1NoAccelerated Address Resolver.
GPIO [i]NRF_GPIOPA와 LNA용 GPIO pin 각 1개Yes선택 debug GPIO pin 10개 추가 가능.
GPIOTE [j]NRF_GPIOTE1YesPA/LNA에 사용.
TEMP [k]NRF_TEMP1YesRC source LFCLOCK calibration.
UART [l]NRF_UART01YesController-only build의 HCI interface.
IPC [m]NRF_IPC [5]1YesController-only build의 HCI interface.

약어와 조건

  • [a] Real Time Counter (RTC)
  • [b] Programmable Peripheral Interconnect (PPI)
  • [c] Distributed Programmable Peripheral Interconnect (DPPI)
  • [d] Software Interrupt (SWI)
  • [e] Random Number Generator (RNG)
  • [f] AES Electronic Codebook Mode Encryption (ECB)
  • [g] Cipher Block Chaining Message Authentication Code with Counter Mode encryption (CCM)
  • [h] Accelerated Address Resolver (AAR)
  • [i] General Purpose Input Output (GPIO)
  • [j] GPIO tasks and events (GPIOTE)
  • [k] Temperature sensor (TEMP)
  • [l] Universal Asynchronous Receiver Transmitter (UART)
  • [m] Interprocess Communication peripheral (IPC)
  • [0] CONFIG_BT_CTLR_TIFS_HW=n
  • [1] CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y
  • [2] Pre-defined PPI channel을 사용하지 않을 때
  • [3] Software-based tIFS switching용
  • [4] nRFx interface를 사용하는 driver
  • [5] nRF53x Series용

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.