Declaring largish arrays causes the hexagonn run-time image to crash (return -1) or worse, lock up the embedded system!
Q1. Are there any known issues re the Windows hexagon SDK re declaration of large arrays on the hexagon (in c)
Q2. Is this expected behaviour due to hexagon (QDSP6V5) architectural limitations?
For example, add the highlighted code, following, to ...\examples\common\calculator\src\calculator_imp.c:
int int_array[0xA000]; // Note int is 32-bits
int calculator_sum(const int* vec, int vecLen, int64* res) {
int ii = 0;
*res = 0;
for(ii = 0; ii < vecLen; ++ii) {
*res = *res + vec[ii];
}
for (uint32 index = 0; index < sizeof(int_array)/sizeof(int); index++) {
*res += int_array[index];
}
FARF(HIGH, "=============== DSP: sum result %lld ===============", *res);
return 0;
}
Then perfrom (assumes signature set, etc):
make tree V=hexagonv5_Debug_dynamic
make tree V=android_Debug
adb root
adb wait-for-device
adb remount
adb push "android_Debug\\calculator" "//data//"
adb shell chmod 777 "//data//calculator"
adb push "android_Debug\\libcalculator.so" "//system//lib"
adb shell mkdir -p "//system//lib//rfsa"
adb shell mkdir -p "//system/lib//rfsa//adsp"
adb push "hexagonv5_Debug_dynamic\\libcalculator_skel.so" "//system//lib//rfsa//adsp"
adb shell "//data//calculator 22 0 0 0 1000"
Result:
- starting calculator test
- allocate 4000 bytes from heapid 22 with flags 0x0
- creating sequence of numbers from 0 to 999
- compute sum on the aDSP
Error: compute on aDSP failed
System: DragonBoard APQ8074
Hexagon SDK 1.1.0 on WinXp (hexagon-cpp (Sourcery QuIC Lite 5.0-432) 4.4.0)
Update.
I've updated to SDK 1.2.2 and the problem still occurs for Release and Debug buillds. Now the APQ8074 dragonboard no longer locks up when the hexagon app dies, which is a little less frustrating....
Have you solved this? I am facing same problem.
Please guide me.
Hi Mr.32,
I've upgraded to SDK 1.2.2. It does not solve the problem.
UPDATE: Modified calculator app still fails using SDK 1.2.2.
Here's how to replicate the problem:
Above code (modified calculator app) works (for me) with:
int int_array[0x9FA0];
Map file (libcalculator_skel.so.map) extarct:
int int_array[0x9FA1];
Map file extract (note *fill):
I've posted details re testing with SDK 1.2.2.
Due to lengthy post it needs approval....