Could'nt write programs on SAM4S from HuskyPlus

You’ve got it backwards. You need to power cycle the target after programming, not before.