Ubuntu: PNUt & Wine works fine! (only a com1 link is required)
Bill Henning
Posts: 6,445
I wanted to move some Prop2 software development to my main workstation, which runs Ubuntu 12.04 64bit (the "Long Term Support" version)
PNut appeared to run fine under Wine, but it could not find the PropPlug, which was at /dev/ttyUSB0
The (easy) answer was to map /dev/ttyUSB0 to COM1 for Wine, which you can do from a terminal by executing the following line:
For a nice simple terminal program just use GtkTerm, which you can install from the Ubuntu software center. Just remember to close it before programming the P2 emulator.
Note:
Your PropPlug may show up on a different /dev/ttyUSBn
PNut appeared to run fine under Wine, but it could not find the PropPlug, which was at /dev/ttyUSB0
The (easy) answer was to map /dev/ttyUSB0 to COM1 for Wine, which you can do from a terminal by executing the following line:
ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1
For a nice simple terminal program just use GtkTerm, which you can install from the Ubuntu software center. Just remember to close it before programming the P2 emulator.
Note:
Your PropPlug may show up on a different /dev/ttyUSBn
Comments
Hi Bill, I've tried GtkTerm but I actually prefer the non-GUI minicom far better. Another trick I use with minicom to disconnect it is simply type a ^AP so that the comms parameter menu pops up and the port disconnects. After the download just hit the esc key to return back again.
BTW, you would think Wine would just setup symbolic links to the comports in the first place or at least link to ports at runtime.
You can even use the windows version
Thanks Steve - right now I am using PNut directly, but once I use PropGCC, I will use David's nice loader - with its simple terminal.
Just tried with easy success using latest P123-A9 image file from http://forums.parallax.com/discussion/162298/prop2-fpga-files/p1
I even accidentally identified the embedded Prop1.
PS: Image loaded using the ported PX - http://forums.parallax.com/discussion/162989/lazarus-port-of-px/p1
Take the "all_cogs_blink.spin" program: There is no change in the red or green LED grid. Just the one RED0 LED is lit. It's like nothing has been sent. EDIT: The RED0 LED in the grid flashes once at the start of the download.
The PGM/RUN switch is in RUN position, I get a "No hardware found" message when in PGM position.
From my un-successful research, they (wine guys) changed the way serial ports were handled or implemented a new wine feature and broke it for some programs. I found people reporting similar problems with other programs using serial but no solutions.
The point that PX works and PNUT doesn't is frustrating and misleading.
Hope to hear from other P2 folks to see if they are having success with the latest wine and p2.
Bother, so I'm not doing anything wrong then. That sucks.
Don't have a quick roll back for further ...
Try this version of PNut.exe. You must rename PNut.txt to PNut.exe.
I was changing the baud rate without closing and reopening the port. Maybe wine didn't like that. Now I close the port and reopen it with the 2M baud rate.
This runs on my machine. If this works with wine, that will be great.
RED0 LED now blinks twice instead of once. Once at the start, same as before, but also right at the end when the blue Rx led goes out.
Still not working though.
Thanks for testing that. I wonder what else could be the issue. If ctrl-G works okay, the rest should be able to work, too, if we could figure out where the problem is occurring.
It worked on p2hot so I don't think it is anything you changed in pnut. If I recall, Propeller Tool also used to work on old wine but fails on new wine. We know Propeller Tool hasn't changed. :0)
So, I've now tested Wine 1.4 - June 2012. Still no cigar. The P123 board behaved the same it did with both versions of PNut.
See attached screen shots. Orange is Tx (pin20) and Green is Rx (pin4).
This scope capture is from a [F11] run program command from within PNut_v10.exe. The program selected is the small "all_cogs_blink.spin2" program. Transferring at the PNut end looks fine. Progress bar happens and there is no errors. It seems to complete okay.
The Program never runs on the Prop2 though. As per previous posts, the single red Cog activity LED blinks out twice during transfer and that's it. Nothing further happens.
There is also some tiny glitch like pulses that appear to be a single instruction execution time in length - maybe up to 50ns long, the scope is struggling with them. They also occur at notable times.
It looks like the Prop2 is responding to each phase of the download ... not sure what else I can glean at this stage ...
I might have a need to use Wine so I might hookup my mso and see what I can see as I also want to make sure my temporary PIC serial second stage bootloader works correctly too.
PS: Maybe there is proper probing tools for this, but I did a hack job.
edit: anyway, I have the BeMicroCV-A9 board with my own compatible PropPlug on pin headers so it's too easy to get to anyway.
oops - too large - did it again
Actually looks like wine is opening and closing the port, that's always the trouble with using DTR lines.
A detail on the single vs double port open: Chip did change PNut a month or so back on that front. So, make sure you're using the latest PNut on all tests.
It would seem the Prop is not listening when the obj data is being sent.
EDIT: Trace colours are:
Blue is DTR/reset to the Prop2/FPGA
Pink is the RED0 LED indicating Cog0 activity
Orange is Tx data from the PC
Green is Rx data to the PC
">Actually looks like wine is opening and closing the port, "
Wine will do an open() and a close() on the port, although it's strange if it's doing that more than once.