Hello mr. XiangJun Rong, @xiangjun_rong
I decided to write here since I am trying to unlock and mass erase mc56f8013.
I use the algorithm specified in the datasheet, and implemented in Mr. PGO's TCL script, 8014.tcl.
mass erase PGO TCL 8014
I write my own modified software to work with these controllers as hobby.
It works for me with other controllers (8025, 8035), but for some reason it doesn’t work with 8013.
The questions are:
1. Is a locked controller always unlocked with the correct sequence? Is there an option that it is closed from mass erase?
2. In which eOnce mode should we follow the sequence? Execution or debug mode?
3. is correct sequence in PGO tcl & me used?
let flash_erase_cmd : Vec<u8> = vec![0x08]; // 0x8 = Lock Out Recovery (Flash_Erase)
let clk_div = self.calculate_flash_divider(4000)?; // 29
let b3 : u8 = ((clk_div >> & 0xff) as u8;
let b4 : u8 = (clk_div & 0xff) as u8;
let clk_div_vec : Vec<u8> = vec![b4, b3];
dbg!(&clk_div_vec);
println!("jtag_reset");
prog.jtag_reset()?;
println!("jtag_select_shift JTAG_SHIFT_IR");
prog.jtag_select_shift(jtag_shift::JTAG_SHIFT_IR)?;
println!("jtag_write flash_erase_cmd");
prog.jtag_write(jtag_shift::JTAG_EXIT_SHIFT_DR, 0x8, flash_erase_cmd)?;
println!("jtag_write clk_div_vec");
jtag_write(jtag_shift::JTAG_EXIT_IDLE, 0x16, clk_div_vec)?;
thread::sleep(time::Duration::from_millis(2000));
println!("jtag_reset");
prog.jtag_reset()?;