Fail safe way to update ANX7688 firmware
#1
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/pinephon...t64.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
  Reply
#2
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
  Reply
#3
What would be the reason to upgrade the firmware? Are there any benefits or fixes to known issues, perhaps with USB-PD negotiation?
  Reply
#4
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)
  Reply
#5
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
  Reply
#6
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?
  Reply
#7
(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
  Reply
#8
Ah, got it now, thanks.  It is a kind of step-by-step list of instructions.
  Reply
#9
(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)
  Reply
#10
Firmware update done successfully using PMOS factory test image and Serial cable and following instructions.
Thanks!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  firmware udate Quectel EG25-G modem alwi 7 5,103 07-06-2022, 01:43 PM
Last Post: user641
  Need command to tell what modem firmware I am on. purpletiger 4 2,652 07-06-2022, 12:35 PM
Last Post: Zebulon Walton
  camera firmware problems kqlnut 25 20,880 09-02-2021, 07:49 PM
Last Post: Zebulon Walton
  3/32 upgrade board, Arrived Without Firmware, Troubleshooting Steps to SOLVED biketool 0 1,678 06-22-2021, 10:03 AM
Last Post: biketool
  WIFI not available after anx7688 update failure frimmel 21 18,896 05-11-2021, 02:45 AM
Last Post: frimmel
  Pinephone mainboard v1.2 documentation update? scholbert 1 2,568 01-18-2021, 09:01 PM
Last Post: bokomaru
  New motherboard - ANX firmware won't flash. --- 17 12,771 12-26-2020, 01:53 PM
Last Post: p1x3l3d
  Update to 3GB/32GB mainboard not working tlo 2 3,610 11-09-2020, 04:40 PM
Last Post: tlo
  BraveHeart UbPorts Battery drain/Solder update Vlodka 2 3,420 10-04-2020, 11:18 PM
Last Post: Vlodka

Forum Jump:


Users browsing this thread: 1 Guest(s)