What Debug mode to use ? JTAG 4 Pins or 5 Pins ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-07 6: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?
- Labels:
-
DEBUG
-
STM32CubeMX
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-07 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-07 7: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-07 7:28 PM
What chip are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-07 7:31 PM
STM32F407VE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-07 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-07 7:52 PM
okay, thanks.
I set Debug mode Serial Wire and then in Debug configurations I set Segger-JLink interface SWD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-08 1:41 AM
SWD also allows SWO, that is of help when debugging.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-08 7: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)>
