"Debug access is locked" message popped up while programming custom C application.
RM126x module ships with a debug lock configuration to protect the module from readback to protect its security keys. We don’t really broadcast the secure nature of the bootloader and the application because we don’t want to publicize it to hackers and vulnerability scalpers.
If you want to write your own firmware, you need to enable debug, which will erase the part. Note you also need to create your own bootloader if you are writing your own code, the RM126x bootloader also implements some of the security mechanisms.
Refer to the link below for how to do this using Simplicity Studio.
https://community.silabs.com/s/question/0D58Y00008z2ZLTSA2/how-unlock-efr32bg12-using-jlink-commander?language=en_US