PINE64
Fail safe way to update ANX7688 firmware - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Hardware (https://forum.pine64.org/forumdisplay.php?fid=122)
+--- Thread: Fail safe way to update ANX7688 firmware (/showthread.php?tid=13001)

Pages: 1 2 3


Fail safe way to update ANX7688 firmware - scholbert - 02-05-2021

Hi,

as there'd been a lot of reports of failed updates for ANX7688 firmware, i thought i'd share my experience here.
The wiki already points out that there's some trouble with Linux kernel 5.10 (timeout)
and i had some trouble with the image it refers to... here's a fail safe way!

Before (version 0x2312):

Code:
[  11.356306] anx7688 1-0028: fw loaded after 40 ms
[  11.365598] anx7688 1-0028: OCM firmware loaded (version 0x2312)
[  11.380796] anx7688 1-0028: send pd packet cmd=0 05 00 32 90 01 26 12
[  11.405217] anx7688 1-0028: send pd packet cmd=1 05 01 2c 91 01 26 16
[  11.405764] anx7688 1-0028: send pd packet cmd=2 11 02 00 00 00 ec 00 00 00 00 00 00 00 00 39 00 00 51 77
[  11.406629] anx7688 1-0028: send pd packet cmd=3 05 03 00 00 01 ff f8
[  11.407149] anx7688 1-0028: OCM configuration completed
[  11.409664] anx7688 1-0028: status changed to 0x00

To upgrade safely, download PMOS factory test image:
https://images.postmarketos.org/pinephone/pine64-pinephone-20201130-factorytest64.img.xz

Write image to SD-card...
Put the SD-card into linux host and mount PM_root.

Replace /lib/firmware/anx7688-fw.bin with the latest one from:
wget https://xff.cz/git/linux-firmware/plain/anx7688-fw.bin

!!!Attention!!!
Before using the serial debug cable, please disable headphone with the kill switch.
Insert card to your Pinephone and use serial debug cable (most convenient way):
login: demo
pwd: demo

...then:
sudo -s
echo 1 > /sys/class/typec/port0/device/flash_eeprom

Kernel messages will inform you about the eeprom flash process afterwards (call dmesg).
Send the device to halt and remove the SD-card.

Then after booting up to your OS will give:

Code:
[  184.219123] anx7688 1-0028: eeprom0 = 0x03
[  184.219145] anx7688 1-0028: fw loaded after 40 ms
[  184.219319] anx7688 1-0028: OCM firmware loaded (version 0x2410)
[  184.220257] anx7688 1-0028: send pd packet cmd=0x00 05 00 32 90 01 26 12
[  184.264040] anx7688 1-0028: send pd packet cmd=0x01 05 01 2c 91 01 26 16
[  184.264557] anx7688 1-0028: send pd packet cmd=0x02 11 02 00 00 00 ec 00 00 00 00 00 00 00 00 39 00 00 51 77
[  184.265367] anx7688 1-0028: send pd packet cmd=0x03 05 03 00 00 01 ff f8
[  184.265871] anx7688 1-0028: OCM configuration completed
[  184.269329] anx7688 1-0028: status changed to 0x00

That's it! Successfully upgraded to OCM firmware version 0x2410.

Hope this helps to avoid further confusion.

Cheers,
scholbert


RE: Fail safe way to update ANX7688 firmware - zborgerd - 02-05-2021

I did it successfully with Mobian on 5.10 a week or two ago in spite of the claims that it is not compatible with this kernel. I do believe that I disabled standby and also did it through a wired connection. I have WiFi disabled. 

Code:
[   14.859686] anx7688 1-0028: OCM firmware loaded (version 0x2410)

Linux version 5.10-sunxi64 (a-wai@247b6bdff3f2) (gcc (Debian 10.2.0-3) 10.2.0, GNU ld (GNU Binutils for Debian) 2.35) #2 SMP PREEMPT Tue Jan 12 09:55:56 UTC 2021



RE: Fail safe way to update ANX7688 firmware - marcih - 02-09-2021

What would be the reason to upgrade the firmware? Are there any benefits or fixes to known issues, perhaps with USB-PD negotiation?


RE: Fail safe way to update ANX7688 firmware - AndrewBlackmiller - 02-09-2021

Hi,

If I try to do an:

Code:
echo 1 > /sys/class/typec/port0/device/flash_eeprom

I get an error message:

Code:
bash: echo: write error: Argument list too long

Would anybody be so kind to help me out pls!

Many thanks!
Andrew >:o)


RE: Fail safe way to update ANX7688 firmware - scholbert - 02-09-2021

Hi,
i guess you'll need to have root privileges and make sure your kernel is below version 5.10.
Just added the sudo command to the first post.
BTW, the PMOS factory test image uses kernel 5.7 and everything was nice.
Good luck!

Cheers,
scholbert


RE: Fail safe way to update ANX7688 firmware - dsimic - 02-10-2021

I have to wonder why is the described procedure actually safer than simply booting a phone from the eMMC and using a terminal and on-screen keyboard to update the ANX7688 firmware?


RE: Fail safe way to update ANX7688 firmware - scholbert - 02-10-2021

(02-10-2021, 12:30 AM)dsimic Wrote: I have to wonder why is the described procedure actually safer than simply booting a phone from the eMMC and using a terminal and on-screen keyboard to update the ANX7688 firmware?

Hi,
it's not any safer this way, but if you follow this way it's fail save as the title says.
We use a static environment here, the right kernel version (no timeout issue here) and put the latest firmware right in place to make everything work.

It's meant for those who had trouble with updating.

Regards,
scholbert


RE: Fail safe way to update ANX7688 firmware - dsimic - 02-10-2021

Ah, got it now, thanks.  It is a kind of step-by-step list of instructions.


RE: Fail safe way to update ANX7688 firmware - AndrewBlackmiller - 02-10-2021

(02-09-2021, 04:11 PM)scholbert Wrote: Hi,
i guess you'll need to have root privileges and make sure your kernel is below version 5.10.
Just added the sudo command to the first post.
BTW, the PMOS factory test image uses kernel 5.7 and everything was nice.
Good luck!

Cheers,
scholbert

Many thanks for your quick reply!

I am superuser on the system but I still get the error-message Sad

But I checked my kernel-version and its 5.10 Sad
So I've to wait until the timeout-problem is solved anyways.

Thanks and best regards from Vienna,
Andrew >:o)


RE: Fail safe way to update ANX7688 firmware - surfingtux - 02-14-2021

Firmware update done successfully using PMOS factory test image and Serial cable and following instructions.
Thanks!