-
Notifications
You must be signed in to change notification settings - Fork 58
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
Getting Permission errror, Access is denied when flashing ST17H66 #23
Comments
I should also add that I have hooked up putty to the device and it doesn't complain of port being used, so that's not the issue. Also, when connecting to putty and I connect the TXD and RXD, I do get funky characters but it pumps something whenever I retouch the pads. However, as soon as I connect power, putty kicks me out with an error along the lines with you can't do that(error with serial interface). So, maybe it's a windows setting, etc? If so, I'm unaware what it could be - I looked in device manager and messed with a few settings, but same output. I also just disabled my antivirus(sentinel one) in hopes that maybe it's blocking it, but nope. |
Also wanted to mention, for ground and power, I'm using the connectors on the bottom vs the pads on the top. Don't think it matters, but figured I'd throw it out there. I did notice that if I just apply power to the board with TXD and RXD disconnected, putty will give me the same connection error. Maybe it's the board? Power and ground is coming from the usb flasher. |
I think I got a little further. I saw someone saying they used the 5v connection. Since I have a few to work with, I gave it a shot. With putty and the program, I don't get the access problem. Now, my question is what output should I see/expect to happen? Does anyone have a sample output or tell me what I should expect? I run generate_keys.py, use the hashed adv key from the .key file and pass it as a parameter to flash_st17h66.py. |
The output should have a lot of #OK lines, so if you are not sure it's working, it's definitely not. It's possible that your USB UART does not provide enough power to the st17h66 to flash it, what's the chip on your dongle? |
Biemster, Here's the output of one without the adv key. Strangely, I had to keep connecting the power from the tag to move from line to line:
Looks like if I don't put a key in there, a default one is burnt for me. Since then, I did make a device on openhaystack, grab it's adv key and pass it in to flash_st17h66.py and marked it as deployed. Assuming I did that all right, I'd assume I'd see that tag come online, but nope. When I tried to use the adv key that was built from generate_keys.py, IIRC, the flash.py didn't like the adv string. |
That output looks right, so that's working! Do you have a bluetooth app like nRF Connect or something to check the advertisements around you? |
I don't, but I'll see if I can get one. As for the error, I don't have it - I think it was something along the line of the string is not valid, then it would default to the default key. Let me plug away a bit and see if I can gather more info. Thank you for the help! |
nRF Connect is just an app on your phone, very useful for this kind of stuff. |
Biemster, We got further, sorry the, "bad" key was because I was rushing and was using the hashed adv key. Now it seems ok. Now we run the report, but don't see it. So we're troubleshooting...edit, I think we got one working! It went alot smoother using a brand new one, maybe we bricked our test one as we've done so much to it. Thank you! |
@gammadog808 I am also using the same CH340 flasher and I might be encountering the same issues you had on my Mac. Do mind sharing which wires you connected on your CH340 to which pads on the ST17H66? This is the output from terminal:
|
@danhuanggt does your Mac have a FindMy/Lenze_ST17H66/flash_st17h66.py Line 74 in ed375cb
I kind of remember macOS using a different naming scheme for this, if so you should edit that line in the flasher. |
I am using @biemster do you think it could be my CH340 UART? I do have a CP2102 I could try. Were you successful in using that particular UART? |
It's definitely possible your CH340 is not able to provide enough power to flash the chip. When you put the st17h66 in programming mode it starts to consume several 100s milliamps for some reason, I had the same issue before with a PL2303: #5 (comment). I had better luck with a CP2102 after that, so yes please try with that one. |
Dan, it's been a while, but I do know I had to use the 5v output, the 3.3v never worked for me. |
Update: So I've tried both the CH340 (running on 5v, thanks @gammadog808) and the CP2102, looks like I've gotten a bit further. When I start the script I hear repeated light clicking, when I connect 3v3 shortly after, the clicking gets louder but the flashing stalls. During the script, whenever I touch 3v3, it outputs Any ideas why it isn't reaching This is the latest output:
|
Did you try it with tx and rx the other way around? Also for me it usually doesn't work on the first try, just cycle the power a few times. I have a loose dupont cable on the 3v3, press it in the breadboard to power the chip, and if I don't get |
Okay @biemster I will attempt that next. Could it also be that my IC chip isn't actually a ST17H66? The labeling is sanded off, but it matches a lot of the diagrams I see online. It also has a button, which I'm not sure if that makes any difference. Here is how I am currently connected via the CP2102: I'm a software guy by trade but hardware was my first love, so I apologize for all the clarifying questions -- Let me know if I should start another issue instead of continuing in this thread. |
Yeah that's not a st17h66, but a clone. I got a few tags with them, and @agittins managed to actually flash one of them (biemster/st17h66_RF#8), but I did not have time to try out mine yet. Good idea to follow up on that issue there indeed, and leave this closed. |
just to close this side discussion, it was the tx and rx reversed (biemster/st17h66_RF#8 (comment)). Happens to me all the time as well. |
Hi guys,
As requested by Biemster, I made my own thread on this.
I'm trying to flash a ST17H66(in windows), looks to be the same from the first post. When I run the flash program, wait a few seconds and apply 3v3 to the board, I get this error in python:
Traceback (most recent call last):
File "C:\dit\FindMy-monterey\Lenze_ST17H66\flash_st17h66.py", line 80, in
res = uart.read(10)
File "C:\dit\venv\lib\site-packages\serial\serialwin32.py", line 295, in read
raise SerialException("GetOverlappedResult failed ({!r})".format(ctypes.WinError()))
serial.serialutil.SerialException: GetOverlappedResult failed (PermissionError(13, 'Access is denied.', None, 5))
Not sure why I get this error - I'm logged in as thee administrator, ran pycharm(or cmd) as admin, but no dice. Even moved the default COM port on the usb flasher, still no luck.
Modified the COM line in the .py:
#uart = serial.Serial('/dev/ttyUSB0', 9600, timeout=0.01, inter_byte_timeout=0.01)
uart = serial.Serial('COM6', 9600, timeout=0.01, inter_byte_timeout=0.01)
BTW, I'm using the Monterey branch and newer 3.9/3.10.3.11 versions of python.
Any ideas?
The text was updated successfully, but these errors were encountered: