Open jemo07 opened 1 year ago
The project does assume that /dev/ttyUSB1
is the right usb-serial adapter.
The icestick 'looks' like a typical ftdi USB-serial adaptor with two ports: the first is connected so as to allow its use as a programmer (which iceprog finds by its own method - clearly is working here).
The second is connected via just tx and rx as a TTL level uart, and it's this one that shell.py is to be connected to, so you can talk to the swapforth system.
Most of the time the problem is just that you may have another usb-serial adaptor already connected, so the numbering (the 1
in /dev/ttyUSB1
) is wrong in this case.
run ls /dev/ttyUSB*
and see if there are other entries there - perhaps ttyUSB1 is currently some other usb-serial adaptor coincidentally plugged into your system? Maybe /dev/ttyUSB3
is the one you need?
On the other hand, I have had j1a builds that refused to connect - usually due to wrong baud clock settings. The serial port on the j1a is a fixed-speed only, and needs tweaking if the design clk rate is changed, for example by getting different PLL settings using icepll. Shouldn't be doing it out of the box though.
Hello and thank you for followup, yes, I can see the two USB devices..
ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1
If I remove the card, there are none.
ls /dev/ttyUSB*
zsh: no matches found: /dev/ttyUSB*
I'm not sure if this might be an issue with the diver?
apio system --lsftdi
(DEBUG) Profile path: /home/jemo/.icestudio/apio/profile.json
(DEBUG) Home_dir: /home/jemo/.icestudio/apio
(DEBUG) Run Command: lsftdi
(DEBUG) System_base_dir: /home/jemo/.icestudio/apio/packages/tools-oss-cad-suite
(DEBUG) System bin dir: /home/jemo/.icestudio/apio/packages/tools-oss-cad-suite/bin
(DEBUG) Executable file: /home/jemo/.icestudio/apio/packages/tools-oss-cad-suite/bin/lsftdi
Number of FTDI devices found: 1
Checking device: 0
Manufacturer: FTDI, Description: Dual RS232-HS
Maybe the APIO is breaking things?
Hi, just tried it on another two boards, they all fail... not sure what could be going on... reading through this http://www.latticesemi.com/~/media/LatticeSemi/Documents/ApplicationNotes/IK/iCE40sysCLOCKPLLDesignandUsageGuide.pdf?document_id=47778 to see if I can get up to speed on possible issue. Where in the code should I address the clk?
Hi, I think the issue is that the connect python script is actually for python 2.x not python3.
I took a fresh git clone of the repo, cd'd into j1a, and did make; make j1a
with an icestick plugged in.
All went well, but make connect
failed (Because I don't have python visible to root). So I tried with:
PYTHONPATH=../shell:$PYTHONPATH python shell.py -h /dev/ttyUSB1 -p ../common/
I had the same result you had - so it's certainly not just you. (my global 'python --version` is 3.10.8 on this system, I am using pyenv).
On a hunch, I wondered whether the issue is that the python code is written for python2.x, so:
in the j1a directory, I just did a pyenv versions
to see if I had a python2.x around (I did), then enabled it locally with pyenv local 2.7.18
, after which PYTHONPATH=../shell:$PYTHONPATH python shell.py -h /dev/ttyUSB1 -p ../common/
worked for me. I got:
Contacting... established
Loaded 143 words
>
(I had previously installed pyserial with pip).
pyenv is highly recommended to deal with issues of this nature, rather than using python3 or python2, you just call python directly. The above pyenv local setup automatically manages making that python2 of that specific installed version I had, in that directory.
Else, it's probably not a huge issue for someone to fix by bringing the python code in this project up to date. (other outstanding 'easy' issue: changing to use nextpnr rather than arachne-pnr).
PS. 143 words is just basewords, you probably want to #include swapforth.fs
at that point to get the complete system so nice things like -1 leds
works. If you reconnect after that, you'll get Loaded 207 words
if swapforth is loaded.
You can save out the exact state of the swapforth system ram, and have it ready to be rebuilt into the fpga image, by running (on the j1a, via shell.py) #flash build/nuc.hex
then disconnecting and rerunning make; make j1a connect
. This is how you get it to load an app right from poweron - the FPGA config also bootstraps the system with pre-programmed initial ram state.
PPS. Might be nice to be able to use icebram to update the fpga bitfile with the loaded forth state, rather than having to wait for the whole FPGA image to be rebuilt from source when the ram contents change - another nice little 'quality of life' project for someone ;)
Ah, thank you for the follow up, this did fix the problem... now I can at least hunt down the issue and try to fix it for everyone... will be on two weeks time, I'm on stringent project at the moment. THANK YOU @RGD2 again for following up!
I did not have success with the python script but did succeed using GTKTerm
Hello,
I just tried accessing the board after loading the bin... and I get an empty screen.
This is the output loading the bin file;
I'm on linux
I'm hoping you can provide some guidance on to solve this.