I'm trying to program STM32F107VCT6 via SWD and I'm constantly getting two errors in turns (literally):
Error: Connect failed, check config and cable connection
Error: Flash driver function execute error
Erase: [ 0%]
By "in turns" I mean that when I click "Download Code To Flash" in CooCox CoIDE, I'm getting the first error, and after the second try, I'm getting the second one.
I have a PCB made from the same schematics with this model of STM32 and it works just fine. Changes between the old board and the new one are very insignificant.
I thought the problem may be in connecting NRST line, but everything is fine. I used 10k pull-up resistor, and the connections seem to be OK. Also, the crystal oscillator looked guilty, but I disconnected it to check if I could program STM32 on the internal oscillator, but it didn't help. All signals are connected correctly and all GNDs are connected together.
Could someone point out some possibilities why STM32 could behave like this? I would be grateful for any help.