Skip to content

Hexagon DSP outputs debug information

In the non-Standalone mode of Qualcomm’s Hexagon DSP, using printf in the DSP kernel file cannot output messages on the terminal. You can use the FARF function to output debugging information by following the steps below.

Redirect DSP FARF messages to ADB logcat by creating a farf file.

adb shell echo "0x1f > /vendor/lib/rfsa/dsp/sdk/your_app_name.farf"

Launch a new CLI shell to view the DSP’s diagnostic messages via logcat.

adb logcat -s adsprpc

Include the following header files and use the FARF functions to output information from the DSP.

#include "HAP_farf.h"
#include "HAP_debug.h"
#include "AEEStdErr.h"
#include "HAP_perf.h"

FARF(RUNTIME_LOW,"Run-time Low FARF message");
FARF(RUNTIME_MEDIUM,"Run-time Medium FARF message");
FARF(RUNTIME_HIGH,"Run-time High FARF message");
FARF(RUNTIME_ERROR,"Run-time Error FARF message");
FARF(RUNTIME_FATAL,"Run-time Fatal FARF message");

Compile and run the program, and the output debugging information will be displayed in the previously opened CLI shell.

Leave a Reply