Is there any way to execute the program from ram and then pass the control to flash in run time.
Yes, there is.