Hello @ravicha
Do you want to choose System oscillator (OSC32KCLK) as ERCLK32K? If so, you need to configure the external crystal oscillator or an external source. Checking from your code and the Clock Configuration view, it hasn't been configured.
Configuration as below:
Additionally, you need to add an external crystal oscillator to your hardware board.
Hope it helps.
BR
Alice