Sample code for Target Nuvoton m2351 for writing to registers

i am trying to to configure a pin as gpio which is by default assigned for tamper0 en. i will have to modify the register value for to disable this default functionality. whenever i try to do so by writing to registers the program halts its execution .is there any specific method to modify register values in mbed.

my target is nuvoton m2351 kiaae.