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.
Could you confirm that the CM0+ code and CM4 code are being executed from different logical bank addresses?
Can you please provide the CPU registers (Core Fault register) values?
What is value in FLASHC_CM0_STATUS and FLASHC_CM4_STATUS ?