2
\$\begingroup\$

I have used TinyProg on Linux before to program the TinyFPGA-BX board just fine, but I am having issues with macOS on an M1 Powerbook. Apio finds the serial device just fine:

apio system --lsserial

Number of Serial devices found: 1
/dev/cu.usbmodem13201
Description: IOUSBHostDevice
Hardware info: USB VID:PID=0483:5740 LOCATION=0-1.3.2

But when I do the following to list serial devices with TinyProg, I get this:

tinyprog -d 0483:5740 -c /dev/cu.usbmodem13201 -l

TinyProg CLI
------------
Using device id 0483:5740
Boards with active bootloaders:
    No active bootloaders found.  Check USB connections
    and press reset button to activate bootloader.

The board works fine on Linux and has a bootloader. I tried updating the bootloader (on macos), but it states it is up-to-date. i.e

tinyprog -d 0483:5740 -c /dev/cu.usbmodem13201 --update-bootloader

TinyProg CLI
------------
Using device id 0483:5740
All connected and active boards are up to date!

Any ideas anyone?

A thought? I do have issues with USB running at full speed on the M1, is there a way to slow it down for Tinyprog?

Update

Seems using the --pyserial option to tinyprog works. It takes about a minute to start working, but it works ..I do wonder if it is a speed/cable thing .. using the --libusb option results in a programming attempt, but a failure in verify ..

\$\endgroup\$
1
  • \$\begingroup\$ Your suggestion in the update to add --pyserial worked for me, thanks! \$\endgroup\$ Commented Aug 20, 2024 at 19:31

1 Answer 1

1
\$\begingroup\$

I'm having the same problem setting up my toolchain on MacBook Air M2.

I do found a workaround but have no clue why it works. Hope someone who understands pyusb more can explain or find a real solution for this.

Go to your tinyprog package __init__.py and comment out if not d.is_kernel_driver_active(1)

def get_ports(device_id):
    ...
    if platform.system() == "Darwin" or use_libusb:
        import usb
        vid, pid = [int(x, 16) for x in device_id.split(":")]
        ports += [
            UsbPort(d)
            for d in usb.core.find(idVendor=vid, idProduct=pid, find_all=True)
            # if not d.is_kernel_driver_active(1)
        ]
    ...

for me the file is at .venv/lib/python3.11/site-packages/tinyprog/__init__.py

I have successfully upload my program into my TinyFpga BX after remove this check.

\$\endgroup\$
1
  • \$\begingroup\$ thank you StoneLin, your solution worked for me, I am on a x86 MacBook Pro running Sequoia 15.2 \$\endgroup\$ Commented Jan 22 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.