I see some problems with your analysis. Though the hoop stress is the highest it is not the only stress present. There is also a radial stress.
The first equation shows the tangential stress or the hoop stress. It is in a slightly different form than the one GGaskill gave but the result is the same. The second is the radial stress. In both formulas ri is the inside radius, ro is the outside radus, p is the pressure and r is the region at which you want to find the stress. The stress is the highest at the inside of the tube where r = ri.
For example take a barrel with a 2” bore, a 6” outside diameter and a max pressure of 20,000 psi.
The hoop stress would be 25,000 psi
The radial stress would be -20,000 psi
It may seem weird to have a negative stress but think about stretching a rubber band. It gets longer in one direction but thinner in the other direction.
Just comparing the highest stress to the yield stress does not tell the whole story. The last equation is von Mises yield theory where Sy is the yield strength of the material.
For the above example the yield strength of the material should be greater than 39,000 psi.
A word of caution; there is not going to be one set of equations that can tell if a cannon will fail or not. The max pressure is present for less than a second where as the above equations are based on a constant pressure. There are also complex stress concentrations present due to geometry.