NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
emeb has quit [Quit: Leaving.]
Krazubu has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
tsal has quit [Ping timeout: 256 seconds]
tsal has joined #openocd
Bertl_oO is now known as Bertl_zZ
nerozero has joined #openocd
nerozero_ has joined #openocd
nerozero has quit [Remote host closed the connection]
nerozero_ has quit [Remote host closed the connection]
nerozero has joined #openocd
josuah has quit [Remote host closed the connection]
michalkotyla_ has joined #openocd
Hawk777 has quit [Quit: Leaving.]
Haohmaru has joined #openocd
Bugies has joined #openocd
Krazubu has joined #openocd
Bugies has quit [Ping timeout: 240 seconds]
Bertl_zZ is now known as Bertl
thinkfat_ has joined #openocd
thinkfat_ has quit [Ping timeout: 250 seconds]
thinkfat_ has joined #openocd
jimn has joined #openocd
emeb has joined #openocd
thinkfat_ has quit [Ping timeout: 240 seconds]
Bertl is now known as Bertl_oO
Bugies has joined #openocd
jimn has quit [Ping timeout: 240 seconds]
jimn has joined #openocd
Haohmaru has quit []
nerozero has quit [Ping timeout: 256 seconds]
jimn has quit [Ping timeout: 268 seconds]
Bugies has quit [Remote host closed the connection]
Hawk777 has joined #openocd
orzel has joined #openocd
<orzel> Hello. I have a circuit with a HC32F030 (a chinese ARM kinda like STM32f030, i guess). The circuit has a five-hole debug port, and i could identify them as +vcc/gnd/swdio/swdclk and "resetB", according to the chinese datasheet. My only 'debugging' card is a ft232h breakout board. I tried connecting that and using opencd, but i keep getting this https://dpaste.org/vyyr no matter how i connect things. Any idea what i'm missing ? I'm
<orzel> afraid something needs to be done with reset that the scripts i'm using don't do.
<Krazubu> hi orzel I'm in the same boat, trying to communicate with a cortex M33
<PaulFertser> orzel: hi
<Krazubu> once in a while I get the correct addr
<orzel> Krazubu: you're luckier than me so far :)
<PaulFertser> orzel: how exactly are you connecting ft232h breakout for SWD?
<PaulFertser> orzel: also please show -d3 log
<orzel> vcc/gnd : obvious, swdclk to d0, swdio to d2, a resistor between d1 and d2 (i tried 220 and 470 ohms). I tried not using the reset, or connecting to d4 or d5
<orzel> PaulFertser: because ft232h-module-swd.cfg mentions RESET on those pins.
<Krazubu> orzel that took me 3 days to get something though :) and it started to appear yesterday… sometimes, and it's gone since then
<orzel> PaulFertser: i tried inverting d1/d2 for swdio and the resistor
<PaulFertser> orzel: TDI should be connected via a resistor to SWDIO, TDO should be connected to SWDIO directly.
<PaulFertser> orzel: then if it gives the same result try starting OpenOCD while connecting resetB to GND manually.
<orzel> ok. tdi is d2, do that's the the second option.
<orzel> The mcu is powered by the ftdi breakout. I 'assume' it's ok, and enough.
<PaulFertser> orzel: if it's a bare MCU, probably. You can check the Vcc with voltmeter to see if it's not sunk.
<orzel> It's not bare, there's a board, with buttons, screen and all. The mcu is soldered, smd, can't 'easily' take it out.
<PaulFertser> orzel: I mean powering probably is ok, not sure how much ft232h can provide, it's about 50 mA probably.
<orzel> i tried while the board was powered. Slighlty dangerous, but everything survived, and i didn't work any better.
<orzel> "it didn't"
<PaulFertser> orzel: it's not dangerous if it's powered by 3.3 V supply.
<orzel> with the ftdi only, vcc is still stable at 3.3v
<PaulFertser> orzel: so retry with resetB pulled down. And show -d3 please.
<orzel> yes, both are 3.3V, but you never now if there's a slight difference.
<PaulFertser> btw, since 1003bc7be7c471d28794280be69632c5f074789f on a real ftdi breakout board you can just short TDO and TDI together without resistor if you're only using it in SWD mode, see 1003bc7be7c471d28794280be69632c5f074789f
<orzel> i had already tried just connecting them together
<orzel> PaulFertser: i connected resetB to to gnd : https://dpaste.org/KSGt
<PaulFertser> orzel: is it possible SWSCK and SWDIO are mixed up, have you tried tracing the signals to the chip?
<PaulFertser> orzel: yep
<orzel> PaulFertser: i identified the port using a continuity tester between those holes (not even pins) and the mcu
<PaulFertser> orzel: do you have a logic analyser? Sigrok has support for SWD.
<orzel> I just tried inverting them, doesn't help
<orzel> PaulFertser: i do, and I know how to use sigrok
<orzel> I didn't expect to go down to this :)
<PaulFertser> orzel: I can't spot anything wrong in what you're doing so far, the target seems to be not replying.
<PaulFertser> orzel: on your breakout board where do you have Vccio connected to?
<PaulFertser> In other words, does it get its 3.3 V?
<PaulFertser> orzel: btw, original stm32 will always reply while its reset pin is pulled low.
<PaulFertser> orzel: do you by any chance have some other cortex-m board so that you could check if the adapter itself is all right?
<orzel> PaulFertser: the breakout is connected by usb, and i've verified 3.3v on vcc
<orzel> not sure about cortex-m, will check. possible.
<orzel> i have those cheap blue pill clones
<orzel> pa13=swdio / pa14=swclk, it's the same as my chinese chip
<orzel> gonna try this
<PaulFertser> orzel: checking on a blue pill would be an excellent test
sbach has quit [Read error: Connection reset by peer]
sbach has joined #openocd
<orzel> PaulFertser: I still need to connect the resistor, but i got something like this : https://dpaste.org/5dxk
<orzel> Far from perfect, but at least it recognizes the mcu
<orzel> I didn't change the jumpers, i dont need to, right ?
<Krazubu> is my clock supposed to look like this while openocd is trying to communicate ? https://ibb.co/bsC3ppn
<Krazubu> using raspberry pi 3 with cortex m33 target
<PaulFertser> orzel: is that with a bluepill?
<orzel> PaulFertser: yes
<orzel> (a clone)
<PaulFertser> orzel: the connection seems unstable.
<PaulFertser> Krazubu: looks like a clock...
<Krazubu> why is it irregular ?
<PaulFertser> Krazubu: OpenOCD has delays here and there, and it's all bitbanging anyway.
<Krazubu> ok, I'm trying to find why I can't communicate with my MCU
<Krazubu> I managed to get the IDR once in a while when launching many times
<Krazubu> but it won't give it anymore now
<orzel> PaulFertser: i've noticed. I have short cables, but through a breadboard. I tried different usb ports.
<PaulFertser> orzel: I'd try lowering adapter speed too.
<PaulFertser> orzel: and probably your clock should go via a resistor to suppress ringing.
<PaulFertser> orzel: sometimes it also helps to connect more ground wires between adapter and the target.
<orzel> 1kHz seems rather slow already, not ?
<orzel> PaulFertser: how can i slow the adapter ? Through openocd options ? Modifying the script ?
<orzel> ah, ouch, it's 1MHz :)
<orzel> Indeed, probably too fast.
<orzel> What a weird default :)
* karlp coughs
<karlp> if you have reasonable wiring, 1MHz is a _slow_ defualt :)
<orzel> er.. ok
<orzel> found for speed, i need "adapter speed ..."
<orzel> let's move command line to openocd.cfg file
<orzel> Ok, at 100kHz, it's better, but i keep getting some "Error: SWD Read data parity mismatch"
<orzel> at 200kHz it's ok (i think). Go figure..
<orzel> PaulFertser: give me that (still with blupill) https://dpaste.org/Xb7f
<orzel> Is the setup now 'validated' ? :-)
<orzel> (i also added a resistor on clock)
Krazubu has quit [Remote host closed the connection]
Krazubu has joined #openocd
<orzel> PaulFertser: I can connect to another board with a similar mcu.
<orzel> But still nothing on the hc32f030, reset open or pulled to ground, whatever the speed
<orzel> reset is high (3.3v when kept open)
wolfshappen has quit [Ping timeout: 240 seconds]
Hawk777 has quit [Quit: Leaving.]
emeb has quit [Quit: Leaving.]
wolfshappen has joined #openocd
Steffann has joined #openocd
Steffanx has quit [Read error: Connection reset by peer]