Deep Dive into Broadcom/Cypress CYW20719 Bluetooth 5.2 Controller: Configuring Extended Advertising and LE Audio via HCI Vendor Commands

The Broadcom (now Infineon/Cypress) CYW20719 is a highly integrated Bluetooth 5.2 controller that has become a cornerstone for advanced audio and data applications. While the chip supports standard Bluetooth Core Specification features, its true power for professional developers lies in the extensive set of HCI (Host Controller Interface) vendor-specific commands. These commands allow fine-grained control over extended advertising, LE Audio codec configurations, and the implementation of profiles like the Public Broadcast Profile (PBP) and Telephony and Media Audio Profile (TMAP). This article provides a technical deep dive into configuring these features using the CYW20719’s vendor HCI commands, with a focus on real-world performance considerations and protocol-level details.

Understanding the CYW20719 Architecture for LE Audio

The CYW20719 integrates a dedicated audio processing subsystem alongside the Bluetooth link layer. This is critical for LE Audio, which relies on the LC3 codec and Isochronous Channels (CIS/BIS). The chip supports both Connection-Oriented (CIS) and Broadcast (BIS) isochronous streams. To leverage these, developers must first configure the controller’s advertising and scanning modes, then set up the audio paths via vendor commands.

Key architectural features include:

  • Dual-core ARM Cortex-M4 and M0+: The M4 handles HCI and application logic, while the M0+ manages the Bluetooth link layer timing, ensuring deterministic isochronous scheduling.
  • Dedicated PCM/I2S interface: For direct connection to audio codecs, with configurable sample rates (8, 16, 32, 44.1, 48 kHz) and bit depths (16/24).
  • Internal LC3 encoder/decoder: Hardware acceleration for LC3, reducing CPU load on the host MCU.

Configuring Extended Advertising for PBP and TMAP

The Public Broadcast Profile (PBP) v1.0.2 (as referenced) defines how a Broadcast Source uses extended advertising data (AD) to signal that it is transmitting broadcast audio streams. Similarly, TMAP v1.0.1 defines telephony and media audio configurations. Both profiles require precise control of advertising data and scan response data.

Standard HCI commands (e.g., LE Set Extended Advertising Parameters) are used for basic setup, but the CYW20719 provides vendor-specific commands to fine-tune the advertising interval, channel map, and data fragmentation. For example, to configure a periodic advertising train for BIS (Broadcast Isochronous Stream) synchronization, the following sequence is typical:

// Step 1: Set extended advertising parameters (standard HCI)
HCI_LE_Set_Extended_Advertising_Parameters(
    Advertising_Handle: 0x00,
    Advertising_Event_Properties: 0x0013, // Connectable, Scannable, Legacy
    Primary_Advertising_Interval_Min: 0x0800, // 1280 ms (for PBP recommend 100-150 ms)
    Primary_Advertising_Interval_Max: 0x0A00, // 1600 ms
    Primary_Advertising_Channel_Map: 0x07, // All three channels
    Own_Address_Type: 0x00,
    Peer_Address_Type: 0x00,
    Peer_Address: [0x00, ...],
    Advertising_Filter_Policy: 0x00,
    Advertising_Tx_Power: 0x7F,
    Primary_Advertising_PHY: 0x01, // 1M PHY
    Secondary_Advertising_Max_Skip: 0x00,
    Secondary_Advertising_PHY: 0x02, // 2M PHY
    Advertising_SID: 0x01,
    Scan_Request_Notification_Enable: 0x00
);

// Step 2: Set advertising data (including PBP/TMAP AD types)
// PBP requires AD type 0x2B (Broadcast Audio Announcement)
// TMAP requires AD type 0x2C (TMAP Role)
uint8_t adv_data[] = {
    0x02, 0x01, 0x06, // Flags: LE General Discoverable, BR/EDR Not Supported
    0x03, 0x2B, 0x01, 0x00, // Broadcast Audio Announcement (PBP): 1 stream, codec ID 0x00 (LC3)
    0x04, 0x2C, 0x01, 0x01, 0x00 // TMAP Role: Unicast Server (0x01) and Broadcast Source (0x00)
};

// Step 3: Vendor command to set extended advertising data with fragmentation
// CYW20719 specific: HCI_VS_Set_Extended_Advertising_Data
uint8_t vs_cmd[] = {
    0x00, // Opcode Group: Vendor (0x3F)
    0x00, // Opcode Command: 0x0000 (example, actual varies by firmware)
    0x01, // Advertising Handle
    0x01, // Operation: 0x01 (Complete extended advertising data)
    0x00, // Fragment Preference: 0x00 (May fragment)
    sizeof(adv_data), // Data Length
    // ... adv_data bytes
};

Performance Consideration: The CYW20719 supports a maximum of 1650 bytes of extended advertising data per set. For PBP, the Broadcast Audio Announcement AD type typically requires 3-6 bytes per stream. When multiple streams are present (e.g., stereo + metadata), careful packing is required to avoid fragmentation delays. The vendor-specific fragmentation preference byte allows the host to request that the controller avoid fragmentation (set to 0x01) for critical data, though this may cause the advertisement to be skipped if the data exceeds the available LE Advertising Channel PDU size (typically 255 bytes for secondary channels).

LE Audio Configuration via Vendor HCI Commands

Once advertising is set up, the next step is to configure the LE Audio codec and isochronous channels. The CYW20719 provides vendor commands for LC3 codec configuration, including bitrate, frame duration, and channel count. These commands are not part of the standard Bluetooth HCI but are documented in the Cypress WICED SDK.

For a Broadcast Source (BIS), the typical flow is:

  • Create a Broadcast Isochronous Group (BIG): Using standard HCI LE Create BIG command, specifying the SDU interval (e.g., 10000 µs for 10 ms LC3 frames), maximum SDU size (e.g., 40 bytes for 48 kbps stereo), and channel count.
  • Configure the LC3 encoder: Via vendor command HCI_VS_Configure_LC3_Encoder, setting sample rate (48000 Hz), bitrate (96000 bps for high quality), and frame duration (10000 µs).
  • Set up the audio path: Use HCI_VS_Set_Audio_Route to map the I2S input to the BIS stream.
// Example: Configure LC3 encoder for stereo broadcast
// Vendor command (opcode 0xFC12, example)
uint8_t lc3_cfg[] = {
    0x12, 0xFC, // Opcode (little-endian)
    0x0A,       // Parameter total length
    0x00,       // Codec ID (LC3)
    0x80, 0xBB, 0x00, 0x00, // Bitrate: 48000 bps (little-endian)
    0x10, 0x27, // Frame duration: 10000 µs (little-endian)
    0x02,       // Channels: 2 (stereo)
    0x01        // Sample rate: 48000 Hz (0x01 = 48k, 0x00 = 16k, etc.)
};

// Send via HCI
HCI_Send_Vendor_Command(lc3_cfg, sizeof(lc3_cfg));

Protocol Detail: The CYW20719’s LC3 encoder supports a dynamic bitrate adjustment feature. By sending a vendor command mid-stream, the host can change the bitrate without restarting the isochronous channel. This is useful for adaptive audio quality based on RF conditions. However, the SDU size must remain within the pre-negotiated maximum; otherwise, the controller will truncate the packet, causing audio artifacts.

Implementing PBP and TMAP Roles

The PBP v1.0.2 specification (as shown in the reference) requires that a Broadcast Source uses the Broadcast Audio Announcement AD type to indicate the number of streams and codec configuration. The CYW20719 can be programmed to automatically populate these fields from the BIG configuration. Using a vendor command HCI_VS_Set_PBP_Announcement, the controller can be instructed to read the current BIG parameters and generate the appropriate AD data.

For TMAP v1.0.1, the role (Unicast Server, Unicast Client, Broadcast Source, Broadcast Sink) must be advertised. The CYW20719 supports a vendor command to set the TMAP role in the scan response data, allowing a remote device to discover the device’s capabilities without establishing a connection. This is crucial for Telephony and Media Audio Profile interoperability, where a phone (Unicast Client) may scan for headsets (Unicast Server) with specific TMAP roles.

// Example: Set TMAP role in scan response data
// Vendor command HCI_VS_Set_TMAP_Role (opcode 0xFC20)
uint8_t tmap_role[] = {
    0x20, 0xFC, // Opcode
    0x03,       // Parameter length
    0x01,       // Role: Unicast Server (0x01)
    0x00,       // Subrole: Call Gateway (0x00) or Media Gateway (0x01)
    0x01        // Number of concurrent streams: 1
};

Performance Analysis and Tuning

When deploying CYW20719-based devices for LE Audio, several performance factors must be considered:

  • Isochronous Latency: The CYW20719 can achieve sub-10 ms end-to-end latency for BIS streams when using the 2M PHY and proper scheduling. However, the host must ensure that audio data is delivered to the controller within the SDU interval. Using a dedicated I2S DMA path can reduce jitter.
  • Advertising Overhead: Extended advertising with periodic advertising trains (PAST) for BIS synchronization consumes air time. For PBP, the recommended advertising interval is 100-150 ms to balance discoverability and power consumption. The CYW20719’s vendor command HCI_VS_Set_Advertising_Interval allows microsecond-level granularity, enabling fine-tuning.
  • Codec Quality: The LC3 encoder at 96 kbps stereo (48 kHz) provides near-transparent audio quality. However, the CYW20719’s internal LC3 implementation has a fixed-point arithmetic that may introduce quantization noise at very low bitrates (e.g., 16 kbps mono). Testing with the vendor’s diagnostic commands (HCI_VS_Get_LC3_SNR) can verify performance.

Example Tuning for Broadcast Audio:

// Adjust BIG synchronization timeout to 200 ms for robust reception
HCI_LE_Create_BIG(
    BIG_Handle: 0x01,
    Advertising_Handle: 0x00,
    Num_BIS: 2,
    SDU_Interval: 10000,
    Maximum_SDU_Size: 40,
    Maximum_Transport_Latency: 10,
    RTN: 2, // Retransmission number
    PHY: 0x02 // 2M PHY
);

Conclusion

The Broadcom/Cypress CYW20719 Bluetooth 5.2 controller offers a powerful platform for implementing advanced LE Audio features like PBP and TMAP. By leveraging its vendor-specific HCI commands, developers can achieve fine-grained control over extended advertising, LC3 codec configuration, and isochronous channel management. The key to success lies in understanding the interplay between standard HCI commands and vendor extensions, as well as careful performance tuning for latency, power, and audio quality. As the Bluetooth SIG continues to update profiles (e.g., PBP v1.0.2 and TMAP v1.0.1), the CYW20719’s firmware can be updated to support new AD types and roles, making it a future-proof choice for professional audio applications.

Note: All vendor command opcodes and parameter formats in this article are illustrative and based on typical Cypress WICED SDK documentation. Developers should consult the latest CYW20719 firmware release notes for exact command definitions.

常见问题解答

问: What are the key architectural features of the CYW20719 that support LE Audio?

答: The CYW20719 integrates a dual-core ARM Cortex-M4 and M0+ processor, where the M4 handles HCI and application logic while the M0+ manages Bluetooth link layer timing for deterministic isochronous scheduling. It also includes a dedicated PCM/I2S interface for direct audio codec connections with configurable sample rates and bit depths, as well as an internal hardware-accelerated LC3 encoder/decoder to reduce host MCU load.

问: How do vendor-specific HCI commands enhance extended advertising configuration for profiles like PBP and TMAP on the CYW20719?

答: Standard HCI commands provide basic extended advertising setup, but vendor-specific commands on the CYW20719 allow fine-grained control over advertising interval, channel map, and data fragmentation. This enables precise configuration of periodic advertising trains for Broadcast Isochronous Stream (BIS) synchronization, which is essential for implementing profiles such as the Public Broadcast Profile (PBP) and Telephony and Media Audio Profile (TMAP).

问: What is the role of isochronous channels in LE Audio on the CYW20719, and how are they configured?

答: LE Audio relies on Isochronous Channels, specifically Connection-Oriented (CIS) and Broadcast (BIS) streams, to deliver synchronized audio data. On the CYW20719, developers must first configure advertising and scanning modes using standard HCI commands, then set up audio paths via vendor-specific commands that control the dedicated audio processing subsystem and isochronous scheduling managed by the M0+ core.

问: Can you provide an example of a vendor-specific HCI command sequence for configuring extended advertising on the CYW20719?

答: A typical sequence starts with standard HCI commands like `HCI_LE_Set_Extended_Advertising_Parameters` to set parameters such as advertising handle and event properties. For example, setting `Advertising_Handle: 0x00` and `Advertising_Event_Properties: 0x0013` enables connectable and scannable extended advertising. Vendor-specific commands then allow further tuning of the advertising interval, channel map, and data fragmentation for specific profile requirements like BIS synchronization.

💬 欢迎到论坛参与讨论: 点击这里分享您的见解或提问


Login