I am erasing the specific sections of Code flash and I get a Hard Fault error. But when I execute the erase operation from main it works fine, but I get error when I execute from Free RTOS task. Also when I execute erase operation in step by step with debugger, the erase operation works fine. The behaviour is quite strange could you help me with some leads. I erase in Non Blocking mode.