Previously had the same tasks working OK. When I went to add some functionality, and now I cannot even get the tasks running, osKernelStart() does not complete.
Trying to use the hardfault handler here, it does not complete either.
The instruction that causes the fault is in xPortPendSVHandler :
ldmia.w r0!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
It’s tripping on the second pass to this function after reset. None of the tasks are up yet.
Most of those registers have a5a5a5a5, except r7 which has a valid ram address.
lr has 0x8010185, which oddly is not aligned.
r0 is set to the end of RAM. 0x20018000 - which looks wrong. But my assembly is rusty.
Can anyone suggest what I’m looking for to fix this?
PendSV_Handler:
08010150: mrs r0, PSP
08010154: isb sy
08010158: ldr r3, [pc, #84] ; (0x80101b0 <PendSV_Handler+96>)
0801015a: ldr r2, [r3, #0]
0801015c: tst.w lr, #16
08010160: it eq
08010162: vstmdbeq r0!, {s16-s31}
08010166: stmdb r0!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
0801016a: str r0, [r2, #0]
0801016c: stmdb sp!, {r0, r3}
08010170: mov.w r0, #80 ; 0x50
08010174: msr BASEPRI, r0
08010178: dsb sy
0801017c: isb sy
08010180: bl 0x800e990 <vTaskSwitchContext>
08010184: mov.w r0, #0
08010188: msr BASEPRI, r0
0801018c: pop {r0, r3}
0801018e: ldr r1, [r3, #0]
08010190: ldr r0, [r1, #0]
08010192: ldmia.w r0!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}