Hi,
Pls refer to the startup_kea128.c, there is Flash_Config array. If you set the last BYTE in the red circle as FE, the flash will be in unsecurity mode, the SWD/JTAG can be accessed. If you set the last BYTE in the red circle as FF, or FD, the flash will be in security mode, the SWD/JTAG can NOT be accessed.
But you can execute mass-erase to set the flash in unsecurity mode.

Because I have not the project based on KEA family, so I use the K64 project, but the Flash_Config array is the same.
Hope it can help you
BR
Xiangjun Rong