2021-07-07 06:36 PM
I'm learning arm, I have a custom board with a STM32F4 MCU and a debug probe with JTAG 20 pins.
In CubeMX System Core> SYS> Debug I have this option:
- Serial Wire
- JTAG (4 Pins)
- JTAG (5 Pins)
- Trace Asynchronous Sw
- JTAG with Trace with Synchro (1 bit)
- JTAG with Trace with Synchro (2 bit)
- JTAG with Trace with Synchro (4 bit)
So my big question is which mode should I use JTAG (4 Pins) or JTAG (5 Pins). I don't understand the difference. My board has this label:
SWD> 3V3, DIO, CLK, GND
JTAG> 3V3, TDI, TMS, TCK, TDO, GND
Also please someone briefly explain to me what the other modes are used for?
2021-07-07 06:41 PM
Serial Wire (SWD) seems to be the most used and has the least problems. That's what I use. The "Trace Asynchronous Sw" adds the SWO pin which can be helpful.
JTAG and SWD use some of the same pins, you can use one or the other. They serve the same purpose but are different at the signal level.
2021-07-07 07:18 PM
I understand, but according to my specs, which JTAG connection should I use, 4 or 5 pins.
It should be 4 pins, right? because my board/MCU only supports TDI, TMS, TCK, TDO?
2021-07-07 07:28 PM
What chip are you using?
2021-07-07 07:31 PM
STM32F407VE
2021-07-07 07:44 PM
This suggests even if you use 4 wire mode, the 5th pin is not usable.
https://community.st.com/s/question/0D50X00009XkZm4SAF/stm32f2-jtag-without-njtrst-unusable
The 5th pin is certainly present on your chip.
SWD uses less pins and is more widely supported, but JTAG can certainly work.
2021-07-07 07:52 PM
okay, thanks.
I set Debug mode Serial Wire and then in Debug configurations I set Segger-JLink interface SWD
2021-07-08 01:41 AM
SWD also allows SWO, that is of help when debugging.
2021-07-08 07:40 PM
yes thanks I read what you commented here STM32 microcontroller debug toolbox
<It is anyway recommended to explicitly activate the SWD pins by selecting “Serial Wire�? or “Trace Asynchronous SW�? (together with SWO)>