The following commands are used with the Freescale USB TAP. They can be easily tranlated to a flash programmer vendor's environment.
Comment lines begin with a "#" character.
Commands addressed to ccs (command coverter server) begin "ccs".
Commands addressed to the JTAG begin "jtag".
#configure the command converter server for the hawkv3 (MC56F84xxx)
ccs::config_chain hawkv3
#lock the jtag interface so that ccs will not allocate it to another instance
jtag::lock
#advance the jtag state machne to reset to the known starting state
jtag::state_move test_logic_reset
#Read the data register to check the device ID
jtag::scan_in dr 32
#0x16B4801D, just to check idcode, optional step
#tlm select to instruction register
jtag::scan_out ir 8 5
#chip select to instruction register
jtag::scan_out dr 4 1
#Chip Tap Test Control Unit Register "Flash tdr Register" selected by JTAG instruction '9'
# "Flash tdr Register" width is 16 bits.
jtag::scan_out ir 8 9
#BIt zero of the "Flash tdr Register" is ftfl_erase_all_req, which when set will initiate an erase of all the flash and the returning of the flash to the unsecured state.
#This bit zero is first set, then a period of time later, cleared. The setting kicks off an errase.
jtag::scan_out dr 16 1 #NOTE: at a lower level of abstraction this gets changed to 0x8001 instead of 0x0001. The MSB is the write_enable bit added for saftey.
# The write_enable bit purpose is to make sure that two things and not just one thing is changed to perform the flash erase to avoid accidental flash erase.
jtag::scan_out dr 16 0 #this is key to making this work. Do not check status. Just turn this off on next command.
#must deassert between 6usec and 16ms after assertion. Too soon, and may not errase. To late,and may start another
#errase cycle!
#NOTE: at a lower level of abstraction this gets changed to 0x8000 instead of 0 since it will not clear unless the write enable bit is also set.
#Further more, immediately after the write of 0x8000, 0x0000 is written to clear the write enable bit to guard against accidental flash commands.
#Note: Bit one of the above register, Flash tdr, is a status bit that operates as follows so that the end of the erasure cycle is signaled:
# SoC erase all acknowledge is bit one of Flash tdr.
# ftf_erase_all_ack is initiated by rising edge (set to one) on a rising edge of soc_erase_all_req.
# ftf_erase_all_ack will go low after the
# erase operation has completed, so wait for this bit to go to zero prior to reseting the device.
#allow other instances to use the jtag
jtag::unlock
#reset to debug state
ccs::reset_to_debug
# only after the reset to the debug state is the chip then unprotected and ready to be programmed.
Best Regards,
John L. Winters
Senior Applications Engineer
AMR/EU MCU & MPU AE Group
Freescale Inc.
2100 Elliot Road
This email and any associated attachments have been classified as:
Freescale Confidential and Proprietary