Jtag Id

TI include a JTAG-ID with all their MSP430 but understanding how this works can be a bit confusing.

Backstory

Maciek has some MSP430g2xxx chips.

I am using Terry’s Mecrisp-Across mod described here https://mecrisp-across-folkdoc.sourceforge.io/kernel-efa9d4c6a5.html#kernel-efa9d4c6a5.

_images/across-binary-efa9d4c6a5.jpg

Features:

  • All compiler warnings in RED

  • All compiler warnings ring the BELL

  • Host mode has color enabled in the mecrisp-stellaris-2.6.1 build, i.e. a light blue, or dark blue prompt

  • TARGET mode has a GREEN prompt

  • Default high speed USB user terminal which I use with Picocom as below.

  • Replaced the minimal default memmaps with a larger memmap from the MSP430G2553

The Problem

When using MSP430G2553 and MSP430G2452 chips the jtag chip id is correct: 2553 and 2452 respectively but with the MSP430G2212 I get 2452 instead of expected 2212.

Now, before I run some tests to know exactly what chips I actually have that are labeled as MSP430G2212 (a genuine TI ones from a reputable source) maybe somebody here has already stumbled on this and can answer this question:

Is this a different chip or wrong jtag ID reading ?

Needless to say, I have bought an tested a bunch of these and they all display the same behavior.

I’d really like to ultimately find out these are wrongly labelled G2452 chips rather than marked G2212 ones but more than that I’d like to know what’s the real root cause.

The Solution

Firstly download this document: https://www.ti.com/lit/ug/slau320aj/slau320aj.pdf which has the details.

How Jtag_Id Works

Page 64, SLAU320AJ.pdf

2.6 JTAG Features Across Device Families

Table 2-14. MSP430F1xx, MSP430F2xx, MSP430F4xx, MSP430Gxx JTAG Features,

Column: Device, row: G2xx2. The jtag reads the Device ID at 0x0FF0 and 0x0FF1 which are 0x24 and 0x52 respectively.

So, any chip within the G2xx2 familly will come up with the jtag chip ID of 2452.

Where is the Mecrisp-Across Source ?

mecrisp-across-0.9a-experimental/mecrisp-across-source-stm32-specials/jtag.txt

Memory Location

\ JTAG identification value for all existing Flash-based MSP430 devices
  $89 constant JTAG_ID

Find Device

: GetDevice ( -- ) \ Gut !

  SBW_Enter_Sequenz
  ResetTAP

  $2401 ir-cntrl-sig \ Set device into JTAG mode + read

  IR_CNTRL_SIG_CAPTURE IR_Shift JTAG_ID <> if ." JTAG-ID invalid " cr quit then

  \ Wait until CPU is synchronized, timeout after a limited # of attempts
  50 0 do \ Maximal 50 Versuche
    0 DR_Shift $0200 and 0 <> if
                                  ." Chip detected: "
                                  $0FF0 ReadMemWord dup $FF and 8 lshift swap 8 rshift $FF and or hex . decimal
                                  leave
                                then
  loop

Credits

Thanks Maciek for explaining how the JTAG_ID works! https://sourceforge.net/p/mecrisp/discussion/general/thread/f0c51c8c3e/?limit=25#88a2