Note that $A$ only appears in the combination $M=A-BC$, so the derivative with respect to $A$ equals the derivative with respect to $M$; The function $f(A)$ is given by $$f(A)=||(A - BC)^Nv - w||_2^2=(M^Nv)^T M^Nv+w^Tw-2w^TM^Nv.$$ For a simple case, let me first consider a scalar perturbation, $f(A+\epsilon I)=f(A)+\epsilon df/dA$, with derivative $$\frac{df}{dA} =2N(M^Nv-w)^TM^{N-1}v.$$ Next consider the derivative with respect to a given matrix element $A_{ij}$ of $A$. The expressions are more lengthy, basically each matrix $M$ gives a separate term so we have a sum $\sum_{k=1}^N$ instead of the factor $N$: $$\frac{\partial f}{\partial A_{ij}}= 2\sum_{k=1}^N\sum_{p,q=1}^n (M^Nv-w)_q (M^{k-1})_{qi} (M^{N-k})_{jp} v_p.$$ Note that the scalar perturbation is the trace of the matrix of elementwise perturbations, $df/dA=\sum_{i=1}^n \partial f/\partial A_{ii}$.