I've tried to debug the code and it looks the exception rises when the micro controller execute this line:
I've tried to pass an integer value instead of passing a pointer, the code works just fine. so I guess the problem is with passing the pointer. I'm not that good at C so I'm not sure if my code is correct or not. (the pointers part to be specific).
I've tried to preform the command that you told me about:
Code: Select all
xrun --dumpstate your_binary_here.xe
and here's the result:
Code: Select all
***** Active Cores *****
2 tile[1] core[0] 0xfff004c8 in ?? ()
* 1 tile[0] core[0] 0xfff004c8 in ?? ()
Thread 2 (tile[1] core[0]):
***** Call Stack *****
#0 0xfff004c8 in ?? ()
#1 0xfff00342 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
***** Disassembly *****
0xfff004c8: waiteu (0r) *
0xfff004ca: ldw (ru6) r11, dp[0x5]
0xfff004cc: setc (ru6) res[r11], 0x0 *
0xfff004ce: ldc (ru6) r11, 0x6
0xfff004d0: setc (ru6) res[r11], 0x0 *
***** Registers *****
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x0 0
r4 0x200100 2097408
r5 0x100200 1049088
r6 0x100300 1049344
r7 0x80a 2058
r8 0x0 0
r9 0x10027 65575
r10 0x5 5
r11 0x40b 1035
cp 0x0 0
dp 0xfff01eb0 -1040720
sp 0x7ff7c 524156
lr 0xfff00342 -1047742
pc 0xfff004c8 -1047352
sr 0x41 65
spc 0x0 0
ssr 0x0 0
et 0x0 0
ed 0x0 0
sed 0x0 0
kep 0xfff00400 -1047552
ksp 0x0 0
Thread 1 (tile[0] core[0]):
***** Call Stack *****
#0 0xfff004c8 in ?? ()
#1 0xfff00342 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
***** Disassembly *****
0xfff004c8: waiteu (0r) *
0xfff004ca: ldw (ru6) r11, dp[0x5]
0xfff004cc: setc (ru6) res[r11], 0x0 *
0xfff004ce: ldc (ru6) r11, 0x6
0xfff004d0: setc (ru6) res[r11], 0x0 *
***** Registers *****
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x0 0
r4 0x200100 2097408
r5 0x100200 1049088
r6 0x100300 1049344
r7 0x80a 2058
r8 0x0 0
r9 0x27 39
r10 0x5 5
r11 0x40b 1035
cp 0x0 0
dp 0xfff01eb0 -1040720
sp 0x7ff7c 524156
lr 0xfff00342 -1047742
pc 0xfff004c8 -1047352
sr 0x41 65
spc 0x0 0
ssr 0x0 0
et 0x0 0
ed 0x0 0
sed 0x0 0
kep 0xfff00400 -1047552
ksp 0x0 0
I'm not quiet sure what does this command do, because the pc in my code (according to Xtime composer's dissembler) never exceeded 0x00042630, but here it looks the pc reaches far big numbers.
but what I've found more interesting is what the console window showed me when I debugged the code by the IDE:
Code: Select all
Program stopped at 0x40000.
It stopped with signal SIGTRAP, Trace/breakpoint trap.
Type "info stack" or "info registers" for more information.
mi_cmd_var_create: unable to create variable object
mi_cmd_var_create: unable to create variable object
mi_cmd_var_create: unable to create variable object
the console will keep repeating this phrase "mi_cmd_var_create: unable to create variable object". and this one too: "mi_cmd_var_create: Usage: NAME FRAME EXPRESSION."
it tells me to type "info stack" or "info registers" for more information, so I did, and here's the result, but I'm not quiet sure what does it mean so I'm asking for your help:
Code: Select all
info stack
#0 main_task_1 (frame=0x7fe6c) at ../src/test.xc:101
#1 0x000405d4 in __start_other_cores ()
#2 0x000403d1 in main () at ../src/test.xc:86
info registers
r0 0xc0 192
r1 0x425e0 271840
r2 0x7fbf0 523248
r3 0x104 260
r4 0x7fe6c 523884
r5 0x3 3
r6 0x7fe68 523880
r7 0x10 16
r8 0x0 0
r9 0x0 0
r10 0x40000 262144
r11 0x4046c 263276
cp 0x41fd0 270288
dp 0x425b8 271800
sp 0x7fd98 523672
lr 0x405d4 263636 __start_other_cores + 64
pc 0x40480 263296 main_task_1 + 20
sr 0x100 256
spc 0x0 0
ssr 0x0 0
et 0x0 0
ed 0x0 0
sed 0x0 0
kep 0x40080 262272
ksp 0x0 0
sorry for this long reply.