2021-06-17 06:31 AM
On my board i use USART1 and USART3 to connect my device to other by dual RS-485. 485 tranciever connected to MCU throw digital isolator (4 tx, 2 rx SI8662). If 485 line of USART1 not connected ti device i can start debugging in Keil without problem. If i connect 485 line debug session immediately fail. If i connect line before debuging then i can't enter debug. Even ST-Link Utility can't connet to MCU with connected 485 line. I can load programm to MCU, connect 485 line an device will work fine by self. With 485 of USART3 no eny problem.
There is no galvanic connection between MCU and 485 tranciever, no ground connected. Power of both part of device is fine, no any noise.
Boot0 on MCU connected to GND. I use ST-Link v2 and SWD-connection.
Why debugging not work with incoming data stream on USART1?
2021-06-21 04:40 AM
With STLink-Utility not all is ideal.
When i try download FW from Keil end got error, then i checked FLASH by STLink-Utility and see that some FLASH was flashed. After that i can't erase chip because " Error occured during flash mass erase!"
2021-06-21 05:11 AM
Just guessing...
2021-06-21 06:06 AM
Maybe you should try this on a "known good" hardware i.e. a Nucleo board.
JW
2021-06-21 07:00 AM
Noise in power rail can be cause of periodical nRST pulses?
2021-06-21 07:45 AM
I'm having a hard time believing the two plots are from the same data. One shows a perfect correspondence between RX and JRST. The other shows only occasional spikes on JRST.
2021-06-21 08:06 AM
*You can't load full FW, or small FW.
a) Maybe a poor STLink connection, maybe the STLink ribbon cable is pulled apart?
Test the STLink and ribbon cable on a different PCB.
b) Maybe a bad Power supply connection on 3V3 or Gnd.
c) Like JW suggests, try it all on a known good board.
d) Start with a clean project. New MX File. Minimal features. Test.
Then slowly add code&features till stops working.
That may narrow down where bug actually is.
e) Check connection of any BOOT or BOOT0 pins
2021-06-22 11:11 PM
Look at the voltage level of blue plot. i think logic analyzer can't catch too small amplitude correct. I can pull up JRST pin and shift avg voltage level, if it can help.
2021-06-22 11:26 PM
a) On other PCB this ST-Link and cable works great. I try another ST-Link on my PCB and there is no difference. My colleagues faced the same problem on similar boards (3 identical boards were made).
b) Checked this several times.
c) we have troubles only with STM32G473 boards but not with all. One device with same MCU works great.
d) Try this, nothing change
e) Checked this. Even try use Flash Loader but MCU did not answer on USART1 Tx (oscolloscope show only constant level).
2021-06-23 01:18 AM
"WWDG_SW active (i.e. 0) in option bytes" - you was too close. IWDG_SW bit make me feel pain in ***.
After checking this bit in ST-Link Utility reset pulses gone.
Now we start testing debug with RS-485 line.