I am having trouble unlocking level 2 flash. According to the spnu239b TRM the F05 flash level 2 indicator bit 15 is set when the correct keys have been entered of offset 0x8, from the flash wrapper.
I have a J tag that uses the following commands POKE [address] valueToWrite, and PEEK [address] ReadsWordFromAdress.
POKE FFFFFFE0 4007 // SYSECR Disable reset on address access violation., however it seems bits 0-2 are not available on this chip, not sure how to fix that, these are usually available:
Bit 2 PACCOVR. Peripheral access violation override bit.
Prevents a peripheral access violation error from causing a reset or abort
exception.
User and privilege mode (read):
Privilege mode (write):
0 = Peripheral access violation error causes a reset or abort
1 = No action taken on a peripheral access violation
Bit 1 ACCOVR. Memory access reset override bit.
Prevents a a memory access rights violation from causing a reset or abort
exception.
User and privilege mode (read):
Privilege mode (write):
0 = Memory access violation rights error causes a reset or abort
1 = No action taken on a memory access rights violation
Bit 0 ILLOVR. Illegal address reset override bit.
Prevents an illegal access from causing a reset or abort.
User and privilege mode (read):
Privilege mode (write):
0 = An illegal address causes a reset or abort.
1 = No action taken on an illegal address.
POKE FFFFFE00 00 //
POKE FFF8701C 00000918 //Set FMMAC2 = 00000918 (*(int *)(Reg_FlashWrapBase + 0x1c) >> 3) << 3), because original FMMAC@ was 00000918
POKE FFF87004 11 //Set FMBAC2 = FMBAC2 | 0xff, because original FMBAC2 was 7F11
PEEK 1FF0 //dummy read first flash key
PEEK 1FF4 //dummy read 2nd flash key
PEEK 1FF8 //dummy read 3rd flash key
PEEK 1FFC //dummy read 4th flash key
POKE FFF8710C 00 //write 1st flash key
POKE FFF8710C 00 //write 2nd flash key
POKE FFF8710C 00 //write 3rd flash key
POKE FFF8710C 00 //write 4th flash key
POKE FFF87100 2 //restore FMREGO, original value was 2
POKE FFF87004 7F11 //restore FMAC2
Read FFF87108 //FMBBUSY if bit 15 set flash level 2 is unsecured all four keys entered correctly. (0x8000 = bit set) , this reads 0x4000 before , and 0x4001 after attempting unlock.
I am positive that all the keys are zero, why don't I get a positive unlock? I have the bin file that was flashed into this chip, address 1ff0 to 1fff are all zeros.
Do you have a sample flash erase to follow in C, or arm7 assembly for TMS470PVF24xB/34xB, which seems to be very similar to the TMS470PLF111.
Also all the examples I find have global control I cannot find that on this chip. See a different TMS470 below
/* set GLBCTRL.4 */
target_read_u32(target, 0xFFFFFFDC, &glbctrl);
target_write_u32(target, 0xFFFFFFDC, glbctrl | 0x10);