I need to find the number of invertible elements in $\mathbb{F}_q[X]/\langle X^p-1\rangle$ with $p=\operatorname{char} \mathbb{F}_q$, which is equal to the number of invertible $p\times p$ circulant matrices over $\mathbb{F}_q$.
If $n$ and $q$ are coprime then the number of $n\times n$ invertible circulant matrices over $\mathbb{F}_q$ is calculated, see here. But what if $n$ and $q$ are not coprime (in particular, $n=p=\operatorname{char}\mathbb{F}_q$)? In this case no extension field of $\mathbb{F}_p$ contains a primitive $n$-th root of unity.