This example demonstrates the functionality of Bluetooth® Classic Advanced Audio Distribution Profile (A2DP) Source and Audio/Video Remote Control Profile (AVRCP) on the CM33 project. It utilizes SBC (Low Complexity Subband Coding) encoding of audio data in the PSOC™ Edge MCU.
In this example, CM33 retrieves raw PCM audio data from a raw WAV file stored in flash. The raw audio data is then encoded using SBC. The encoded data is sent to an external A2DP Sink device, such as a Bluetooth® speaker, to play the pre-recorded audio stored in the PSOC™ Edge MCU.
This code example has a three-project structure: CM33 secure, CM33 non-secure, and CM55 projects. All three projects are programmed to the external QSPI flash and executed in Execute in Place (XIP) mode. Extended boot launches the CM33 secure project from a fixed location in the external flash, which then configures the protection settings and launches the CM33 non-secure application. Additionally, CM33 non-secure application enables the CM55 CPU and launches the CM55 application.
Provide feedback on this code example.
See the Design and implementation for the functional description of this code example.
- ModusToolbox™ v3.7 or later (tested with v3.7)
- Board support package (BSP) minimum required version: 1.0.0
- Programming language: C
- Associated parts: All PSOC™ Edge MCU parts
- GNU Arm® Embedded Compiler v14.2.1 (
GCC_ARM) – Default value ofTOOLCHAIN - Arm® Compiler v6.22 (
ARM) - IAR C/C++ Compiler v9.50.2 (
IAR) - LLVM Embedded Toolchain for Arm® v19.1.5 (
LLVM_ARM)
Note: This code example does not support the LLVM_ARM toolchain in Release mode.
- PSOC™ Edge E84 Evaluation Kit (
KIT_PSE84_EVAL_EPC2) – Default value ofTARGET - PSOC™ Edge E84 Evaluation Kit (
KIT_PSE84_EVAL_EPC4)
This example uses the board's default configuration. See the kit user guide to ensure that the board is configured correctly.
Ensure the following jumper and pin configuration on board.
- BOOT SW must be in the HIGH/ON position
- J20 and J21 must be in the tristate/not connected (NC) position
See the ModusToolbox™ tools package installation guide for information about installing and configuring the tools package.
Install a terminal emulator if you do not have one. Instructions in this document use Tera Term.
This example requires no additional software or tools.
See Using the code example for instructions on creating a project, opening it in various supported IDEs, and performing tasks, such as building, programming, and debugging the application within the respective IDEs.
-
Connect the board to your PC using the provided USB cable through the KitProg3 USB connector
-
Open a terminal program and select the KitProg3 COM port. Set the serial port parameters to 8N1 and 115200 baud
-
After programming, the application starts automatically and displays the CE title "PSOC EDGE MCU: A2DP Source + AVRCP". It scans and lists Bluetooth® A2DP sink devices, and prints their Bluetooth® Device Addresses (BDAs) after loading the Bluetooth® Stack and initializing the background tasks
The blue LED (USER LED3) starts blinking to indicate that advertisement has started -
Press the respective device number in the serial terminal. The device will connect and display the following output. The blue LED (USER LED3) stays ON indicating that the device has been connected
Figure 2. Terminal output after connecting to A2DP sink device

-
If the desired device is not listed during the initial scan, press "y"/"Y" for rescanning
Figure 3. Terminal output after scanning, no A2DP sink devices listed

Note: If you are facing issues pairing with the A2DP sink device, press and hold the user button (SW2) and press the reset button (XRES) for clearing the bonding keys. Once the keys are cleared, it displays the following output. After resetting the bonding keys, reset the kit.
Figure 4. Terminal output after clearing bonding keys
-
If the connection is successful, you can control the audio playback using A2DP sink device's (speaker or headphones) play/pause button and volume control buttons and it displays the output as per the following:
Figure 5. Terminal play/pause and volume control

The following functions can be used in this example:
- Press "Play/Pause" to play or pause the audio playback
- Press volume "+" to increase the volume
- Press volume "-" to decrease the volume
-
Pressing the user button (SW2) also controls the play/pause function of the playback
| Resources | Links |
|---|---|
| Application notes | AN235935 – Getting started with PSOC™ Edge E8 MCU on ModusToolbox™ software AN236697 – Getting started with PSOC™ MCU and AIROC™ Connectivity devices |
| Code examples | Using ModusToolbox™ on GitHub |
| Device documentation | PSOC™ Edge MCU datasheets PSOC™ Edge MCU reference manuals |
| Development kits | Select your kits from the Evaluation board finder |
| Libraries | mtb-dsl-pse8xxgp – Device support library for PSE8XXGP retarget-io – Utility library to retarget STDIO messages to a UART port btstack-integration – The btstack-integration hosts platform adaptation layer (porting layer) between AIROC™ BTSTACK and Infineon's different hardware platforms kv-store – This library provides a convenient way to store information as key-value pairs in non-volatile storage |
| Tools | ModusToolbox™ – ModusToolbox™ software is a collection of easy-to-use libraries and tools enabling rapid development with Infineon MCUs for applications ranging from wireless and cloud-connected systems, edge AI/ML, embedded sense and control, to wired USB connectivity using PSOC™ Industrial/IoT MCUs, AIROC™ Wi-Fi and Bluetooth® connectivity devices, XMC™ Industrial MCUs, and EZ-USB™/EZ-PD™ wired connectivity controllers. ModusToolbox™ incorporates a comprehensive set of BSPs, HAL, libraries, configuration tools, and provides support for industry-standard IDEs to fast-track your embedded application development |
Infineon provides a wealth of data at www.infineon.com to help you select the right device, and quickly and effectively integrate it into your design.
Document title: CE242107 – PSOC™ Edge MCU: Bluetooth® Classic A2DP Source with AVRCP
| Version | Description of change |
|---|---|
| 1.x.0 | New code example Early access release |
| 2.0.0 | GitHub release |
| 2.1.0 | Updated design files to fix ModusToolbox™ v3.7 build warnings |
All referenced product or service names and trademarks are the property of their respective owners.
The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc., and any use of such marks by Infineon is under license.
PSOC™, formerly known as PSoC™, is a trademark of Infineon Technologies. Any references to PSoC™ in this document or others shall be deemed to refer to PSOC™.
© Cypress Semiconductor Corporation, 2023-2026. This document is the property of Cypress Semiconductor Corporation, an Infineon Technologies company, and its affiliates ("Cypress"). This document, including any software or firmware included or referenced in this document ("Software"), is owned by Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress's patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited.
TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. No computing device can be absolutely secure. Therefore, despite security measures implemented in Cypress hardware or software products, Cypress shall have no liability arising out of any security breach, such as unauthorized access to or use of a Cypress product. CYPRESS DOES NOT REPRESENT, WARRANT, OR GUARANTEE THAT CYPRESS PRODUCTS, OR SYSTEMS CREATED USING CYPRESS PRODUCTS, WILL BE FREE FROM CORRUPTION, ATTACK, VIRUSES, INTERFERENCE, HACKING, DATA LOSS OR THEFT, OR OTHER SECURITY INTRUSION (collectively, "Security Breach"). Cypress disclaims any liability relating to any Security Breach, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from any Security Breach. In addition, the products described in these materials may contain design defects or errors known as errata which may cause the product to deviate from published specifications. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. "High-Risk Device" means any device or system whose failure could cause personal injury, death, or property damage. Examples of High-Risk Devices are weapons, nuclear installations, surgical implants, and other medical devices. "Critical Component" means any component of a High-Risk Device whose failure to perform can be reasonably expected to cause, directly or indirectly, the failure of the High-Risk Device, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from any use of a Cypress product as a Critical Component in a High-Risk Device. You shall indemnify and hold Cypress, including its affiliates, and its directors, officers, employees, agents, distributors, and assigns harmless from and against all claims, costs, damages, and expenses, arising out of any claim, including claims for product liability, personal injury or death, or property damage arising from any use of a Cypress product as a Critical Component in a High-Risk Device. Cypress products are not intended or authorized for use as a Critical Component in any High-Risk Device except to the limited extent that (i) Cypress's published data sheet for the product explicitly states Cypress has qualified the product for use in a specific High-Risk Device, or (ii) Cypress has given you advance written authorization to use the product as a Critical Component in the specific High-Risk Device and you have signed a separate indemnification agreement.
Cypress, the Cypress logo, and combinations thereof, ModusToolbox, PSoC, CAPSENSE, EZ-USB, F-RAM, and TRAVEO are trademarks or registered trademarks of Cypress or a subsidiary of Cypress in the United States or in other countries. For a more complete list of Cypress trademarks, visit www.infineon.com. Other names and brands may be claimed as property of their respective owners.

