Open kexis0 opened 1 month ago
Okay, I think I figured it out. I made the timeout shorter and it worked for me. I am not entirely sure why this works, but I get the same .bin file each time.
diff --git a/./venv2/lib/python3.12/site-packages/ltchiptool/soc/ambz/util/ambztool.py b/./venv/lib/python3.12/site-packages/ltchiptool/soc/ambz/util/ambztool.py
index dc88e59..de818c2 100644
--- a/./venv2/lib/python3.12/site-packages/ltchiptool/soc/ambz/util/ambztool.py
+++ b/./venv/lib/python3.12/site-packages/ltchiptool/soc/ambz/util/ambztool.py
@@ -438,7 +438,7 @@ class AmbZTool(SerialToolBase):
# send RAM code, exit download mode (changes baudrate to 115200)
self.ram_boot(code=code, callback=callback, keep_baudrate=True)
- self.push_timeout(0.1)
+ self.push_timeout(0.01)
resp = b""
end = time() + timeout
while time() < end:
I was wrong. That did not do what I expected. I get the .bin file but binwalk failed and a hexdump shows:
binwalk govee-h7021-stock.bin
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
hexdump -C govee-h7021-stock.bin
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00200000
Any thoughts on what else I can try?
Sadly, no. You could try using an old version (before 4.8.0, I think) which had an old implementation of the RTL flashing tool.
I am trying to make a dump of a RTL8710BX from the Govee Lynx Dream String Lights (H7021) to make a backup before putting esphome on the chip. I am able to get into boot mode but end up getting stuck on 'resp += self.read()' in ambztool.py.
LOG:
Here it will hang indefinitely without timing out on line:
https://github.com/libretiny-eu/ltchiptool/blob/2868532605c90154ccc362ccfd21cc859615091a/ltchiptool/soc/ambz/util/ambztool.py#L446
I started to debug it and found that it will loop 2 times before getting stuck. The value of resp is
b'\x18\rxmodem_log_open \n\r\rclose xModem Transfer ...\r\n\r'
.Any idea if I am doing something wrong? It seems like xmodem is being closed but I'm not too familiar with what normally occurs.