A trace map for $\operatorname{End}_{\mathcal{O}_X}(\mathcal F)$ of a locally free sheaf of finite rank $\underline{Background}$:Let,$X$ be a scheme(for simplicity we can assume it to be noetherian).Let $\mathcal F$ be a locally free sheaf of rank $r$ on $X$.Let, us also assume that {$\operatorname{Spec}A_i:i\in I$} is its trivializing open sets,i.e 
we have $\forall i\in I$ , $\mathcal F_{\big|\operatorname{Spec}cA_i}\cong{\mathcal O_{\operatorname{Spec}cA_i^{\oplus r}}}\cong{\oplus_{\substack r}}\tilde{A_i}$ 
$\underline{Aim}$:I am trying to give a $O_X$ module morphism from $\operatorname{End}(\mathcal F)=\mathcal Hom(\mathcal F,\mathcal F)$ to $O_X$.
$\underline{Attempt}$:$1)$ we can give maps $f(\operatorname{Spec}A_i):\mathcal Hom (F_{\big|\operatorname{Spec}A_i},\mathcal  F_{\big|\operatorname{Spec}A_i}) \to \mathcal O(\operatorname{Spec}A_i)=A_i$,
which is equivalent to give a morphism $f(\operatorname{Spec}A_i):\mathcal Hom(\oplus_{\substack r}\tilde{A_i},\oplus_{\substack r}\tilde{A_i})\to A_i$
Let,$g\in \mathcal Hom(\oplus_{\substack r}\tilde{A_i},\oplus_{\substack r}\tilde{A_i})$
$\Rightarrow g(\operatorname{Spec}A_i):\oplus_{\substack r}{A_i}\to \oplus_{\substack r}{A_i}$ is an $A_i$ module morphism.
Since $\oplus_{\substack r}{A_i}$ is a free $A_i$ module of rank r, let {$e_1,.....e_r$} be a basis(its canonical basis say).
Then let the matrix(w.r.to that basis) corresponding to $g(\operatorname{Spec}A_i)$ is $\mathcal M_g$.
Then we define $f(\operatorname{Spec}A_i)(g)=\operatorname{trace}(\mathcal M_g)\in{A_i}$
$\underline{Question}$: Even if we assume that $f(\operatorname{Spec}A_i)$s are valid $A_i$-module morphism how can we say that $\exists \phi :\operatorname{End}(\mathcal F)\to {\mathcal O_X}$ such that $\phi(\operatorname{Spec}A_i)$ is same as $f(\operatorname{Spec}A_i)$ ?
Because we know that we can do that if we have {$\operatorname{Spec}A_i:i\in I$} forms a base of $X$ and $f(\operatorname{Spec}A_i)$s are morphisms of sheaves on that base.but we only have {$\operatorname{Spec}A_i:i\in I$} forms a cover of $X$ ,not necessarily a base.
$\underline{Attempt(2)}$:So to avoid the base problem if we define maps at all affine opens {$\operatorname{Spec}A$}, then we have $g(\operatorname{Spec}A):\mathcal F(\operatorname{Spec}A)\to{\mathcal F(\operatorname{Spec}A)}$.
Now ,we have $\mathcal F$ is coherent on $X$,so $ \mathcal  F_{\big|\operatorname{Spec}A}$s are coherent on $\operatorname{Spec}A$.But that does not necessarily mean that $\mathcal F(\operatorname{Spec}A)$s are finitely generated $A$ module,so we do not necessarily have corresponding matrix and hence its trace.
$\underline{Question}$:How do we define $f(\operatorname{Spec}A)$ in this case?
$\underline{Question}$(not directly related to previous discussion)}:For $\mathcal F$ a rank $r$ locally free sheaf is $\operatorname{End}(\mathcal F)$ always a locally free sheaf of rank r?
Any help from anyone is welcome.
 A: For your first question : no you don't need to define a morphism of sheaves $f:\mathcal{F}\to\mathcal{G}$ on a basis. It is enough to define it on a cover $\{U_i\}$. However, you need to check that this agree on the two-fold intersections $U_i\cap U_j$. With this in mind, your attempt 1) can work, you just need to check that the morphisms you defined agree on the intersection of two open subset of the cover.
For your second question and second attempt : yes a coherent sheaf is finitely generated on any affine subset. But you still need to check that the morphisms you defined are compatible with restrictions.
For your last question. $\mathcal{F}$ is locally isomorphic to $\mathcal{O}_X^r$, so $End(\mathcal{F})$ is locally isomorphic to $End(\mathcal{O}_X^r)$ which is the sheaf of $r\times r$-matrices. Hence $End(\mathcal{F})$ is locally free of rank $r^2$. 
A: Question: "Aim–––––:I am trying to give a OX module morphism from End(F)=Hom(F,F) to OX......Any help from anyone is welcome."
Answer: There is a canonical map
$$\rho: E^* \otimes_{\mathcal{O}_X} E \rightarrow End(E)$$
defined on an open set $U$ as
$$\rho_U(\phi \otimes e)(v):=\phi(v)e\in E(U).$$
When $E(U):=E_U \cong A\{e_1,..,e_n\}$ is a free $A$-module on $e_i$ it follows $\rho_U:E_U^*\otimes_A E_U \cong End_A(E_U)$ is an isomorphism, and choosing an affine open local trivialization $U_i:=Spec(A_i)$ of $E$ it follows $\rho_{U_i}$ is an isomorphism for all $i$. This implies $\rho$ is an isomorphism. Since $E^* \otimes E$ is the tensor product of two locally trivial sheaves it follows $End(E)$ is locally trivial. This construction induce a canonical map - a "trace morphism"
$$tr_E: E^* \otimes_{\mathcal{O}_X} E \rightarrow \mathcal{O}_X$$
defined locally by
$$tr_E(\phi \otimes e):=\phi(v).$$
The construction of $\rho$ is similar to the construction trace map for vector spaces:
If $V$ is a $k$-vector space ($k$ a field) there is a map
$$tr: End_k(V)\cong V^* \otimes V \rightarrow k$$
which to an endomorphism $f:=\phi \otimes v$ calculates the "trace" $tr(f)=\phi(v)$.
Example: If $S:=Spec(A)$ and $E^*:=A\{e_1,..,e_n\}$ is a free $A$-module of rank $n$ it follows the sheafification $E:=\tilde{E^*}$ is a trivial $\mathcal{O}_S$-module: $E \cong \oplus^n \mathcal{O}_S$. It follows we get an isomorphism
$$H^0(S, End_{\mathcal{O}_S}(E)) \cong Mat(n \times n,A)$$
Hence the global sections of $End_{\mathcal{O}_S}(E)$ is the ring of $n\times n$-matrices $A:=(a_{ij})$ with coefficients $a_{ij}$ in $A$. It follows
$$tr(A):= \sum_i a_{ii}$$
is the trace of the matrix $A$. There is a canonical map
$$tr: H^0(S, End_{\mathcal{O}_S}(E)) \rightarrow A.$$
