In such a way it works. But when I insert chThdSleepMilliseconds() function it hangs up at the location of the very first entry of that function.
LED and Light work.
Fixed ADC signal indices. Buck works.