Hello, I have made some progress on the 3DS hosted port. I am currently replacing all SDL code with libctru calls, so the app wont depend on SDL.
Rockbox with SDL threads is working fine. But I wanted to try the native ARM thread implementation.
The app runs but I am getting the following segfault:
luma3ds_exception_dump_parser dumps/crash_dump_00000082.dmp
Processor: Arm11 (core 0)
Exception type: data abort
Fault status: Translation - Page
Current process: 3dsx_app (000400000d921e00)
Register dump:
r0 00433854 r1 00000000
r2 21545624 r3 00000000
r4 00155838 r5 00433780
r6 004337bc r7 004341a0
r8 00000000 r9 00000000
r10 00000000 r11 00000000
r12 00000000 sp 00000000
lr 0016045c pc 00155838
cpsr 200f0010 dfsr 00000807
ifsr 0000100f far fffffff8
fpexc 40000700 fpinst eefc7bc6
fpinst2 eefc7bc6
FAR fffffff8 Access type: Write
Code dump:
1557dc: e59f204c ldr r2, [pc, #76] @ 0x155830
1557e0: e58d3004 str r3, [sp, #4]
1557e4: e1a00007 mov r0, r7
1557e8: eb024c08 bl 0x1e8810
1557ec: e5943000 ldr r3, [r4]
1557f0: e1a02005 mov r2, r5
1557f4: e5933014 ldr r3, [r3, #20]
1557f8: e1a01005 mov r1, r5
1557fc: e59f0030 ldr r0, [pc, #48] @ 0x155834
155800: e5847178 str r7, [r4, #376] @ 0x178
155804: eb0006e7 bl 0x1573a8
155808: e594318c ldr r3, [r4, #396] @ 0x18c
15580c: e0800080 add r0, r0, r0, lsl #1
155810: e0800006 add r0, r0, r6
155814: e1530000 cmp r3, r0
155818: a584518c strge r5, [r4, #396] @ 0x18c
15581c: aaffffd4 bge 0x155774
155820: e3a09000 mov r9, #0
155824: eaffffd3 b 0x155778
155828: 003ff868 eorseq pc, pc, r8, ror #16
15582c: 00222a8c eoreq r2, r2, r12, lsl #21
155830: 00221380 eoreq r1, r2, r0, lsl #7
155834: 00222aa0 eoreq r2, r2, r0, lsr #21
155838: e92d4080 push {r7, lr}
Stack dump:
The app crashes at firmware/scroll_engine.c line 183. Exactly at the beggining of the scroll_thread function.
Does any rockbox dev have an idea of what is causing this? And would be any advantage from using the native thread implementation rather than the SDL one?
FYI, the only change I made to the native thread code was replacing ldmiane with ldmneia in firmware/asm/arm/thread.c, since it won't compile otherwise.
Best.