Skip to content
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

Use longer timeout, fixing entering RAW1 on macOS #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

satoshinm
Copy link

@satoshinm satoshinm commented Dec 11, 2017

Trying to get this working on my system (macOS High Sierra), stepping through the code, it was able to send 0x0f and read BBIO1 (entered binary mode), but then it would always fail to enter RAW1 mode:

$ python flashSTM32.py  
Traceback (most recent call last):
  File "flashSTM32.py", line 41, in <module>
    main()
  File "flashSTM32.py", line 18, in main
    busPirate = PirateSWD("/dev/tty.usbserial")
  File "pirate-swd/PirateSWD.py", line 8, in __init__
    self.resetBP()
  File "pirate-swd/PirateSWD.py", line 22, in resetBP
    raise SWDInitError("error initializing bus pirate")
SWDErrors.SWDInitError: error initializing bus pirate

Tracked it down to reading an empty string here:

        if self.port.read(4) != "RAW1":
            raise SWDInitError("error initializing bus pirate")

because the timeout 0.01 is too short. After changing it to 0.1 in this pull request, able to read RAW1 successfully.

@satoshinm
Copy link
Author

0.1 seconds may be insufficient, I can get as far as probing an STM32F103C8T6 blue pill board using a Bus Pirate 3.6a with RC6.0 firmware, but when flashing it reads an empty string again. Changing to 1 second works, but then each command takes 1 second to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant