Tool/software:
Hello all,
I'm trying to get the patch downloaded to the TPS25762 but it doesn't seem to complete.
The patch is being sent via I2C2.
One initial question is -- the patch data is supposed to be sent out in 256 byte chunks. I'm assuming that is PATCH_SIZE / 256 +1 number of chunks, each starting with the address and data register. What happens when the patch isn't 256 byte aligned (as in my case)? Only send the remaining data or pad out t he rest of the 256 bytes?
Everything is going smoothly until the patch is told to complete. After issuing PBMc, both the CMD2 and DATA2 registers read as zero but the MODE register remains in PTCH until the 5 second timeout expires (and then reverts to APP). The IRQ doesn't de-assert until after the 5 second timeout.
Here's the flow and the results:
Read INT_EVENT2 until it is non-zero (not INT_EVENT1 since we're using I2C2)
Result: 0x0B
Read MODE until it is "PTCH"
Result: 0x04 0x50 0x54 0x43 0x48 (PTCH)
Configure patch:
Write to DATA2: (patch size is 15744 / 0x3D80) Patch address is 0x35
0x23 (address)
0x11 (DATA2 reg)
0x06 (length)
0x80 (Patch LSB)
0x3D (Patch MSB)
0x00 (Patch upper LSB)
0x00 (Patch upper MSB)
0x35 (Patch address)
0x32 (Patch timeout - 5 seconds)
Write PBMs to CMD2
0x23 (address)
0x10 (CMD2 register)
0x04 (command length)
0x50 (P)
0x42 (B)
0x4D (M)
0x73 (s)
Read CMD2:
Wait until byte 1 is zero and that bytes 1-4 are not "!CMD"
Result: 0x04 0x00 0x00 0x00 0x00
Read DATA2:
Wait until byte 1 is zero
Result: 0x40 0x00 0x00 0x00 ...
Write out the patch in 256 byte chunks:
Loop:
0x35 (Patch address)
0x11 (Data register)
0x?? (Patch data - 256 bytes long)
End loop
Wait 1ms
Write PBMc to CMD2
0x23 (Address)
0x10 (CMD2)
0x04 (command length)
0x50 (P)
0x42 (B)
0x4D (M)
0x63 (c)
Read CMD2 until byte 1 is zero and bytes 1-4 are not "!CMD"
Result: CMD2: 0x04 0x00 0x00 0x00 0x00
Read DATA2 until byte 1 is zero
Result: DATA2: 0x40 0x00 0x00 0x40 0x80 ...
(IRQ never deasserts until timeout)
Read MODE until it is in "APP"
Result: MODE: 0x04 0x50 0x54 0x43 0x48 (PTCH)
Lasts until timeout, then switches to APP.
So clearly I'm talking to the part but I'm not entirely sure why it is remaining in PTCH mode instead of going into APP. I'm not issuing the PBMe command because IRQ is supposed to be released once the patch is downloaded and the CMD2 and DATA2 register is 0x00. Unfortunately that isn't happening.
Any suggestions would be greatly appreciated!
-Matt

