Free modules over a tensor product, bis Let $\Bbb Z_p$ be the ring of $p$-adic numbers. 
Let $S \subset M_2(\Bbb Z_p)$ be a subring which is an integral domain and such that $S \cong \Bbb Z^2$ as abelian group and $S$ strictly contains the ring of diagonal matrices $\Bbb Z \,id \subset M_2(\Bbb Z_p)$.
This endows $\Bbb Z_p^2$ with a structure of a $(\Bbb Z_p,S)$-bimodule.
Is it true that $\Bbb Z_p^2$ is free of rank $1$ over $\Bbb Z_p \otimes_{\Bbb Z} S$ ?
My previous question shows it is not true under more general hypothesis.
Thank you!
 A: My answer to the previous question still applies: $S$ could be a subring of $\mathbb{Z}_p$, in which case the answer is no.  Specifically, if $d$ is an integer that has no square root in $\mathbb{Z}$ but has a square root in $\mathbb{Z}_p$, then $S=\mathbb{Z}[\sqrt{d}]$ is a subring of $\mathbb{Z}_p$ that is isomorphic to $\mathbb{Z}^2$ as an abelian group.
Even if you additionally assume that $S$ is not a subring of $\mathbb{Z}_p$ (i.e., it is not contained in the scalar matrices), then the answer is no.  For instance, let $A=\begin{pmatrix} 0 & p \\ p^2 & 0\end{pmatrix}$ and let $S$ be the subring of $M_2(\mathbb{Z}_p)$ generated by $A$.  Since $A^2=p^3$ this subring is isomorphic to $\mathbb{Z}[\sqrt{p^3}]$ and in particular has $\{1,A\}$ as a basis over $\mathbb{Z}$.  However, $\mathbb{Z}_p^2$ is not cyclic as a $\mathbb{Z}_p\otimes_\mathbb{Z} S$-module, since $A$ is $0$ mod $p$ and so the submodule generated by any element of $\mathbb{Z}_p^2$ has dimension at most $1$ when you reduce mod $p$.
In general, we can choose a basis for $S$ of the form $\{1,A\}$ for some matrix $A=\begin{pmatrix} a & b \\ c & d\end{pmatrix}$.  Then $\{1,A\}$ is a basis for $\mathbb{Z}_p\otimes_\mathbb{Z} S$ over $\mathbb{Z}_p$, so $\mathbb{Z}_p^2$ is free of rank $1$ over $\mathbb{Z}_p\otimes_\mathbb{Z} S$ iff there exists $v=(x,y)\in\mathbb{Z}_p^2$ such that $\{v,Av\}$ is a basis for $\mathbb{Z}_p^2$ over $\mathbb{Z}_p$.  We have $Av=(ax+by,cx+dy)$, and so $\{v,Av\}$ is a basis iff the matrix $\begin{pmatrix} x & ax+by \\ y & cx+dy\end{pmatrix}$ is invertible over $\mathbb{Z}_p$.  This is the case iff its determinant $$cx^2+(d-a)xy-by^2$$ is a unit in $\mathbb{Z}_p$.  Reducing mod $p$, we see then that such a $v$ exists iff the quadratic form $$\bar{c}x^2+(\bar{d}-\bar{a})xy-\bar{b}y^2$$ does not vanish identically for $x,y\in\mathbb{F}_p$, where $\begin{pmatrix} \bar{a} & \bar{b} \\ \bar{c} & \bar{d}\end{pmatrix}$ is the mod $p$ reduction of $A$.  If $\bar{b}$ or $\bar{c}$ is nonzero then $(x,y)=(1,0)$ or $(x,y)=(0,1)$ will make the quadratic form nonzero, and if $\bar{b}=\bar{c}=0$ then the quadratic form will be nonzero for nonzero $x,y$ as long as $\bar{d}\neq \bar{a}$.  So, $\mathbb{Z}_p^2$ will be free of rank $1$ over $\mathbb{Z}_p\otimes_\mathbb{Z} S$ iff the mod $p$ reduction of $A$ is not a scalar matrix.  To state this independently of the generator $A$ chosen, $\mathbb{Z}_p^2$ will be free of rank $1$ over $\mathbb{Z}_p\otimes_\mathbb{Z} S$ iff $S$ contains an element which is not a scalar matrix when reduced mod $p$.
