Motivation
The following statement appears to be true:
The $q$-ary Hamming code of codimension $r$ over $\mathbb{F}_q$ is equivalent to a cyclic code if and only if if $q-1$ and $r$ are coprime.
See for example this answer by Dietrich Burde as a in-house quotation.
The $\Leftarrow$-direction is not too hard to show (making use of a primitive element of the finite field $\mathbb{F}_{q^r}$), but I could not find a proof for the other direction anywhere. I've checked various sources like web search, search on this page math.stackexchange, as well as standard books on coding theory like MacWilliams-Sloane, van Lint or Huffman-Pless.
Question
Assume that $q-1$ and $r$ at not coprime. Show that the $q$-ary Hamming code of codimension $r$ is not equivalent to a cyclic code.
Dietrich Burde pointed me to the book of Huffman & Pless, "Fundamentals of Error-Correcting codes", 2003. I checked this book again, but I cannot find the full desired statement nor a proof. The closest things I can find are:
Theorem 5.1.4 on page 169 shows that for $\gcd(r,q-1) = 1$, the $q$-ary Hamming code of codimension $r$ is a narrow-sense BCH code, which gives "$\Leftarrow$".
Corollary 5.1.5 on page 170 observes that as a consequence, all binary Hamming codes are primitive narrow-sense BCH codes.
Example 5.1.6 shows that the $[4,2,3]$ ternary Hamming code is not cyclic, which is close to this question. Part of the reasoning is left as the subsequent Exercise 288. (In my opinion, the direction proposed by Huffman and Pless using the automorphism group of order $48$ is unnecessarily complicated. Better observe that there are only two cyclic ternary $[4,2]$ codes and their generator polynomials have weight only $2$.)
I certainly did not check the whole book, but I could not find anything else. If the statement indeed was there, I would expect a pointer at Theorem 5.1.4 orExample 4.1.6 to the general statement.