  Let $M$ be a topological $G_2$-manifold. We prove that the space of
infinitesimal associative deformations of a compact associative submanifold $Y$
with boundary in a coassociative submanifold $X$ is the solution space of an
elliptic problem. For a connected boundary $\partial Y$ of genus $g$, the index
is given by $\int_{\partial Y}c_1(\nu_X)+1-g$, where $\nu_X$ denotes the
orthogonal complement of $T\partial Y$ in $TX_{|\partial Y}$ and $c_1(\nu_X)$
the first Chern class of $\nu_X$ with respect to its natural complex structure.
Further, we exhibit explicit examples of non-trivial index.
