2019-12-18 12:57 PM
Hi,
I designed a board with a STM32F030F4P6 on it. The board is about 68x48 mm and contains the microcotroller a AC/DC supply and a nRF24L01 RF-Module. supplied directly with about 5V from an external supply the circuit works as it should. But when I use the AC/DC-Module on the board and supply the board by 230V from socket, I dont can program the microcontroller anymore. The microcontroller uses the internal oszillator, enough capacitors on the supply pins are available. When I connect a oscilloscope between SWCLK and GND to measure if there are any interferences, the programming works again. But when I remove the scope its the same error again. The debugging starts and after some blinking of the debugger (ST-Link V2) the message "Error finishing flash operation" occures. I have already tried pull-up/down resitors on SWCLK and SWDIO, but that doesn't work too.
2019-12-18 01:09 PM
> When I connect a oscilloscope between SWCLK and GND to measure if there are any interferences, the programming works again.
Do you need to have SWCLK connected to the scope for the programming to work? Isn't it enough to have GND of circuit connected to the scope's ground clip? Is the scope earthed?
JW
2019-12-20 11:11 AM
Sorry for my late answer. Sometimes it already works if only GND is connected to the scope, but not always. The scope is supplied by a isolation transformer. I tried to supply the circuit by the same isolation transformer and by normal socket. Both without success. Now I have tried to connect my circuit GND via 100nF or 470nF Y-Capacitor to PE, but that doesn't change anything. I don't know how to go on...
2019-12-20 12:29 PM
What are you using to program/debug the board? stand-alone ST-Link2? ST-Lilnk2 from a Nucleo or DISCO board? ST-Link3? How is the debugger connected to your board - individual wires? ribbon cable? How long? Is your AC/DC converter's DC output totally floating relative to the AC inputs? Try adding a ground wire from GND on your board to GND on your PC.
2019-12-25 01:05 AM
For debugging I use a stand-alone ST-Link V2. The debugger is connected to an adapter from the ribbon cable to a Molex Pico-Blade connector. By another ribbon cable my board is connected.
I tried another thing: I supplied my board from a 5V external source and unsoldered the AC/DC converter. With this configuration the debugging works every time. But if I unconnect the debugger from my board and power up again (still supplied by the 5V external source) the application doesn't start up. I have a nRF24L01+ module connected via SPI. When the communication between nRF24 and micrcontroller works, a LED should flash two times. In debugging mode it works, but with no debugger connected it doesn't. When I try to connect a logic analyzer (Saleae Logic 8) to the SPI port to check the communication, it works again. I tried to remove the connections between logic analyzer and my board until it doesn't work anymore. The result was, that SCK and GND need to be connected (the logic analyzer doesn't need to work, but must be connected to the computer). When only GND or SCK are connected it doesn't work.
For better understanding of my board I added screenshots of the circuit diagram and layout. In the first design the board was a 4 layer board with seperate GND and 3,3V planes, but now its redesigned to be made an my milling maschine. When the board works again, I will made it a 4 layer board again.
2019-12-25 01:05 AM
2019-12-25 01:05 AM
2019-12-25 01:05 AM
2019-12-25 01:05 AM
2019-12-27 03:34 AM
Any further ideas?