[BX] Error: 'device reports readiness to read but returned no data' [SOLVED]


#1

I am attempting to upload a *.bin file to a fresh TinyFPGA BX board. I started getting the error above so I tried simply switching the board into bootloader mode using the following command:

sudo tinyprog -b -d 1d50:6130

I received the following message (identical to the error I got running -p hardware.bin):

TinyProg CLI

Using device id 1d50:6130
Only one board with active bootloader, using it.
Booting /dev/ttyACM0

… followed by a traceback with a number of calls, and finally:

'device reports readiness to read but returned no data ’
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

Any thoughts? Perhaps some USB issue on my machine?


#2

The -b option actually exits bootloader mode and tries to load the user bitstream loaded on the SPI flash. Pressing the reset button on the BX board will enter the bootloader.

The error message appears because once the bootloader exits, it can no longer function as a USB device (unless your design implements a USB device).

You should be able to press the reset button and use -p to program a bitstream. You shouldn’t need to use the -d flag.


#3

Thanks. Might be time for me to read through tinyprog --help more thoroughly…

I tried running:
sudo tinyprog -p hardware.bin
and the first part seemed to work:

TinyProg CLI

Using device id 1d50:6130
Only one board with active bootloader, using it.
Programming /dev/ttyACM0 with hardware.bin
Programming at addr 028000
Waking up SPI flash
135100 bytes to program
Erasing: 24%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ | 32.8k/135k [00:00<00:00, 162kB/s]

then I got this error:

File β€œ/usr/local/lib/python2.7/dist-packages/tinyprog/init.py”, line 21, in to_int
return int(value)
ValueError: invalid literal for int() with base 10

Seems like an int overflow? I tried with both python 2.7.6 and 3.4.3 (at least I think I did, I just added an alias to my ~/.bash.rc and running python --version to check).


#4

Ah! Found this thread:


I have a JTAG programmer. Will examine and update this post.

update
I don’t think I nuked the bootloader; when I hit the reset button I get the following when I run tinyprog:

TinyProg CLI
------------
Using device id 1d50:6130
Only one board with active bootloader, using it.

which is different than what @shenki saw.


#5

Yeah, this is a different issue. He had a problem in stage two of a bootloader update, that’s different from programming the user bitstream.

If you try again do you get the same error?


#6

The first time I ran sudo tinyprog -p hardware.bin I saw:

'device reports readiness to read but returned no data ’
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

I ran tinyprog and saw:

  TinyProg CLI

Using device id 1d50:6130
Only one board with active bootloader, using it.

then ran sudo tinyprog -p hardware.bin again and saw:

TinyProg CLI
------------
Using device id 1d50:6130
Only one board with active bootloader, using it.
Programming /dev/ttyACM0 with hardware.bin
Programming at addr 028000
Waking up SPI flash
135100 bytes to program
Erasing: 0%| | 0.00/135k [00:00<?, ?B/s]

followed by a few tracebacks, that last of which is:

File β€œ/usr/local/lib/python2.7/dist-packages/tinyprog/init.py”, line 21, in to_int
return int(value)
ValueError: invalid literal for int() with base 10: β€˜β€™

The erasing bar now stops at 0%. I believe otherwise the error is similar to before.


#7

Do you have modemmanager running on your machine? If you do, it opens and probes /dev/ttyACM0 and corrupts any data stream being written. If that is the problem, you need to stop or disable the modemmanager service, or uninstall it. I hit that problem with my BlackIce board.

Also you can add your user to the dialout group to avoid having to do sudo to get access to /dev/ttyACM0.


#8

I ran mmcli -L and saw:

No modems were found

so I don’t think this is the issue.
Thanks for the tip on the dialout group for /dev/ttyACM0. I tend to sudo because I am lazy. Not a great habit.


#9

The problem is that a background modemmanager service runs and when it detects a usb device connected, it opens it and probes it. It might change the properties of the connection. As you have mmcli on the machine, you must have modemmanager installed, and I believe it will cause problems. You should try stopping or disabling the modelmanager service. I don’t think mmcli reporting no modems means you don’t have a problem with modemmanager. However, it might not be causing your current problem as it tends to cause problems just after you connect the usb device.


#10

In fact I think modemmanager opens and probes the device after it is reset, which tinyprog probably does. That will cause tinyprog to fail, but modemmanager will decide it is not a modem that is connected after sending it a few commands, so mmcli will probably report no modems. (I am not certain of this sequence but I do think you should stop the modemmanager service and see if it is the problem).

modemmanager is well known for stopping other things from working such as the Arduino IDE.


#11

sudo apt-get purge modemmanager
sudo tinyprog -p hardware.bin

TinyProg CLI
------------
Using device id 1d50:6130
Only one board with active bootloader, using it.
Programming /dev/ttyACM0 with hardware.bin
Programming at addr 028000
Waking up SPI flash
135100 bytes to program
Erasing: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 135k/135k [00:00<00:00, 144kB/s]
Writing: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 135k/135k [00:00<00:00, 203kB/s]
Reading: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 135k/135k [00:00<00:00, 431kB/s]
Success!

Worked. Thanks for your help, @lawrie.griffiths and @lukevalenty!


#12

Awesome, it’s working! Thanks for your help @lawrie.griffiths, I’ve known the modem manager will block connections to the TinyFPGA bootloader, but I haven’t seen this error signature before.