After the Restoration of Independence in 1640, at a time when Portuguese and Spaniards faced each other constantly and the danger of coast piracy attacks was imminent, the urban growth of Caminha came to pose major defensive and security problems, leading D. João IV ordering the construction of a second line of walls that would surround the new housing districts.
Rua Barão de S.Roque nº69 4910-164
Caminha
Another factor that must have been preponderant in the decision to erect the new defensive line, is directly related to the evolution of military techniques, the result of the transition from neurobalistics to pirobalistics and the consequent improvement of the war industry, which made the walls vertical obsolete mediaevals and required the construction of walls to withstand cannon fire and, at the same time, to have platforms where it was possible to place artillery pieces.
This fortress was defended by ditches with water and counter-escarpments. It had 6 doors: Viana (or Porta Nova da Misericórdia) and Corredoura, both with drawbridges, Cais (or Porta do Vau), Arga do Coura, Stº António and Açougue. Source: https://www.cm-caminha.pt/