As stated from the wiki:
Cannons (壁上固定砲 Kabe jō kotei hō?) were the primary weapon used to engage the Titans before the development of Vertical Maneuvering Equipment.
It doesn't say explicitly that the cannons were used on these specific days to defend the wall, but it does state that they were the primary defense before 3D Maneuvering Equipment, so we can assume that they were used before the Colossal Titan attacked.
We can also infer with reasonable suspicion that these cannons were used on a case-by-case basis. This means that if a titan is small and unlikely to cause harm to the wall or be a threat to humanity, it may not be worth it to waste cannon ammo and time trying to exterminate it. However, if a larger titan is scratching at the wall, the appropriate military personnel will likely make the call to engage, using the cannon.