Hi Lucian,
You can disable NMI pin function by changing the startup file. Find the following code. So you just need to change the flash configuration byte at 0x40D to 0xFB.
SECTION FlashConfig:CODE
__FlashConfig
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFBFE
__FlashConfig_End
You can find the definition for FOPT which configures this function in Table 6-2. Flash Option Register (FTFA_FOPT) bit definitions.
