Skip to content

Commit b607b3f

Browse files
paresh-bhagat12cshilwant
authored andcommitted
feat(linux): AM62DX: Add doc for 2D FFT DSP offload demo
Add doc for 2D FFT offload demo. This demo offloads test data for 2D FFT processing from Linux user space to C7x. Signed-off-by: Paresh Bhagat <[email protected]>
1 parent 4e2f608 commit b607b3f

File tree

5 files changed

+258
-0
lines changed

5 files changed

+258
-0
lines changed

configs/AM62DX/AM62DX_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@ linux/How_to_Guides/Hardware_Setup_with_CCS/AM62Dx_EVM_Hardware_Setup
8686

8787
linux/Demo_User_Guides/index_Demos
8888
linux/Demo_User_Guides/AM62D_Dsp_Offload_User_Guide
89+
linux/Demo_User_Guides/AM62D_2DFFT_User_Guide
8990

9091
linux/Documentation_Tarball
117 KB
Loading
13.6 KB
Loading
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
.. _AM62D-2dfft-dsp-offload-from-linux-user-guide:
2+
3+
###################################
4+
AM62D 2D FFT DSP offload from Linux
5+
###################################
6+
7+
********
8+
Overview
9+
********
10+
11+
This guide describes how to set up, build, and run the 2D Fast Fourier Transform (FFT)
12+
Digital Signal Processing (DSP) offload example by using the Texas Instruments
13+
Audio AM62D evaluation module (EVM). This demo example shows how to offload 2D
14+
Fast Fourier Transform (FFT) computation to the C7x DSP from Linux user-space.
15+
The input is a 128x128 complex matrix, and the output is the 2D FFT transformed
16+
data in the same format.
17+
18+
Below figure shows how this demo works:
19+
20+
.. figure:: /images/AM62D_2DFFT_DSP_offload_Demo.png
21+
:height: 450
22+
:width: 1000
23+
24+
- Step 1: Read test data
25+
- The 2D FFT offload example application reads the 128x128 matrix binary
26+
test data from SD card.
27+
28+
- Step 2: Copy data to shared Direct Memory Access (DMA) Buffer (DDR)
29+
- Copies input data to a shared DMA buffer located in DDR memory.
30+
31+
- Step 3: Notify DSP using RPMsg (IPC)
32+
- A53 sends a control message via RPMsg (Remote Processor Messaging) to
33+
the C7x core. This message informs the C7x that 2D FFT test input data
34+
is available for processing in the shared DDR buffer.
35+
36+
- Step 4: C7x reads from shared DMA Buffer into L2 Static Random Access Memory (SRAM)
37+
- The C7x DSP copies the input data from the DMA buffer (DDR) into its local
38+
L2 SRAM for processing. This operation minimizes access latency compared
39+
to reading directly from DDR and performs 2D FFT computation on C7x.
40+
41+
- Step 5:2D FFT computation on DSP
42+
- Below figure shows 2D FFT computation on C7x.
43+
44+
.. figure:: /images/fft_2d_signal_chain.png
45+
:height: 140
46+
:width: 1000
47+
48+
- 1D Batched FFT: C7x performs the first 1D FFT on the rows.
49+
- Matrix Transpose: The system transposes the data matrix to convert columns to
50+
rows and vice versa. Because as per design, FFTLIB libraries to perform FFT
51+
on 1D data in rows format.
52+
- 1D Batched FFT: C7x performs the second 1D FFT on the column data.
53+
- During processing, the C7x moves data between L2SRAM (lower latency, lower
54+
capacity) and DDR (higher capacity, higher latency) to use memory efficiently.
55+
56+
- Step 6: Processed data copied back to shared DMA Buffer (DDR)
57+
- Once DSP processing is complete, the C7x copies the output (2D FFT transformed data)
58+
back into the shared DMA buffer.
59+
- C7x sends a control message via RPMsg to the A53 core, informing it that
60+
processed output data is available in the shared DDR buffer.
61+
62+
- Step 7: A53 reads back processed data from DMA buffer
63+
- A53 copies the processed data from the shared buffer for validation.
64+
65+
- Step 8: Validation and Performance Reporting
66+
- The application compares the output data against expected results to verify correctness.
67+
- The system displays performance metrics:
68+
- DSP Load (%)
69+
- Cycle Count
70+
- DDR Throughput (MB/s)
71+
72+
**********************
73+
Hardware prerequisites
74+
**********************
75+
76+
- `AM62D-EVM <https://www.ti.com/tool/AUDIO-AM62D-EVM>`__
77+
- Secure Digital (SD) card (minimum 16GB)
78+
- Universal Serial Bus (USB) Type-C 20W power supply (make sure to use type-C to type-C cable)
79+
- USB to Universal asynchronous receiver-transmitter (UART) cable for console access
80+
- PC (Windows or Linux) to flash image onto an SD Card
81+
- Host PC Requirements:
82+
83+
- Operating system:
84+
85+
- Windows: |__WINDOWS_SUPPORTED_LONG__|
86+
- Ubuntu: |__LINUX_UBUNTU_VERSION_LONG__|
87+
88+
- Memory: Minimum 4GB RAM (8GB or more recommended)
89+
- Storage: At least 10GB of free space
90+
91+
******************
92+
Software and tools
93+
******************
94+
95+
- TI Processor SDK Linux RT (AM62Dx)
96+
- MCU+SDK for AM62Dx
97+
- `C7000-CGT <https://www.ti.com/tool/C7000-CGT#downloads>`__ compiler
98+
- `Code Composer Studio <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62DX/11_00_00_16/exports/docs/api_guide_am62dx/CCS_PROJECTS_PAGE.html>`__
99+
- `TI Clang Compiler Toolchain <https://www.ti.com/tool/download/ARM-CGT-CLANG>`__
100+
- CMake, GCC, make, git, scp, minicom
101+
- `rpmsg-dma library <https://github.com/TexasInstruments/rpmsg-dma/tree/scarthgap>`__
102+
103+
*********
104+
EVM setup
105+
*********
106+
107+
#. Cable Connections
108+
109+
- The figure below shows some important cable connections, ports and switches.
110+
- Take note of the location of the "BOOTMODE" switch for SD card boot mode.
111+
112+
.. figure:: /images/AM62D_evm_setup.png
113+
:height: 600
114+
:width: 1000
115+
116+
#. Setup UART Terminal
117+
118+
- First identify the UART port as enumerated on the host machine.
119+
- Connect the EVM and UART cable to the UART to USB port as shown in cable
120+
connections.
121+
- In Windows, you can use the "Device Manager" to see the detected UART ports:
122+
123+
- Search "Device Manager" in Windows Search Box in the Windows taskbar.
124+
125+
- If you do not see any USB serial ports listed in "Device Manager" under
126+
"Ports (COM & LPT)", then make sure you have installed the UART to USB
127+
driver from `FTDI <https://www.ftdichip.com/drivers>`__.
128+
- For A53 Linux console, select UART boot port (ex: COM34 in below screenshot),
129+
keep other options to default and set 115200 baud rate.
130+
131+
#. Setup SD card Boot Mode
132+
133+
- EVM SD card boot mode setting:
134+
135+
- BOOTMODE [ 8 : 15 ] (SW3) = 0100 0000
136+
- BOOTMODE [ 0 : 7 ] (SW2) = 1100 0010
137+
138+
*****************************************
139+
Steps to validate 2D FFT DSP offload demo
140+
*****************************************
141+
142+
#. Flash an SD card with the :file:`tisdk-default-image-rt-am62dxx-evm.rootfs.wic.xz`
143+
image and follow the instructions provided at :ref:`Create SD Card <processor-sdk-linux-create-sd-card>` guide.
144+
145+
#. Insert the flashed SD card into the `AUDIO-AM62D-EVM <https://www.ti.com/tool/AUDIO-AM62D-EVM>`__
146+
and power on the TI AUDIO-AM62D-EVM.
147+
148+
#. Make sure the EVM boot mode switches are positioned for SD card boot as
149+
described earlier.
150+
151+
#. Connect the USB-C cable from the power adapter to one of the two USB-C
152+
ports on the EVM.
153+
154+
#. The EVM should boot and the booting progress should display in the serial
155+
port console. At the end of booting, the Arago login prompt will appear.
156+
Just enter "root" to log in.
157+
158+
#. Run the 2D FFT DSP offload demo application from the console:
159+
160+
.. code-block:: console
161+
162+
root@am62dxx-evm:~# rpmsg_2dfft_example
163+
164+
#. The application will execute and display the results:
165+
166+
.. code-block:: console
167+
168+
RPMsg based 2D FFT Offload Example
169+
170+
*****************************************
171+
*****************************************
172+
173+
C7x 2DFFT Test PASSED
174+
C7x Load: 1%
175+
C7x Cycle Count: 327000
176+
C7x DDR Throughput: 0.801656 MB/s
177+
178+
*****************************************
179+
*****************************************
180+
181+
.. note::
182+
183+
The test reports "PASSED" if the computed 2D FFT output matches the
184+
expected results within tolerance (0.01), otherwise it reports "FAILED".
185+
186+
Demo output interpretation
187+
==========================
188+
189+
The demo provides the following performance metrics:
190+
191+
- **Test Result**: PASSED or FAILED based on output validation
192+
- **C7x Load**: DSP utilization percentage during FFT computation
193+
- **C7x Cycle Count**: Number of DSP cycles consumed for the operation
194+
- **C7x DDR Throughput**: Data transfer rate to/from DDR memory in MB/s
195+
196+
************************************
197+
How to build 2D FFT DSP offload demo
198+
************************************
199+
200+
Building 2D FFT DSP offload image from yocto
201+
============================================
202+
203+
- To build the 2D FFT DSP offload image, refer :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>`
204+
205+
Building the linux demo binary from sources
206+
===========================================
207+
208+
#. The source code for the 2D FFT DSP offload demo is available as part of
209+
the `rpmsg-dma <https://github.com/TexasInstruments/rpmsg-dma/tree/scarthgap>`__.
210+
211+
.. code-block:: console
212+
213+
host# git clone https://github.com/TexasInstruments/rpmsg-dma.git -b scarthgap
214+
215+
#. Download and Install the AM62D Linux SDK from |__SDK_DOWNLOAD_URL__| following
216+
the steps mentioned at :ref:`Download and Install the SDK <download-and-install-sdk>`.
217+
218+
#. Prepare the environment for cross compilation.
219+
220+
.. code-block:: console
221+
222+
host# source <path to linux installer>/linux-devkit/environment-setup
223+
224+
#. Compile the source:
225+
226+
.. code-block:: console
227+
228+
[linux-devkit]:> cd <path to rpmsg-dma source>
229+
[linux-devkit]:> cmake -S . -B build; cmake --build build
230+
231+
- This command builds:
232+
233+
- The example application :file:`rpmsg_2dfft_example`
234+
235+
- Transfer the generated files to SD card:
236+
237+
- The example binary :file:`rpmsg_2dfft_example` to :file:`/usr/bin`
238+
- The test input data file :file:`2dfft_input_data.bin` to :file:`/usr/share/2dfft_test_data/`
239+
- The expected output data file :file:`2dfft_expected_output_data.bin` to :file:`/usr/share/2dfft_test_data/`
240+
- The C7 DSP firmware file :file:`fft2d_linux_dsp_offload_example.c75ss0-0.release.strip.out` to :file:`/lib/firmware/`
241+
242+
- Optional:
243+
244+
- To build only the library or only the example, use:
245+
246+
.. code-block:: console
247+
248+
cmake -S . -B build -DBUILD_LIB=OFF # disables library build
249+
cmake -S . -B build -DBUILD_AUDIO_OFFLOAD_EXAMPLE=OFF # disables audio_offload example build
250+
cmake -S . -B build -DBUILD_2DFFT_OFFLOAD_EXAMPLE=OFF # disables 2dfft_offload example build
251+
252+
Building the C7 firmware from sources
253+
=====================================
254+
255+
- Refer to the `MCU+ SDK Documentation <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62DX/11_02_00_20/exports/docs/api_guide_am62dx/GETTING_STARTED_BUILD.html>`__
256+
- Refer to the `C7x TISP Linux 2D FFT Offload Example <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62DX/11_02_00_20/exports/docs/api_guide_am62dx/EXAMPLES_TISP_FFT2D_LINUX_DSP_OFFLOAD.html>`__

source/linux/Demo_User_Guides/index_Demos.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The SDK supports the following Out-Of-Box demo-applications
1717
Display_Cluster_User_Guide
1818
TI_LVGL_Demo_User_Guide
1919
AM62D_Dsp_Offload_User_Guide.rst
20+
AM62D_2DFFT_User_Guide.rst
2021

2122
.. ifconfig:: CONFIG_sdk in ('j7_foundational')
2223

0 commit comments

Comments
 (0)