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 개요

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

Architecture overview

Scheduling

Ticker

Upper Link Layer와 Lower Link Layer

Scheduling variant

ULL과 LLL timing

Event handling

가까이 붙은 event scheduling

Active event abort

Pending event cancel

Active event pre-emption

Data flow
Transmit data flow

Receive data flow

Execution 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

LLL resume


Bare-metal utility
Memory FIFO와 Memory Queue

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

Vendor-specific hardware requirement
Nordic Semiconductor BLE Controller 구현이 요구하는 peripheral입니다.
| Resource | nRF peripheral | Instance | Zephyr driver 접근 | 설명 |
|---|---|---|---|---|
| Clock | NRF_CLOCK | 1 | Yes | Radio event 사이 저전력을 위한 LFCLOCK/sleep clock과 정확한 packet timing 및 event 내부 tIFS software switching을 위한 HFCLOCK/active clock. |
| RTC [a] | NRF_RTC0 | 1 | No | Capture/compare register 2개 사용. |
| Timer | NRF_TIMER0 또는 NRF_TIMER4 [1], NRF_TIMER1 [0] | 2 또는 1 [1] | No | Packet 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_PPI | 21 channel(20 [2])과 channel group 2개 [3] | Yes [4] | tIFS timing을 맞추는 radio mode switching과 PA/LNA control. |
| DPPI [c] | NRF_DPPI | 20 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] | 2 | No | Lower Link Layer와 Upper Link Layer low-priority execution context용 2 instance. |
| Radio | NRF_RADIO | 1 | No | 1 Mbps, 2 Mbps와 Coded PHY S2/S8 Long Range BLE를 포함한 multi-standard 2.4 GHz transceiver. |
| RNG [e] | NRF_RNG | 1 | Yes | Random Number Generator. |
| ECB [f] | NRF_ECB | 1 | No | AES Electronic Codebook Mode Encryption. |
| CBC-CCM [g] | NRF_CCM | 1 | No | CBC Message Authentication Code with Counter Mode encryption. |
| AAR [h] | NRF_AAR | 1 | No | Accelerated Address Resolver. |
| GPIO [i] | NRF_GPIO | PA와 LNA용 GPIO pin 각 1개 | Yes | 선택 debug GPIO pin 10개 추가 가능. |
| GPIOTE [j] | NRF_GPIOTE | 1 | Yes | PA/LNA에 사용. |
| TEMP [k] | NRF_TEMP | 1 | Yes | RC source LFCLOCK calibration. |
| UART [l] | NRF_UART0 | 1 | Yes | Controller-only build의 HCI interface. |
| IPC [m] | NRF_IPC [5] | 1 | Yes | Controller-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
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.