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.
Alice_Yang_0-1739355544294.png
Configuration as below:
Alice_Yang_2-1739355687940.png
Additionally, you need to add an external crystal oscillator to your hardware board.
Hope it helps.
BR
Alice