Post Go back to editing

Adalm Pluto Standalone Executable using OTG

Hello. I try to get an executable c program to run automatically at start from an USB stick using the OTG functionality of the Adalm Pluto. I called the file "runme0" without file extension, put in on a USB Stick and hoped that the fie will be executed automatically like shell scripts with the sh extension do without problem. I have tried to run the program directly via ssh and it ran with no problem. What shall I do to get this program to run? Is there a possibility to get an error log?

Parents
  • Can you post your shell script? How have you verified it's not working? Have you tried naming the script with the .sh extension?

    -Travis

  • I have tried the following: 

    1. Compiled the file https://raw.githubusercontent.com/analogdevicesinc/libiio/master/examples/ad9361-iiostream.c on my windows machine. Result is the file runme0 here: (https://www.dropbox.com/s/6mrihqabml1kqby/runme0?dl=0)

    2. Connect the Pluto via USB to the PC and execute the file with SSH after copiing it via SCP. This worked fine.

    3. Copy the executable file to an USB stick and using the OTG functionality according to https://wiki.analog.com/university/tools/pluto/devs/usb_otg. In the standalone mode the pluto did not execute the file.

    4. Copy an additional shell script to the USB stick called "runme0.sh":

    #!/bin/sh
    cd /media/sda1/
    chmod +x runme0
    ./runme0

    5. The script has been executed in standalone mode but the executable file "runme0" did not start. At least the shell script has been executed as I have added some additional commands but the pluto did not start the compiled file "runme0".

    Does anyone know what went wrong? Is there a possibility to log the command line error Messages into a file on the USB stick as this would help a lot for Debugging?

    Thanks,

      Hanno

  • Hello Travis,

    I tried your executable after renaming it correctly. The program still does not execute and the file is not generated. The rest of the script is running so I am now Looking towards the write Access of the USB stick. This may explain why the executable is not running because the "chmod" command could be rejected and the executable therefore is not startable. 

    I tried with 2 USB Sticks now but no success. Did you use FAT or another filesystem? Do you format your drive with Linux or windows? Maybe there are differences.

  • sdf                                                                
    └─sdf1        vfat   TEST     4017-B37F                            /media/tcollins/TEST
    sdg                                                                
    └─sdg1        vfat   PlutoSDR F6F3-FAA0                            /media/tcollins/PlutoSDR
    

    Everything is done in Linux from my side.

    -Travis

  • Hi Travis,

    I have tried now to check if the USB drive is writable under Linux using my RaspberryPi4. After plugging the USB drive in a free Slot the USB drive was automatically mounted as expected and read and write Access was granted.

    Then I unmounted the Drive manually and remount it again with the procedure in the automounter.sh script on the pluto:

    1. mkdir -p "/media/sda1"

    2. mount -t auto -o sync "/dev/sda1" "/media/sda1"

    After this Manual mounting I had no permission to write to the USB drive anymore. So I think the same happens on the Pluto. I do not know what the difference is between the automounter on the raspian and the manual mounting but at this Point there seems to be the Problem. Also after trying to Change the Access rights with "chown" or "chmod" did not succeed in the Manual mounting mode. Maybe you have an idea.

  • I would suggest formatting on a Linux system if you can. Maybe Windows is doing something strange.

    -Travis

  • The executable works now and also the log file is generated. It had Nothing to do with the USB drive, it was the script file that was generated with on Windows. I opened the file with a Linux System, copied the content to a new text file generated in Linux. That was it. There has been a hint on the OTG page around here saying to insert 'LF' at the end of the line using Windows, I think it had something to do with it.

Reply
  • The executable works now and also the log file is generated. It had Nothing to do with the USB drive, it was the script file that was generated with on Windows. I opened the file with a Linux System, copied the content to a new text file generated in Linux. That was it. There has been a hint on the OTG page around here saying to insert 'LF' at the end of the line using Windows, I think it had something to do with it.

Children
No Data