Hello Dinesh,
In the case of your hardfault, it could be caused by a variety of situations. Ranging from illegal use of funcitons/pointers/variables, not initiating proper clocks, trying to access memory that is not accessable, etc.
You mention that it goes into hardfault after executing AMCLIB_PMSMBemfObsrvAB_F16(). If this is true, can you place a breakpoint on the line after and it will stop there. Or does it go into a hardfault during the execution of that function.
I would recommend to step through each step, to better locate where it actually goes into the hardfault.
For further reference in debugging hardfaults you can refer to Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse.
Best Regards,
Sabina