Skip to content

Instantly share code, notes, and snippets.

@0x53A
Last active April 19, 2021 15:47
Show Gist options
  • Save 0x53A/d982e5e70380d2ca4cc0ebe7d8272083 to your computer and use it in GitHub Desktop.
Save 0x53A/d982e5e70380d2ca4cc0ebe7d8272083 to your computer and use it in GitHub Desktop.

I got a glasgow revC1 board a while ago, but never had the time and/or motivation to actually try it out until now.

With help from the 1BitSquared discord/irc I got far enough that the glasgow CLI runs on my windows system and the board is recognized.

Steps:

(note: these are after the fact from memory, I hope they are mostly correct)

  1. cloned https://github.com/GlasgowEmbedded/glasgow into C:\glasgow\repo\glasgow
  2. installed python 3.8 from the windows store
  3. executed python setup.py develop --user inside C:\glasgow\repo\glasgow\software
  4. added C:\Users\lr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts to the path (there should be a glasgow.exe in this folder)
  5. downloaded libusb windows dll from https://libusb.info/
  6. (didn't work, DLL not loaded by python) copied libusb-1.0.dll into C:\Users\lr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts next to python.exe
  7. (didn't work, DLL not loaded by python) copied libusb-1.0.dll into C:\Users\lr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts next to glasgow.exe
  8. (worked) copied libusb-1.0.dll into C:\Windows\System32 (not advisable for general users, I got impatient)
  9. at this point I could run the glasgow CLI, but it didn't detect the board. When plugging in the board, windows showed an error "usb device not recognized"
  10. after switching port and cable, using Zadig to change the driver to libusb-win32 (I think), and unplugging and replugging it once more, it worked! Note that during the installation of the driver I got another "device not recognized" error, but it did work after re-plugging it.
  11. at this point glasgow list shows the board.

Thank you!

Can't wait to actually use it, probably next weekend

Additional notes:

Environment

Windows 10 x64 2004

Physical USB port / cable / Zadig:

(Not sure if it is relevant, but at first I plugged it into a USB3 port, then later the working configuration was with a USB2 port.)

I thought I had connected glasgow with a known-working cable to a known-working port, but when I tested it with a different device, I also got an error.

I think in some cases, if there is an issue with a device, Windows will just stop recognizing the whole port until a restart.

After changing port and cable the device was recognized by device manager as Glasgow Debug Tool, though with a yellow triangle, and glasgow list failed with usb1.USBErrorNotSupported: LIBUSB_ERROR_NOT_SUPPORTED [-12].

Then I used Zadig to replace the driver. As mentioned above, windows did show an error during the installation, but it worked after a re-plug.


More Notes

pip install -e glasgow/software pip install -e ./software[toolchain]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment