ADC not working "Stretch", used to work on Jessie; "libprussdrv.so: cannot open shared object file:"

114 views
Skip to first unread message

terra ÜÝÜ

unread,
Sep 25, 2017, 4:07:50 AM9/25/17
to BeagleBoard
Hi All,

I have updated the image which is running of SD card
root@beaglebone:/tmp# uname -a
Linux beaglebone 4.4.84-ti-r120 #1 SMP Sun Aug 27 03:11:07 UTC 2017 armv7l GNU/Linux

have a very simple cpp program which used to work, and now doesn't; when running gives error
"./adctest: error while loading shared libraries: libprussdrv.so: cannot open shared object file: No such file or directory "

Any Help would be greatly appreciated

Warm Regards,
MB




//#define ultrasonic1 0    
//#define ultrasonic2 1    
//#define ultrasonic3 3    

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <bitset>

using namespace std;

       
#include <unistd.h>
       
#include <sys/stat.h>
       
#include <fcntl.h>
       
#include <stdio.h>
       
#include <errno.h>
       
#include <stdlib.h>
#include <string.h>

       
int main()
       
{
               
const char *ultrasonic1 = "/sys/bus/iio/devices/iio:device0/in_voltage0_raw";
               
const char *ultrasonic2 = "/sys/bus/iio/devices/iio:device0/in_voltage1_raw";
               
const char *ultrasonic3 = "/sys/bus/iio/devices/iio:device0/in_voltage2_raw";
               
int fd, len, ultrasonic1reading,ultrasonic2reading,ultrasonic3reading;
               
unsigned long count = 0;
               
unsigned long errorcount = 0;
               
char adc[5] = {0};



               
while(1){

                        fd
= open(ultrasonic1, O_RDONLY|O_NONBLOCK);
                       
if(fd == -1){
                                printf
("error: %s %d\n", strerror(errno), errno);
                                printf
(" Cannot open file");
                                errorcount
++;
                               
exit(1);
                       
}


                        len
= read(fd, adc, sizeof(adc - 1));

                       
if(len == -1){
                                close
(fd);
                                printf
(" error with read data ");
                                errorcount
++;
                               
continue;
                       
}
                       
else if(len == 0){
                                printf
("%s\n", "buffer is empty");
                                errorcount
++;
                       
}
                       
else{
                                adc
[len] ='\0';
                                cout
<< " 3 ";
                                printf
("%s ", adc);
                       
}

                        close
(fd);

                        cout
<< "count is " << count << " errors " <<errorcount << '\n';
                        count
++;
               
}

               
return  0;
       
}



terra ÜÝÜ

unread,
Sep 25, 2017, 4:25:47 AM9/25/17
to BeagleBoard
Problem was with compiler settings to use the "old" style pru while doing the cross compiling
Reply all
Reply to author
Forward
0 new messages