Shop OBEX P1 Docs P2 Docs Learn Events
how to make pnut use just one com port and not scan? — Parallax Forums

how to make pnut use just one com port and not scan?

Larry MartinLarry Martin Posts: 94
edited 2022-05-17 17:04 in PASM2/Spin2 (P2)

I'm trying to load my first P2 board via PropPlug with pnut v35s and it is hanging up on one of my VCPs. The bad VCP is a bluetooth com port with the far end not running, so writes to the driver hang up. In P1, I always use "propellent /port com <file.spin>" to specify the com port, so I avoid problems arising from port scan. Weird VCP driver aside, I often debug two P1s at a time by controlling the COM port number fed into propellent.exe. So COM port scanning will not work on my development system.

How can I select the COM port in P2 development?

Going through the PNut GUI, I tried Run, Change from COM port 1, but pnut still scanned when I hit F10 to compile and load to RAM. I got the source from github but couldn't find a "main" function or any command line parsing in a few minutes of poking around. So I have to ask the question.

Edit: the PC is Win10

Comments

  • AribaAriba Posts: 2,690

    Use Propeller Tool, there you can edit the port search order and exclude ports.
    Menu: Edit -> Preferences -> Tab: Operation -> Button: [Edit Ports]

    With PNUT it helps to select the COM port every time before you download, also if the COM port you want is already selected.

    Andy

  • Hi Andy, thanks for the advice. I'm sorry, but I really don't like Propeller Tool. Starting with P1 in 2010, I have used Propeller Tool as little as possible, in favor of emacs, propellent.exe and bstc. I respect the work that has gone into Propeller Tool, but it doesn't fit my "idiom."

    That said, PNut is now doing what I wanted. I have a local copy of PNut_v35s.exe in my source folder. Opening the GUI and setting the COM port has no effect on programming in the GUI, as stated in my OP. BUT, the next time I ran pnut from the command line with "PNut_v35s -r", it went right to the COM port that I set in the GUI. I can tell it's in the right place because the PropPlug shone blue for a second.

    I'm not sure anything actually programmed, but that's a question for tomorrow.

  • If you want a less janky command line loader, try loadp2. The binaries on Github are a tad old though, better build it yourself or yoink the binary from a current FlexProp build (bin directory)

  • evanhevanh Posts: 15,916
    edited 2022-05-17 21:49

    @Wuerfel_21 said:
    If you want a less janky command line loader, try loadp2. The binaries on Github are a tad old though, better build it yourself or yoink the binary from a current FlexProp build (bin directory)

    Damn, it's worse than I was expecting, I only just noticed that pnut.exe -c doesn't produce the finished .bin. It only builds the .obj files.

    What I've done previously when wanting to use loadp2 is drag'n'drop into Pnut window, then use F9 to build, then loadp2 -p <comport> -t -b 230400 <name>.bin

    I'd probably forgotten why.

    EDIT: If pnut.exe -r is failing to download then it can be used together with loadp2 ... eg:

    filename=arccos-test;   echo; wine /home/evanh/hoard/coding/prop2/bin/PNut_v35s.exe ${filename}.spin2 -r; loadp2 -p /dev/serial/by-id/usb-Parallax_Inc_Propeller_P2-ES_EVAL_P23YOO42-if00-port0 ${filename}.bin -t -b 230400
    
  • Thanks, Evan and Wuervul_21. I am having trouble with the file formats, for sure. pnut is not making a .bin file either with command line -c or GUI F9. But command line pnut -r **is ** loading the chip. It happens so fast compared to P1 that I doubted it was really happening, but I can see my code changes take effect.

    Also, my OP is wrong. Today, PNut_v35s.exe in GUI mode is going right to my preferred COM port. IDK if I needed to stop and restart before deciding it was still scanning ports, or what, but it is no longer scanning for ports in either GUI or command line modes.

    Thanks again for your help, and all the work you put into these tools.

Sign In or Register to comment.