Cypress MCU strucks in Hard Fault Handler
Piece of your code would definitely help. You need a hard fault handler that will explain you what happened.
Follow this guide.

Most of the time hard faults are caused by:


Accessing a wrong address in memory (eg. writing to flash or reading non-existent address) - technically this is a bus fault and has a separate handler, but is escalated to hard fault when not handled. This can be caused by your code or your linker script
Trying to execute data as code (wild pointers, invalid functions pointers, stack overflow)
Accessing a peripheral that has its clock disabled


An RTOS can also cause some funky memory issues.

When looking at the handler the most important variable is the stacked program counter (PC). It tells you the exact instruction that caused the problem on a Cortex-M0 (M4 may need disabling of the memory write buffer, otherwise the hard fault can be imprecise).