In simple terms: I am trying to setup a timer/counter clocked by an external source. The device is SAMR30-Xplained Pro and RIOT is the OS.
In a bit more detail: I am trying to get a gclk generator (e.g 6) to connect to a timer/counter (e.g TC4), and hooking up the generator to a GCLK_IO (PA22) as clock source. Only the generator 0 is active and makes the timers count, but other generators aren't even starting, even though I try to enable them. Here is my code.
Would anyone know what is going on here? Is RIOT disabling them somehow?
You shouldn't have to configure the GCLKs manually.
Setting
.gclk_src
in thetimer_config
struct inperiph_conf.h
should be enough. The GCLK is then enabled automatically by RIOT when you configure the timer.