After spending long time, I made the sample (tower board) code works on our custom board, found that the sample project works fine entering 2Mhz and wait mode and coming out for a keypress . However the project what we created not working, I replace the .c file from sample code to our project it is not working. If I add the sample project to our workspace all working happily. It shows no issue with the board or bsp and psp projects.
There could be a problem with the project we are using, I am not sure what setting could create the problem.
Note: sample code may build with hardfp, if required make change in project setting and in cross ARM Linked change the link path to “softfp” (in my case all other project are built with softfp so I have to change the sample code to work with my other projects)
${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/armv7e-m/softfp/libgcc.a
${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libc.a
${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libsupc++.a
${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libm.a
${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libnosys.a