-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flash_st17h66.py: Improve documentation for flashing procedure in README (photos of common boards and pinouts) #32
Comments
great! that's exactly the point of this repo actually. there are too many UART adapters out there to keep a list, but you're right we could update the readme to indicate that lack of power should be one of the first things to investigate if it does not work. |
I'm trying to flash my 2 trackers this weekend, but I believe I already broke one of them. - Is the reset state persistent? (= once reached, will the chip to refuse to boot normally, even before an erase?) One of my trackers doesn't power up normally anymore (long holding the button doesn't do anything, when normally it would flash the LED and start beeping) I basically got stuck in this loop but kept printing some garbage: FindMy/Lenze_ST17H66/flash_st17h66.py Lines 73 to 80 in 113ebf4
So it did see some stuff on the serial bus before, just not "cmd>>:". As I mentioned, it doesn't work with just the battery power anymore either - it shows no signs of life. |
They are quite resilient chips, only physically breaking them by overvolting or similar would really kill your chip. The bootloader is not touched during flashing and should always be available. It's a tricky process, but when you finally see that |
Thanks for your patience. I hope I'll be able to contribute back if I get it working eventually. The chip labels are "ST17H66B". I'm trying it like this:
Let's assume the other side of all clamps / pin aren't initially connected to anything. As serial adapter / power source I'm using an nodemcu V3 which has a "1117C" (second line: "22 C232"). First I connect nodemcu GND to the respective GND clamp . I then run I now connect the VCC clamp to the nodemcu 3V pin; the beeper becomes louder. Occassionally I try to disconnect/connect BAT+ to reset the chip - I'm not sure if this is enough, because I still hear the beeper ticking (it seems to get power through nodemcu TX). When reconnecting just 3V, sometimes I get garbage output like:
After a couple of failed attempts I switch RX/TX and repeat this. It did not help. I also repeated these steps while holding the button or pressing the button (especially while reconnecting). In at least one attempt, the button became unresponsive (no longer a beep / no LED blink; yet, no "cmd>>:" either).
One of my two boards seems broken and I'm still not sure why. It worked fine first (as in: normal operation prior to reflashing attempts). I did never reach "cmd>>:" on either of these boards, so it wasn't flashed. I've looked around it and sounds like #23 (comment) (which turned out to be clone chip and trouble was caused by reversed RX/TX) Unfortunately I don't have another flasher or good 3.3V source right now. Ideally someone would provide a video recording of how to flash this, so one can easily repeat the shown steps. So my specific questions are:
Also tagging @vadimkozhin |
First to answer your questions:
My main concern is your unconventional setup, I'm guessing your chip actually boots up through the power of the tx/rx lines and does not get into flash mode. You could actually use just your ESP32 to flash the chip, I did that in the beginning. For that you could have a look here: #5 (comment) (check out that whole issue, there is some more info there) |
FWIW, I could flash my board using an ESP32 as an uart adapter, see here https://medium.com/@shelladdicted/how-to-use-an-esp32-devkit-as-an-uart-adapter-e698594e0378 |
Yes, that's pretty much my setup. I'm using a nodemcu board as serial adapter, but keep EN on GND, so the ESP is actually turned off (meaning 3V/GND is from the nodemcu voltage regulator and RX/TX are from the USB <> Serial adapter at 3V level).
I figured it was easier to run the python script on my PC and only use the nodemcu 3V and serial port. However, I'm skeptical now whether the nodemcu 3V is stable enough and if the serial port voltage is stable enough. I have gotten it into RESET mode at least twice now, but still no luck flashing:
I'll give up for today. When I find time for this again, I'll probably add a logic analyzer into the mix or go to my hackspace (if time permits) to use some other serial adapter / 3V supply. |
I got some help from a friend at our local hackerspace. We were able to flash both tags! Some observations:
After that I had some trouble registering an apple id (on https://appleid.apple.com/). However, I'm still unable to use my airtags because pyprovision does not work on macOS, yet (Dadoum/pyprovision#3). So far I've modified the Python scripts a bit so they are more reusable (API by default, CLI tools optional). (I'll also try to get back to #35 probably sometime next year) |
Great! well done. Just as a first response, don't try the main branch on macOS, but use the catalina (python2) or monterey (python3) branches. You don't need pyprovision or any other anisette providers if you are on macOS, those two branches patch into the native frameworks to grab the data. They also can read the MME store for the |
About a PR, I don't accept any unless they are bugfixes. I regard this project as finalized, but everyone is free (and encouraged!) to reuse the code in their own projects. Just a mention would be nice though. Flashing those chips is very finicky, as I can say from experience and many other's, like yours as well. It does however pay up to get a couple different usb uarts, as my CP2102 is working very reliably. But a well equipped hackerspace is very useful too! A trusted device is enough for second factor, but I guess you would connect your main apple id to it? And not a burner account made on Apple Music? (great find btw, I'm going to try that as well) On provision, that will be very complex to port to python. Dadoum seems to be a bit of a genius, he wrote some android lib emulation code in D that can hook directly in those libraries that are built for a different libc even. This will prove very difficult to replicate using python ctypes, although the pypush creator managed this using the unicorn emulation layer. To conclude, awesome that you managed to flash your tags! And if you plan to run this on macOS, by far the easiest would be to run either the |
Fair enough; I'll probably make my own repository then.
It'd rather avoid ordering more PCBs I rarely use. Hackerspace was good, but ideally we'll use the available tools there to debug issues with the other adapters so people can keep using whatever they have at hand (with minor software tweaks or some passive component).
I don't really have a main apple id. I use my personal phone number for work (where I'm more or less restricted to a macbook). I plan to use a burner from that Apple Music login (if that works.. which I'll have to check).
Just FYI: I've previously worked on various video game emulators (mainly MIPS, ARM and x86); I also have plenty of experience of porting / decompiling games to other platforms using unicorn-engine for unfinished portions.
My setup will probably also run on some Linux setup in the future (likely my raspberry pi); I'm just doing the development and testing on macOS. As soon as more info becomes available about other searching networks (like the Samsung or Google ones) I'll also consider switching. |
Keep me in the loop, I'm looking forward to that very much!
Yeah me too, not many idevices in my neck of the woods. Although I'm planning on a single firmware to rule them all. |
If it helps I wrote a very detailed Step-by-Step for a certain Tracker but it is 100% adoptable for other models nrf51: |
The README is lacking information on how to wire up the board / chip before running the flasher.
Currently, there's a bunch of useful information that I had to search for myself:
My tags are still on their way from China (fingers crossed they are actually st17h66), so I can't try it yet.
However, skimming over those long issues makes it somewhat hard to get the most up-to-date flashing method.
I'm still not sure how to wire up my UART (or which UART adapter is even powerful enough to do it, as an ESP32 was mentioned as a UART bridge).
Also, is battery power (CR2032, for example) enough while flashing?
The text was updated successfully, but these errors were encountered: