Last active
August 24, 2017 22:29
-
-
Save dpavlin/7108997 to your computer and use it in GitHub Desktop.
mchck buspirate SPI try to enter ezPort mode (non-working at the moment) moved to wiki at https://github.com/mchck/mchck/wiki/ezPort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newest version of this gist is part of wiki at https://github.com/mchck/mchck/wiki/ezPort | |
ezPort setup for flasing rig is deescibed at https://mchck.org/blog/2013-09-12-mc_hck_flashing_rig | |
pinout from updated https://github.com/mchck/mchck/wiki/Pinout | |
MCU pinput source http://cache.freescale.com/files/32bit/doc/data_sheet/K20P48M50SF0.pdf | |
ezPort description, chapter 29, http://cache.freescale.com/files/32bit/doc/ref_manual/K20P48M50SF0RM.pdf | |
MCU MCHCK ezPort | |
------------------- | |
PTA0 SWD_CLK EZP_CK -> BP CLK (SWD CK marking on silkscreen) | |
PTA1 PL4 EZP_DI -> BP MOSI | |
PTA2 PL5 EZP_DO -> BP MISO | |
PTA4 PL6 EZP_CS -> BP CS | |
start bus pirate | |
dpavlin@blue:/blue-zfs/mchck$ ~/bin/bp.sh | |
+ microcom -p /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AE01J55Q-if00-port0 | |
connected to /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AE01J55Q-if00-port0 | |
Escape character: Ctrl-\ | |
Type the escape character followed by c to get to the menu or q to quit | |
HiZ>v | |
Pinstates: | |
1.(BR) 2.(RD) 3.(OR) 4.(YW) 5.(GN) 6.(BL) 7.(PU) 8.(GR) 9.(WT) 0.(Blk) | |
GND 3.3V 5.0V ADC VPU AUX CLK MOSI CS MISO | |
P P P I I I I I I I | |
GND 0.00V 0.00V 0.00V 0.00V L L L L L | |
# we might need to turn on power before we pull CS pin hight, because it seems that this powers MCU itself | |
# you can abbrivate this to | |
HiZ> m 5 1 1 2 1 2 2 | |
SPI (spd ckp ske smp csl hiz)=( 1 0 1 0 1 0 ) | |
Ready | |
SPI>[ | |
/CS ENABLED | |
# press and hold reset button while turning power on | |
SPI>W | |
POWER SUPPLIES ON | |
# you can release reset button | |
SPI>] | |
/CS DISABLED | |
# read status on board which is not secured | |
SPI>[0x05 r] | |
/CS ENABLED | |
WRITE: 0x05 | |
READ: 0x00 | |
/CS DISABLED | |
# read status on secured board | |
SPI>[0x05 r] | |
/CS ENABLED | |
WRITE: 0x05 | |
READ: 0x81 | |
/CS DISABLED | |
# write enable | |
SPI>[0x06] | |
/CS ENABLED | |
WRITE: 0x06 | |
/CS DISABLED | |
# bulk-erase | |
SPI>[0xBE] | |
/CS ENABLED | |
WRITE: 0xBE | |
/CS DISABLED | |
# verify that board is not secured | |
SPI>[0x05 r] | |
/CS ENABLED | |
WRITE: 0x05 | |
READ: 0x83 | |
/CS DISABLED | |
# reset board | |
SPI>[0xB9] | |
/CS ENABLED | |
WRITE: 0xB9 | |
/CS DISABLED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment