Hello Chiranjeev N,
this is additional information.
The dis-assemble of the code "S214008B9004B0BDE8F08E602934D07029F8D1019871" is as below.
00000000 <foo>:
0: b004 add sp, #16
2: e8bd 8ef0 ldmia.w sp!, {r4, r5, r6, r7, r9, sl, fp, pc}
6: 2960 cmp r1, #96 ; 0x60
8: d034 beq.n 74 <foo+0x74>
a: 2970 cmp r1, #112 ; 0x70
c: d1f8 bne.n 0 <foo>
e: 9801 ldr r0, [sp, #4]
According to the code, I guess that the hard fault had happened by un-initialized stack pointer or stack overflow.
Best regards,
Yasuhiko Koumoto.