Part Number: CC2538
Other Parts Discussed in Thread: SMARTRF06EBK, TMDSEMU200-U, FLASH-PROGRAMMER, UNIFLASH
Hello,
I am trying to issue a JTAG mass erase as described in document swru319c, sections 6.6.1 and 8.7.1 with no effect.
Configuration:
- Debugger hardware: Olimex ARM-USB-OCD-H
- Debugger software: OpenOCD
1) Command used to open a JTAG session with OpenOCD:
$> openocd -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f target/cc2538.cfg
2) I can successfully access various registers on the chip, showing that the setup is correct and the TAP chain is well configured.
For information :
$> scan_chain
TapName Enabled IdCode Expected IrLen IrCap IrMask
-- ------------------- -------- ---------- ---------- ----- ----- ------
0 cc2538.cpu Y 0x00000000 0x8b96402f 4 0x01 0x0f
1 cc2538.jrc Y 0x8b96402f 0x*b96402f 6 0x01 0x3f
Note that the flash currently contains a simple LED blinking application that allows me to see quickly if flash has been erased or not.
3) I execute the following procedure to issue a mass erase, closely following swru319c:
proc icepick_mass_erase {jrc} {
# Connect to the ICEPick (0x07 IR followed by 0x89 DR)
irscan $jrc 0x07 -endstate IRPAUSE
drscan $jrc 8 0x89 -endstate DRPAUSE
# Scan private connect (0x1F IR followed by 0x01 DR)
irscan $jrc 0x1F -endstate IRPAUSE
drscan $jrc 1 0x01 -endstate DRPAUSE
# Issue mass erase command (0x0D IR followed by 0x0E IR)
irscan $jrc 0x0D -endstate IRPAUSE
irscan $jrc 0x0E -endstate IRPAUSE
# Monitor the status register (0x0E IR data register)
set drvalue 0
while {($drvalue & 0x7F) != 0x5F} {
set drvalue 0x[drscan $jrc 32 0x00000000 -endstate DRPAUSE]
echo "DR value = $drvalue"
irscan $jrc 0x0E -endstate IRPAUSE
}
# Clear the debug unlock command (0x3E IR)
irscan $jrc 0x3E -endstate RUN/IDLE
# Finally reset the board to access unlocked DAP.
echo "Resetting ..."
reset
}
When executing this function ($> icepick_mass_erase cc2538.jrc), it falls in an infinite loop having the status register always equal to 0. I never see bit 6 of data register for 0x0E IR set. This probably mean that the mass erase is not triggered at all.
I have elaborated this function using the following sources:
- swru319c, section 6.6.1
- swru319c, section 8.7.1
- e2e.ti.com/.../828403
- e2e.ti.com/.../664704
My questions:
- What part of the mass erase process through JTAG am I missing ?
- Are there more detailed documents about mass erase (and ICEPick registers in general) available to help ?
- How long does it take approximatively to perform the mass erase ? May I use a delay instead of the status monitoring step ?
Thanks,
Nicolas Mardegan