Upload Problems Atom and Termina


#1

Hi all,
I’ve bought the TinyFPGA BX in order to learn a little bit of FPGA programming. Since my first board was broken I received now a second one and it has been recognized by tinyprog unlikely the first one.
Now if I try to upload the blink program according to the description in the User guide with Atom I’ll receive the following error message:

tinyprog --pyserial -c /dev/ttyACM0 --program hardware.bin

TinyProg CLI

Using device id 1d50:6130

Traceback (most recent call last):
File “/home/david/.local/lib/python3.6/site-packages/serial/serialposix.py”, line 265, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
OSError: [Errno 16] Device or resource busy: ‘/dev/ttyACM0’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/david/.local/bin/tinyprog”, line 10, in
sys.exit(main())
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/main.py”, line 323, in main
with active_port:
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 60, in enter
self.ser = serial.Serial(self.port_name, timeout=1.0, writeTimeout=1.0).enter()
File “/home/david/.local/lib/python3.6/site-packages/serial/serialutil.py”, line 240, in init
self.open()
File “/home/david/.local/lib/python3.6/site-packages/serial/serialposix.py”, line 268, in open
raise SerialException(msg.errno, “could not open port {}: {}”.format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyACM0: [Errno 16] Device or resource busy: ‘/dev/ttyACM0’
scons: *** [upload] Error 1
========================= [ ERROR ] Took 0.88 seconds =========================

I’ve double checked it on my site if there is some other process that try to speek with the controller.But there was no other controller. Then I’ve tried to do the upload via the terminal and I got a completly other error messge:
tinyprog --pyserial -c /dev/ttyACM0 --program hardware.bin

TinyProg CLI
------------
Using device id 1d50:6130
Programming /dev/ttyACM0 with hardware.bin
Programming at addr 028000
Waking up SPI flash
135100 bytes to program
Erasing:  73%|███████████████████▋       | 98.3k/135k [00:00<00:00, 135kB/s]

Traceback (most recent call last):
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 19, in to_int
return ord(value)
TypeError: ord() expected a character, but string of length 0 found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/david/.local/bin/tinyprog”, line 10, in
sys.exit(main())
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/main.py”, line 346, in main
if not fpga.program_bitstream(addr, bitstream):
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 419, in program_bitstream
return self.program(addr, bitstream)
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 375, in program
self.erase(addr, len(data), disable_progress=False)
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 347, in erase
self._erase(addr, erase_length)
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 301, in _erase
self.wait_while_busy()
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 290, in wait_while_busy
while to_int(self.read_sts()) & 1:
File “/home/david/.local/lib/python3.6/site-packages/tinyprog/init.py”, line 21, in to_int
return int(value)
ValueError: invalid literal for int() with base 10: b’’

It is strange. It looks like that there is either a problem with the init script of tinyprog or I’m using the wrong python version (3.6.8) and pip3 version 19.1.1. I’m using Ubuntu 18.04.2 LTS.
Is there anyone who faced the same problem or knows the solution??

Thank you very much for your help

Regards
David


#2

Have you disabled ModemManager?


#3

Hi Luke,
thanks for your reply. No I did not. But after I disabled the ModemManager atom is not able to find the board anymore. On the terminal I’m facing the same problem with the conversion as before.

Regards
David