Each specialty has their own typical weapon. The infantry and the cavalry use swords, the musketeers use muskets, and the artillery use cannons. The training of a squad cannot be completed until they have the required weapons.
In order to supply the soldiers in the castle with weapons, you either have to produce them yourself or buy them. The armorer makes swords, the musket maker muskets, and the cannon foundry produces cannons. Don't forget that you need enough raw materials to produce the weapons.