Skip to content

Commit 31153aa

Browse files
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 7546fe4 commit 31153aa

File tree

5 files changed

+265
-0
lines changed

5 files changed

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