A branch clock is switched on, following the procedure described in the User's Manual.
The bits RUN asnd AUTO are set in the CFG register, followed by a polling on the RUN bit in the respective STAT register.
To switch on the clock, the AUTO bit is not required, but it's a nice feature when afterwards the clock is switched off.
An endless while loop is maybe not the best way to write such a code.
Regards,
Bernhard.