I know that there were many developments to the development of firearms as we know them now. Originally they took lots of time to reload and were very inaccurate. But did firearms become a battle necessity as soon as they were developed? Did it take time for militaries to train infantry to be effective or did it take further technological advancements? Are there examples of battles of gunmen completely obliterating armies that opted to not use firearms?
I'm not a military historian specifically, but I do study the period, so please forgive my broad generalizations.
The adoptions of firearms as a military necessity followed somewhat different paths for cannons as opposed to small arms.
By the early 15th century, new types of fortifications, made chiefly of layered and interlocking lines of earthworks, the trace italianne "star fort", are being created to defend against cannon which can easily destroy the thick masonry walls that had previously been effective in the defense of fortresses and cities.
So in summary, cannon were adopted fairly quick as soon as states and armies possessed technical and economic abilities to field them, because they fit neatly into the role previously held by earlier types of siege weapons, and the weight and slow rate of fire weren't really a problem during a siege, and because they very effective at destroying the older types of masonry fortifications that had been in use the previous 1000+ years. In contrast, the adoption of firearms as an man-portable infantry weapon took a bit longer since it wasn't as immediately obvious was the best way to use them was, and so widespread adoption of small arms required the development of new tactics and new types of military organization to make them useful.