--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I just managed to compile and run the libpruio example apps on beaglebone white PRU.
I was experimenting with the button.c, trying to set the pin 8_07 as active high, using ->
if (pruio_gpio_set(io, PIN, PRUIO_IN_0, PRUIO_LOCK_CHECK)) {
printf("failed setting PIN (%s)\n", io->Errr); break;}
But, when I compile and run it, I still see its '1'.
./analyse reveals->
P8_07, GPIO 2/02: input, pullup
Am I missing something?
Forgive me if this sounds like a stupid question. Please help.
Thanks and regards,
Shoaib Ahmed.
Am I missing something?Forgive me if this sounds like a stupid question. Please help.
Hey TJF,I'm currently working on underwater ultrasonic sound and wonder if you think that with your library can produce constant and reliant ADC input at sample rates of 200Khz per pin
On top of that I'm interested to see version 0.2 and the ring buffer you're been talking about.
Since it seems that you've already been able to produce results with the ring buffer, I only need to read ADC input right now and I'm on a tight schedule right now I would like to ask you if you want to provide a test version of said feature. I can provide the results of the tests.
pruio_adc_setStep(Io, 9, 4, 0, 0, 0); // step 9 for AIN-4
pruio_config(Io, Samples, 1 << 9, 6285, 4); // '1 << 9' -> step 9, '6285' ns -> 159.1 kHz
pruio_rb_start(Io);
#include "unistd.h"
#include "stdio.h"
#include "../c_wrapper/pruio.h"
//! The main function.
int main(int argc, char **argv)
{
FILE* oFile;
uint8 bDiv = 4, bStep;
uint32 bSize = 1e6;
uint32 bsSize = bSize/bDiv;
oFile = fopen("output","wb");
pruIo *io = pruio_new(PRUIO_DEF_ACTIVE, 0x98, 0, 1); //! create new driver structure
pruio_adc_setStep(io, 9, 4, 0, 0, 0); // step 9 for AIN-4
if (pruio_config(io, bSize, 1 << 9, 6290, 0)){ // '1 << 9' -> step 9, '6285' ns -> 159.1 kHz
printf("config failed (%s)\n", io->Errr);}
else{
pruio_rb_start(io);
sleep(1);
while(1){
while(io->DRam[0] < (bStep+1) * bsSize && io->DRam[0] > bStep * bsSize){
sleep(1);
}
printf("start writing %u\n",bStep*bsSize);
fwrite(io->Adc->Value, sizeof(uint16), 16000, oFile);
printf("end writing %u\n",(bStep+1)*bsSize);
bStep = bStep+1 < bDiv ? bStep+1 : 0;
}
}
pruio_destroy(io);
return 0;
}
d *= (Conf->ADC_CLKDIV + 1) * 417 '417 ≈ 1000000 / 2400 (= 1 GHz / 2.4 MHz)
d += 30 ' PRU cycles for restart [GHz]
IF Tmr <= d THEN .Errr = @"sample rate too big" : RETURN .Errr
d = (d * (Conf->ADC_CLKDIV + 1) * 1000) \ 24
IF Tmr <= d ORELSE Tmr < 5000 THEN _
.Errr = @"sample rate too big" : RETURN .Errr
#include "unistd.h"
#include "stdio.h"
#include "../c_wrapper/pruio.h"
//! The main function.
int main(int argc, char **argv)
{
FILE* oFile;
uint8 bDiv = 4, bStep;
uint32 bSize = 1e6;
uint32 bsSize = bSize/bDiv;
uint8 cycles = 2;
char fName[12];
int i = 0;
pruIo *io = pruio_new(PRUIO_DEF_ACTIVE, 0x98, 0, 1); //! create new driver structure
pruio_adc_setStep(io, 9, 4, 0, 0, 0); // step 9 for AIN-4
if (pruio_config(io, bSize, 1 << 9, 4545, 0)){ // '1 << 9' -> step 9, '6285' ns -> 159.1 kHz
printf("config failed (%s)\n", io->Errr);}
else{
pruio_rb_start(io);
sleep(1);
for(i=0; i<cycles; i++){
sprintf(fName, "output.%u",i);
oFile = fopen(fName,"wb");
while(bStep<bDiv){
while(io->DRam[0] < (bStep+1) * bsSize && io->DRam[0] > bStep * bsSize){
sleep(1);
}
printf("writing samples %u-%u\n",bStep*bsSize, (bStep+1)*bsSize);
fwrite(io->Adc->Value, sizeof(uint16), 16000, oFile);
bStep++;
}
bStep=0;
fclose(oFile);
}
}
pruio_destroy(io);
return 0;
}
--
fwrite(io->Adc->Value, sizeof(uint16), 16000, oFile);
fwrite(io->Adc->Value, sizeof(uint16), bsSize, oFile);
If you want to provide better sample code you're free to go, but please don't be that smart-ass stating facts that are only half or not at all true.
/'* \file rb_file.bas
\brief Example: fetch ADC samples in a ring buffer and save to file.
This file contains an example on how to use the ring buffer mode of
libpruio. A fixed step mask of AIN-0, AIN-4 and AIN-7 get sampled and
saved as raw data to some files.
Licence: GPLv3
Copyright 2014 by Thomas{ dOt ]Freiherr[ At ]gmx[ DoT }net
Compile by: `fbc -w all rb_file.bas`
\since 0.2
'/
' include libpruio
#INCLUDE ONCE "../pruio/pruio.bi"
CONST tSamp = 123401 _ '*< The number of samples in the files (per step).
, tmr = 5000 _ '*< The sampling rate in ns (5000 -> 200 kHz).
, NoStep = 3 _ '*< The number of active steps (must match setStep calls and mask).
, NoFile = 2 _ '*< The number of files to write.
, NamFil = "output." '*< The output file names.
VAR io = NEW PruIo() '*< Create a PruIo structure, wakeup subsystems.
WITH *io
DO
IF .Errr THEN ?"NEW failed: " & *.Errr : EXIT DO
IF .Adc->setStep( 9, 0, 0, 0, 0) THEN _
?"step 9 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep(10, 1, 0, 0, 0) THEN _
?"step 10 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep(11, 2, 0, 0, 0) THEN _
?"step 11 configuration failed: " & *.Errr : EXIT DO
VAR mask = &b111 SHL 9 _ '*< The active steps (9 to 11).
, tInd = tSamp * NoStep _ '*< The maximum total index.
, half = ((.ESize SHR 2) \ NoStep) * NoStep '*< The maximum index of the half ring buffer.
IF half > tInd THEN half = tInd ' adapt size for small files
VAR samp = (half SHL 1) \ NoStep '*< The number of samples (per step).
IF .config(samp, mask, tmr, 0) THEN _ ' configure driver
?"config failed: " & *.Errr : EXIT DO
IF .rb_start() THEN _ ' start ring buffer mode
?"rb_start failed: " & *.Errr : EXIT DO
VAR p0 = .Adc->Value _ '*< A pointer to the start of the ring buffer.
, p1 = p0 + half '*< A pointer to the middle of the ring buffer.
FOR n AS INTEGER = 0 TO NoFile - 1
VAR fnam = NamFil & n, fnr = FREEFILE
IF OPEN(fnam FOR OUTPUT AS fnr) THEN
?"Cannot open " & fnam
ELSE
?"Creating file " & fnam
VAR i = 0 '*< Start index.
WHILE i < tInd
i += half
IF i > tInd THEN ' fetch the rest (no complete chunk)
VAR rest = tInd + half - i _
, iEnd = IIF(p1 >= p0, rest, rest + half)
WHILE .DRam[0] < iEnd : SLEEP 1 : WEND
?" writing samples " & (tInd - rest) & "-" & (tInd - 1)
PUT #fnr, , *p0, rest
SWAP p0, p1 : EXIT DO
END IF
IF p1 > p0 THEN WHILE .DRam[0] < half : SLEEP 1 : WEND _
ELSE WHILE .DRam[0] > half : SLEEP 1 : WEND
?" writing samples " & (i - half) & "-" & (i - 1)
PUT #fnr, , *p0, half
SWAP p0, p1
WEND
?"Finished file " & fnam
CLOSE #fnr
END IF
NEXT
LOOP UNTIL 1
IF .Errr THEN SLEEP
END WITH
DELETE(io)
'' help Doxygen to dokument the main code
'&/** The main function. */
'&int main() {PruIo::PruIo(); AdcUddt::setStep(); PruIo::config(); PruIo::~PruIo();}
SWAP p0, p1 : EXIT DO
SWAP p0, p1 : EXIT WHILE
--
TJF,I'd be willing at some point to help you port some code for your project,
Do you have a quick setup guide for your library ?
Other problem is that I am not exactly a hardware person so much as a software developer, and I am semi new to embedded Linux. The new to embeded Linux part shouldnt be too much of a problem, just means I need to read up on the libc functions available to me. Not being an EE however slows me down greatly however, since I do not want to fry my boards . . .
As an aside, I must have really really become accustomed to C over the last several years, BASIC syntax hurts my eyes, lol but it was the very first language I picked up 17+ years ago . . .
--
Back in the early to mid 80's I was living in Kitzingen,Germany, and I was young. If you catch my meaning.
But anyway, I am still a bit busy, but perhaps in my spare time I can read your documentation a bit at a time to be used to it. It is something I've been wanting to do for a while now . . .
--
ld: pruio.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
Hey,I'm trying to match the below modification in my version of libpruio, but while compiling I run into the following
ld: pruio.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPICand I'm not sure how to get past it. I -think- that I have the freebasic compiler running correctly. Any advice would be welcome.Thanks,Michael Todd
But I recommend to install the new BBB_fbc-1.00, which I also use on my board now. Just follow the instructions in (only point 1)
http://users.freebasic-portal.de/tjf/Projekte/libpruio/doc/html/_cha_preparation.html#SecInstallation
I am trying to use the example you provided here to sample an analog signal.
With the default setting of tmr=5000, I am getting configuration error:
config failed: sample rate too big
It works with tmr=20000 and dumps the data into 2 files. Though the data looks to be in binary format.
Could there be something in my setup that may need tweaking to run this at 200KHz?
I am using libpruio v0.2 and installed it following the steps mentioned here.
cd pruio/
vim pruio_adc.bas (modify buggy lines)
./make.sh
./build.sh
Hi Andrea!
It compiles OK, but the linker doesn't find the symbols (= doesn't find the binary libpruio.so).
Where did you place the new binary? It should work when you override the original binary (ie. in /usr/local/lib). Otherwise you have to update the linker cache first:
sudo ldconfig
Or you can instruct the linker to search for libraries in a custom path, like (for the current directory)
LD_LIBRARY_PATH="." & ANY_COMPILE_COMMAND
See your linker manual for details (this issue is not related to libpruio).
BR
pruio_config(io, 2, 0x1FE, 0x22675, 4)
My mistake was to build only the FreeBasic library and not the one in the folder `c_wrapper`
I have another question: I'm trying to read from the ADC the sound from a microphone. So I would like to acquire data at 44100Hz
In order to achive this result I follow your documentation so I've configured the ADC as followpruio_config(io, 2, 0x1FE, 0x22675, 4)
I put 22675 as a hexadecimal value because if I put it as a decimal number the library continue to give me the error
config failed (sample rate too big)
Can you, kindly, put me in the right direction to achieve my goal?
M(P9_22) = "" '' right below the PIN_DEL(...) lines.
in order to release this pin from the libpruio overlay. Also, you can free the HDMI pins by removing the lineAdapt before running the command fbc -w all dts_universal.bas.
PIN_DEL(HDMI_Pins)
You described a manual installation of the FreeBASIC compiler. Meanwhile I made a Debian package, which is less painful to install/uninstall, since it gets handled by the package manager. See description pages in (en) and (de) and this download link.
I have been working on making a build system and debian packages for fb_prussdrv and libpruiio, etc.
First of all, I patched the original pru assembler with your changes, whereby I exchanged your '-y' switch to a '-f' switch, because '-y' suggest something like 'assume yes' and -f was not used. I forked the beagleboard/am335x_pru_package for this:
https://github.com/l4m4re/am335x_pru_package
And I sent a pull request to the beagleboard package, which has been accepted and merged. According to Jason, it will take a while before the patch will be included in the upstream beaglebone debian repository, but it should become available at some point. The new version number for pasm with the freebasic output patch is 0.87.
Secondly, I setup my own debian repository, which includes both freebasic as well as the pru packages:
http://beagle.tuks.nl/
Thirdly, I have been working on a generic build system for a/o C(++), pasm, overlay files and freebasic, LaMake, with which I can now build the fb_prussdrv package and build a debian package, although it is still a bit rough around the edges. I am now working on building the libpruio package, with the goal of also making a debian package for that. At this moment, only the "config" directory builds. "make install DESTDIR=/tmp/test PREFIX=/usr" works for that, which builds&installs the overlay binary.
I will continue working on building&packaging libpruio and when I'm finished, I will release debian packages on my repository for all three.
#include "unistd.h"
#include "../c_wrapper/pruio.h" // include header
#include "time.h"
//! The main function.
int main(/*int argc, char **argv*/)
{
float n[256];
int a[256];
int i=0;
pruIo *io = pruio_new(PRUIO_DEF_ACTIVE, 0x98, 0, 1); //! create new driver structure
pruio_adc_setStep(io, 9, 1, 0, 0, 0); // step 9, AIN-0
pruio_adc_setStep(io, 10, 2, 0, 0, 0);
if (pruio_config(io, 128, 9<<10 , 156250, 4)){ // upload (default) settings, start IO mode
printf("config failed (%s)\n", io->Errr);}
else {
if (pruio_rb_start(io)) printf("rb_start failed (%s)\n", io->Errr); // start measurement
else{
sleep(1);
i=io->DRam[0];
a[i] = i;
n[i] = io->Adc->Value[i];
do{
if(i != io->DRam[0]){
i=io->DRam[0];
a[i] = i;
n[i] = io->Adc->Value[i];
}
}while(io->DRam[0] < 126);a[io->DRam[0]] = io->DRam[0];n[io->DRam[0]] = io->Adc->Value[io->DRam[0]];for(i = 0; i<=127; i++ ){printf("amostra %d ----- %f \n", a[i], (n[i]/65536)*1.8);}}/* we're done */}pruio_destroy(io); /* destroy driver structure */return 0;}
amostra 1 ----- 0.000000
amostra 0 ----- -0.000012
amostra 2 ----- 1.799561
amostra 3 ----- 1.799561
amostra -1092378024 ----- -0.000012
amostra 5 ----- 1.799561
amostra 6 ----- 1.799561
amostra 7 ----- 1.799561
amostra -1092377860 ----- 0.000000
amostra 9 ----- 1.799561
amostra 10 ----- 1.799561
amostra 11 ----- 1.799561
amostra 12 ----- 1.799561
amostra 466005475 ----- 0.000000
amostra 14 ----- 1.799561
amostra 15 ----- 1.799561
amostra 1 ----- 0.000000
amostra -1225151312 ----- -0.000012
amostra 18 ----- 1.799561
amostra 19 ----- 1.799561
amostra 3 ----- -0.000000
amostra 21 ----- 1.799561
amostra 22 ----- 1.799561
amostra 23 ----- 1.799561
amostra -1225186212 ----- 0.000000
amostra 25 ----- 1.799561
amostra 26 ----- 1.799561
amostra 27 ----- 1.799561
amostra 1 ----- 0.000000
amostra 29 ----- 1.799561
amostra 30 ----- 1.799561
amostra 31 ----- 1.799561
amostra 0 ----- -0.000012
amostra 33 ----- 1.799561
amostra 34 ----- 1.799561
amostra 35 ----- 1.799561
amostra -1092377728 ----- 0.000000
amostra 37 ----- 1.799561
amostra 38 ----- 1.799561
amostra 39 ----- 1.799561
amostra 0 ----- -0.000000
amostra 41 ----- 1.799561
amostra 42 ----- 1.799561
amostra 43 ----- 1.799561
amostra 0 ----- 0.000000
amostra 45 ----- 1.799561
amostra 46 ----- 1.799561
amostra 47 ----- 1.799561
amostra 0 ----- 0.000000
amostra 49 ----- 1.799561
amostra 50 ----- 1.799561
amostra 51 ----- 1.799561
amostra 0 ----- 0.000000
amostra 53 ----- 1.799561
amostra 54 ----- 1.799561
amostra 55 ----- 1.799561
amostra -1225159968 ----- 0.000000
amostra 57 ----- 1.799561
amostra 58 ----- 1.799561
amostra 59 ----- 1.799561
amostra -1092376444 ----- 0.000000
amostra 61 ----- 1.799561
amostra 62 ----- 1.799561
amostra 63 ----- 1.799561
amostra 0 ----- 0.000000
amostra 65 ----- 1.799561
amostra 66 ----- 1.799561
amostra 67 ----- 1.799561
amostra 6 ----- 0.000000
amostra 69 ----- 1.799561
amostra 70 ----- 1.799561
amostra 71 ----- 1.799561
amostra 0 ----- 0.000000
amostra 73 ----- 1.799561
amostra 74 ----- 1.799561
amostra 75 ----- 1.799561
amostra 0 ----- 0.000000
amostra 77 ----- 1.799561
amostra 78 ----- 1.799561
amostra 79 ----- 1.799561
amostra 0 ----- 0.000000
amostra 81 ----- 1.799561
amostra 82 ----- 1.799561
amostra 83 ----- 1.799561
amostra 0 ----- -0.000000
amostra 85 ----- 1.799561
amostra 86 ----- 1.799561
amostra 87 ----- 1.799561
amostra 0 ----- 0.000000
amostra 89 ----- 1.799561
amostra 90 ----- 1.799561
amostra 91 ----- 1.799561
amostra -1225160672 ----- -0.000000
amostra 93 ----- 1.799561
amostra 94 ----- 1.799561
amostra 95 ----- 1.799561
amostra 96 ----- 1.799561
amostra 0 ----- -0.000000
amostra 98 ----- 1.799561
amostra 99 ----- 1.799561
amostra 0 ----- 0.000000
amostra 101 ----- 1.799561
amostra 102 ----- 1.799561
amostra 103 ----- 1.799561
amostra -1225162752 ----- 0.000000
amostra 105 ----- 1.799561
amostra 106 ----- 1.799561
amostra 107 ----- 1.799561
amostra -1092377440 ----- 0.000000
amostra 109 ----- 1.799561
amostra 110 ----- 1.799561
amostra 111 ----- 1.799561
amostra 0 ----- -0.000000
amostra 113 ----- 1.799561
amostra 114 ----- 1.799561
amostra 115 ----- 1.799561
amostra 0 ----- -0.000012
amostra 0 ----- 0.000000
amostra 118 ----- 1.799561
amostra 119 ----- 1.799561
amostra 0 ----- -0.000012
amostra 121 ----- 1.799561
amostra 122 ----- 1.799561
amostra 123 ----- 1.799561
amostra 0 ----- 0.000000
amostra 125 ----- 1.799561
amostra 126 ----- 1.799561
amostra -1092376512 ----- 0.000000
(n[i]/65536)*1.8)
Values output from the ADC are in range 0-4095, I'd double check to make sure that is correct. It could be that libpruio's values are different in implementation through some sort of conversation. Secondly, for some reason, it may become readily apparent that your index value may contain a lot of zero's in the middle indexes. You're going to need to look into why that it happening after you clean your code up some. As I said above. I am not familiar with libpruio's implementation, and the rest of your code is not clear enough to make a determination at a glance.
Mr, Willians, thanks for your answer.According to the lipruio's documentation, the variable io->DRam[0] contains the index of the last ADC data read.About the part:
do{
. . .
}while(io->DRam[0] < 126);This is inconsistent with:
for(i = 0; i<=127; i++ ){
. . .
}
,the for is to print the values stored. The do-while is to read the sample 1 to 126. the samples 0 and 127 are read before and after this loop, respectively.What are you sugestions to improve my code, Mr. Hermans?
float n[256];
int a[256];
int i=0;
float n[256];
is not needed. For this particular application you only need one float value for printing a voltage value in your printf() statement. In fact, in the future if you plan on expanding on this application you may wish to do away with float values entirely, send the raw PRU values to an external source( if that's what happens ) and let the external source do the heavy math. This makes what your beaglebone is doing more efficient, and if performance is needed can make a huge difference. Also, you can look into using fixed point numbers, but this would use more processor cycles than just sending out raw values.int a[256];
Assuming 128 samples, I might change this to: int channel_n[128]; ( n representing the actual channel you're reading from ), then do all the formatting in your printf() statement. If, and when you decide to print more than one channel worth of samples. This is however more a matter of semantics, but it'll also make your code much more readable. Again, you need to read the C standard for the compiler you're using. It does seem possible you're using a post C99 compiler as you're not initializing the variable i within the for() loop. Again, make sure your array has enough room for a NULL termination byte, if needed. Which wouldn't be of type byte, but instead of type int.
The libpruio stuff TJF will be able to give you a much better answer on. As it's his code, and I know nearly nothing of the specifics for this code.if (pruio_rb_start(io)) printf("rb_start failed (%s)\n", io->Errr); // start measurement
/*file doiscs.c
Compile by: `gcc -Wall -o doiscs doiscs.c -lpruio`
*/
#include "stdio.h"
#include "unistd.h"
#include "../c_wrapper/pruio.h"
#include "time.h"
int main(int argc, char **argv)
{
float n[256];
float v1[128];
float v2[128];
int i = 0;
pruIo *io = pruio_new(PRUIO_DEF_ACTIVE, 0x98, 0, 0); //! create new driver structure
pruio_adc_setStep(io, 9, 1, 0, 0, 0); // step 9, AIN-0
pruio_adc_setStep(io, 10, 2, 0, 0, 0); // step 10, AIN-1
if (pruio_config(io, 128, 9<<10 , 156250, 4)){
printf("config failed (%s)\n", io->Errr);}
else {
if (pruio_rb_start(io)) printf("rb_start failed (%s)\n", io->Errr); // start measurement
else{
sleep(1);
do{
if(io->DRam[0] == (i)){
n[i] = io->Adc->Value[i];
i=i+1;
}
}while(i < 256);
for(i = 0; i<=127; i++ ){
v1[i] = n[2*i];
v2[i] = n[2*i +1];
}
printf("adc1*************\n");
for(i=0; i<=127; i++){
printf("%f \n", v1[i]*1.8/65536);
}
printf("\n adc2*************\n");
for(i=0; i<=127; i++){
printf("%f \n ", v2[i]*1.8/65536);
}
}
}
pruio_destroy(io);
return 0;
}
The error is marked in yellow. The loop condition was considering the garbage :D |
if <span style="color:rgb(102,
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/40e7169e-cd77-4180-9f9f-057ad534e10f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Few feature queries:Does the current version support remote proc?
Does it require superuser/root execution?
Is it in the main rcn-ee package feeds?Thought about getting into upstream Debian?
Hi Jason!We already had such questions regarding upstream Debian four years agoin 2014. I'm still waiting for your answers.
More than six month I tried to get back access to my own webside,
before I gave up. I'm still not able to update the informations on that
page.
So why should I answer your questions now? OK, other readers may be
interested in that topics as well and I wont operate at your level:
Am Donnerstag, 20. September 2018 18:14:53 UTC+2 schrieb Jason Kridner:Few feature queries:Does the current version support remote proc?Does rproc support libpruio requirements? rproc is designed for
entertainment: for playing music or for simple data logging tasks. In
contrast libpruio targets hard realtime requirements for closed loop
controllers. The rpmsg methods are simply too slow for libpruio.
Does it require superuser/root execution?Please read the descriptions again. It depends on the need for
pinmuxing and the system configuration. No pinmuxing -> no root
execution. In case of pinmuxing several methods are supported:
config-pin, universal device trees or LKM. The device tree solutions
(including config-pin) need root privileges. In contrast the new LKM
solution provides single source pinmuxing access from user space for
all members of system user group 'pruio'.Is it in the main rcn-ee package feeds?Thought about getting into upstream Debian?libpruio is a hardware driver for AM335[89] CPUs, so we're talking
about Beaglebone Debian. Four years ago I asked for your help. Today I
found my own solution and do not care any longer about that issue. The
project is open source, so feel free to download the source tree and
build your packages for upstream Debian. Or just copy the already built
packages. The users would appreciate that, but they can handle Arend
Lammertinks PPA solution as well.
At least the LKM in upstream Debian would be a great help for the
users, since in case of PPA it needs dkms re-compilation for each
kernel update (and > 30 MB linux-headers in order to re-compile 4 kB
code to a binary that doesn't change).
--Major highlights:
- PRUSS functions exported now
- New examples pruss_add (interaction between ARM and PRU)
- New example pruss_toggle (up to 100 MHz pin toggling)
Find
- more info in the docs,
- the source tree on GitHub, and
- the install instructions (debian package or self-compiled from source tree.).
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.--
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/40e7169e-cd77-4180-9f9f-057ad534e10f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/76724c23-79da-45cf-8247-3b4c6f3026c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Thu, Sep 20, 2018 at 2:26 PM TJF <jeli.f...@gmail.com> wrote:Hi Jason!We already had such questions regarding upstream Debian four years agoin 2014. I'm still waiting for your answers.Guess I'll search for it. Found a bit of info on your site, but I'll try to go back and find the queries.Going back as far as I can, I found https://groups.google.com/d/msg/beagleboard/lzJge-08T9s/HnPTZ82nLCYJ. Looking newer than that, I see a lot of queries, but it seems to me Robert has been pretty good at answering.If you can provide any hints that will help my search and get you answers, I'd be appreciative.
There was a mass migration from the old project pages to hackster.io via a script. The main purpose is to give a place for people to discover the projects and point them to the real source for details, rather than actually take the attention away.BTW, the projects were never on wordpress.com, they were on beagleboard.org, and wordpress.com was simply used as one of many OpenID provider options.Maintaining the editable pages on beagleboard.org itself had become a logistical nightmare as quality support for OpenID has waned at all the key service providers even as the technology itself had changed. My older support libraries could no longer support the handful of providers that still exist.I believe hackster.io has a method for offering a recourse, but, fundamentally, this is your information and you just need to be able to control it. Sorry for not keeping that access/control in your clear view. Seems you have found recourse here and now on this forum.I'm committed to making this right. I'll take it down or replace it with whatever you see fit in regards to your project.More than six month I tried to get back access to my own webside,
before I gave up. I'm still not able to update the informations on that
page.Sorry it was so hard to get my attention. I try to make myself available via http://beagleboard.org/about and some people grab my attention at times via #beagle on IRC, but e-mails frequently escape my view are are closer to blind luck if I actually see them. I promise this isn't personal, but I do get several hundred e-mails a day and I try to scan the subject lines as best I can.This project page can be put in your name if you create a hackster.io account... not sure if that is something you want to do. Again, I wanted it to all be OpenID so that you could maintain your own credentials/identity, but the support has become too hard for it. I will credit you and provide content however you see fit in regards to your project.
So why should I answer your questions now? OK, other readers may be
interested in that topics as well and I wont operate at your level:That seems a bit harsh.
Helping the other readers is indeed the point, so glad we are at least of the same mind in that regard.
Am Donnerstag, 20. September 2018 18:14:53 UTC+2 schrieb Jason Kridner:Few feature queries:Does the current version support remote proc?Does rproc support libpruio requirements? rproc is designed for
entertainment: for playing music or for simple data logging tasks. In
contrast libpruio targets hard realtime requirements for closed loop
controllers. The rpmsg methods are simply too slow for libpruio.rproc is really just about putting the kernel in charge of the PRUs, rather than leaving it up to userspace. It provides an ELF parser/loader and sysfs entries for starting/stopping the processor, among other processor abstractions. Memory (/dev/mem) mapping of PRU shared memories is still completely possible in an rproc environment. There is no explicit need to utilize rpmsg. Still, the permissions issues could be a bit different. With UIO, the memory mapping of the PRU is exposed explicitly for that peripheral and the permissions on access can be set for just that memory region. No one has yet created a UIO/memory driver that exposes the PRU shared memory while running the rproc driver, though nothing should prevent that.The Linux upstream maintainers seem to have a preference for rproc which is why I tend to recommend it. "Just works" is great, but "leverages community" is also great.
Does it require superuser/root execution?Please read the descriptions again. It depends on the need for
pinmuxing and the system configuration. No pinmuxing -> no root
execution. In case of pinmuxing several methods are supported:
config-pin, universal device trees or LKM. The device tree solutions
(including config-pin) need root privileges. In contrast the new LKM
solution provides single source pinmuxing access from user space for
all members of system user group 'pruio'.Is it in the main rcn-ee package feeds?Thought about getting into upstream Debian?libpruio is a hardware driver for AM335[89] CPUs, so we're talking
about Beaglebone Debian. Four years ago I asked for your help. Today I
found my own solution and do not care any longer about that issue. The
project is open source, so feel free to download the source tree and
build your packages for upstream Debian. Or just copy the already built
packages. The users would appreciate that, but they can handle Arend
Lammertinks PPA solution as well.My neglect clearly touched a nerve. It was never intentional or personal. This announcement clued me into your continued development and support of this library. If existing users are happy, I'd love to see more Beagle users discover and make use of it.I know the project entry changed hosts without your knowledge, but my sniff test of packaging your library into Robert's package feeds without contacting you smelled a bit funny.If you don't mind and, as you seem to, agree it would be helpful to users, I can check if Robert will add it to https://github.com/beagleboard/repos.Seeing where we are at, we should probably get over that hurdle before trying to talk to upstream Debian maintainers.
At least the LKM in upstream Debian would be a great help for the
users, since in case of PPA it needs dkms re-compilation for each
kernel update (and > 30 MB linux-headers in order to re-compile 4 kB
code to a binary that doesn't change).I'll interpret this to mean the BeagleBone kernel images used in the Debian reference images.Having https://github.com/DTJF/libpruio/tree/master/src/lkm pre-built into the distributed kernels does indeed seem helpful. The config-pin setup should be fairly well-deployed now. I'm curious if the pinmux helpers will interfere with this module. Guess we can try.
Thanks again for the cool project and hope the frustration subsides.
Frustration subsides immediately when I see some progress. Getting the LKM in to https://github.com/beagleboard/repos would be a great start. The folder you mentioned is related to the project tree and uses variables like PROJ_NAME to fill template files. From my point of view it's better to fetch the source from the libpruio-lkm package. But Robert should know the best solution. The libpruio.ko driver is necessary. The file libpruio-lkm.service can come from package libpruio-lkm, which also adds the 'pruio' system users group.
$ sudo apt install libpruio-modules
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
E: Paket libpruio-modules kann nicht gefunden werden.
$ sudo apt install libpruio-modules-4.14.69-ti-r76
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Die folgenden NEUEN Pakete werden installiert:
libpruio-modules-4.14.69-ti-r76
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 6.000 B an Archiven heruntergeladen werden.
Nach dieser Operation werden 26,6 kB Plattenplatz zusätzlich benutzt.
Holen:1 http://repos.rcn-ee.com/debian stretch/main armhf libpruio-modules-4.14.69-ti-r76 armhf 1stretch [6.000 B]
Es wurden 6.000 B in 0 s geholt (10,2 kB/s).
Vormals nicht ausgewähltes Paket libpruio-modules-4.14.69-ti-r76 wird gewählt.
(Lese Datenbank ... 159470 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libpruio-modules-4.14.69-ti-r76_1stretch_armhf.deb ...
Entpacken von libpruio-modules-4.14.69-ti-r76 (1stretch) ...
libpruio-modules-4.14.69-ti-r76 (1stretch) wird eingerichtet ...
~$ sudo apt install libpruio-lkm
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
libllvm5.0 libncurses5-dev libtinfo-dev libxpm-dev
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
Die folgenden NEUEN Pakete werden installiert:
libpruio-lkm
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 8.142 B an Archiven heruntergeladen werden.
Nach dieser Operation werden 32,8 kB Plattenplatz zusätzlich benutzt.
Holen:1 http://beagle.tuks.nl/debian jessie/ libpruio-lkm 0.6.2a [8.142 B]
Es wurden 8.142 B in 0 s geholt (33,0 kB/s).
Vormals nicht ausgewähltes Paket libpruio-lkm wird gewählt.
(Lese Datenbank ... 159476 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libpruio-lkm_0.6.2a_armhf.deb ...
Entpacken von libpruio-lkm (0.6.2a) ...
libpruio-lkm (0.6.2a) wird eingerichtet ...
addgroup: Die Gruppe »pruio« existiert bereits als Systemgruppe. Programmende.
Created symlink /etc/systemd/system/multi-user.target.wants/libpruio-lkm.service → /lib/systemd/system/libpruio-lkm.service.
Loading new libpruio-lkm-0.6.2a DKMS files...
Building for 4.14.69-ti-r76 4.17.6-armv7-x7
Building initial module for 4.14.69-ti-r76
Done.
libpruio:
Running module version sanity check.
Good news! Module version 0.0 for libpruio.ko
exactly matches what is already found in kernel 4.14.69-ti-r76.
DKMS will not replace this module.
You may override by specifying --force.
depmod......
Backing up initrd.img-4.14.69-ti-r76 to /boot/initrd.img-4.14.69-ti-r76.old-dkms
Making new initrd.img-4.14.69-ti-r76
(If next boot fails, revert to initrd.img-4.14.69-ti-r76.old-dkms image)
update-initramfs..............
DKMS: install completed.
Module build for kernel 4.17.6-armv7-x7 was skipped since the
kernel headers for this kernel does not seem to be installed.
I now have freebasic 1.0.5 available in stretch, it was bootstrap 3
times in a standard image and now once on my deb builder. I'll
probally build/bootstrap it two more times tonight (time to run home),
to make sure it's fully okay..
Regards,
--
Robert Nelson
https://rcn-ee.com/
Side question, any reason to just not use git master vs the 1.0.5 tag
from years ago????
This is where the fun begin's in a week or two, you really won't need
that dkms layer..
Hi all,
Great to see the progress being made on getting these packages
included in the beaglebone repository. The PPA works and is great to
begin with packaging but inclusion in the beaglebone repository is of
course much better.
Major highlights:
wget -qO - http://beagle.tuks.nl/debian/public.key | sudo apt-key add -
Response: gpg: no valid OpenPGP data found.
wget -qO - http://beagle.tuks.nl/debian/pubring.gpg | sudo apt-key add -
root@beaglebone:/var/lib/cloud9# sudo apt-get install libpruioReading package lists... DoneBuilding dependency treeReading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies:libpruio : Depends: libtinfo5 (>= 6) but 5.9+20140913-1+b1 is to be installed
root@beaglebone:/var/lib/cloud9# sudo apt-get install libncurses5-devReading package lists... DoneBuilding dependency treeReading state information... DoneThe following extra packages will be installed:libncurses5 libncursesw5 libtinfo-dev libtinfo5 ncurses-binSuggested packages:ncurses-docThe following packages will be upgraded:libncurses5 libncurses5-dev libncursesw5 libtinfo-dev libtinfo5 ncurses-bin6 upgraded, 0 newly installed, 0 to remove and 161 not upgraded.Need to get 1,019 kB of archives.After this operation, 230 kB disk space will be freed.Do you want to continue? [Y/n] YGet:1 http://httpredir.debian.org/debian/ jessie/main libncurses5-dev armhf 5.9+20140913-1+deb8u3 [156 kB]Get:2 http://httpredir.debian.org/debian/ jessie/main libtinfo-dev armhf 5.9+20140913-1+deb8u3 [67.8 kB]Get:3 http://httpredir.debian.org/debian/ jessie/main libncursesw5 armhf 5.9+20140913-1+deb8u3 [103 kB]Get:4 http://httpredir.debian.org/debian/ jessie/main libtinfo5 armhf 5.9+20140913-1+deb8u3 [271 kB]Get:5 http://httpredir.debian.org/debian/ jessie/main libncurses5 armhf 5.9+20140913-1+deb8u3 [78.4 kB]Get:6 http://httpredir.debian.org/debian/ jessie/main ncurses-bin armhf 5.9+20140913-1+deb8u3 [343 kB]Fetched 1,019 kB in 1s (680 kB/s)(Reading database ... 44826 files and directories currently installed.)Preparing to unpack .../libncurses5-dev_5.9+20140913-1+deb8u3_armhf.deb ...Unpacking libncurses5-dev:armhf (5.9+20140913-1+deb8u3) over (5.9+20140913-1+b1) ...Preparing to unpack .../libtinfo-dev_5.9+20140913-1+deb8u3_armhf.deb ...Unpacking libtinfo-dev:armhf (5.9+20140913-1+deb8u3) over (5.9+20140913-1+b1) ...Preparing to unpack .../libncursesw5_5.9+20140913-1+deb8u3_armhf.deb ...Unpacking libncursesw5:armhf (5.9+20140913-1+deb8u3) over (5.9+20140913-1+b1) ...Preparing to unpack .../libtinfo5_5.9+20140913-1+deb8u3_armhf.deb ...Unpacking libtinfo5:armhf (5.9+20140913-1+deb8u3) over (5.9+20140913-1+b1) ...Setting up libtinfo5:armhf (5.9+20140913-1+deb8u3) ...Processing triggers for libc-bin (2.19-18+deb8u6) ...(Reading database ... 44825 files and directories currently installed.)Preparing to unpack .../libncurses5_5.9+20140913-1+deb8u3_armhf.deb ...Unpacking libncurses5:armhf (5.9+20140913-1+deb8u3) over (5.9+20140913-1+b1) ...Setting up libncurses5:armhf (5.9+20140913-1+deb8u3) ...Processing triggers for libc-bin (2.19-18+deb8u6) ...(Reading database ... 44825 files and directories currently installed.)Preparing to unpack .../ncurses-bin_5.9+20140913-1+deb8u3_armhf.deb ...Unpacking ncurses-bin (5.9+20140913-1+deb8u3) over (5.9+20140913-1+b1) ...Processing triggers for man-db (2.7.0.2-5) ...Setting up ncurses-bin (5.9+20140913-1+deb8u3) ...Setting up libtinfo-dev:armhf (5.9+20140913-1+deb8u3) ...Setting up libncurses5-dev:armhf (5.9+20140913-1+deb8u3) ...Setting up libncursesw5:armhf (5.9+20140913-1+deb8u3) ...Processing triggers for libc-bin (2.19-18+deb8u6) ...
root@beaglebone:/var/lib/cloud9# sudo apt-get download libpruio
Selecting previously unselected package libpruio.(Reading database ... 44824 files and directories currently installed.)Preparing to unpack libpruio_0.6.4a_armhf.deb ...Unpacking libpruio (0.6.4a) ...Setting up libpruio (0.6.4a) ...Processing triggers for libc-bin (2.19-18+deb8u6) ...
root@beaglebone:/var/lib/cloud9# dpkg -i --ignore-depends=libtinfo5 libpruio-lkm_0.6.4a_armhf.deb(Reading database ... 46270 files and directories currently installed.)Preparing to unpack libpruio-lkm_0.6.4a_armhf.deb ...Unpacking libpruio-lkm (0.6.4a) over (0.6.4a) ...Setting up libpruio-lkm (0.6.4a) ...Adding group `pruio' (GID 115) ...Done.Loading new libpruio-lkm-0.6.4a DKMS files...First Installation: checking all kernels...Building only for 4.4.30-ti-r64Module build for the currently running kernel was skipped since thekernel source for this kernel does not seem to be installed.Job for libpruio-lkm.service failed because the control process exited with error code.See "systemctl status libpruio-lkm.service" and "journalctl -xe" for details.root@beaglebone:/var/lib/cloud9# systemctl status libpruio-lkm.service● libpruio-lkm.service - Load libpruio loadable kernel moduleLoaded: loaded (/lib/systemd/system/libpruio-lkm.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Thu 2018-11-08 07:32:35 UTC; 1min 18s agoProcess: 15039 ExecStart=/sbin/modprobe libpruio (code=exited, status=1/FAILURE)Main PID: 15039 (code=exited, status=1/FAILURE)Nov 08 07:32:35 beaglebone systemd[1]: Starting Load libpruio loadable kernel module...Nov 08 07:32:35 beaglebone systemd[1]: libpruio-lkm.service: Main process exited, code=exited, status=1/FAILURENov 08 07:32:35 beaglebone systemd[1]: Failed to start Load libpruio loadable kernel module.Nov 08 07:32:35 beaglebone systemd[1]: libpruio-lkm.service: Unit entered failed state.Nov 08 07:32:35 beaglebone systemd[1]: libpruio-lkm.service: Failed with result 'exit-code'.
1.c:(.text+0x14): undefined reference to `pruio_new'1.c:(.text+0x28): undefined reference to `pruio_config'1.c:(.text+0x8e): undefined reference to `pruio_destroy'
root@beaglebone:/var/lib/cloud9# cat /etc/os-releasePRETTY_NAME="Debian GNU/Linux 8 (jessie)"NAME="Debian GNU/Linux"VERSION_ID="8"VERSION="8 (jessie)"
- The version of package libtinfo5 for debian Jessie should be 5.9+, why does my dependencies asked for 6? Is it because I haven't downgraded my BBB properly? The BBB was previously updated to latest debian image.
- Why is kernel source for my kernel does not seem to be installed?
sudo apt install build-essential linux-headers-`uname -r`
sudo apt install libpruio-lkm
And I am currently stucked here. I couldn't run any examples as the following errors would return:1.c:(.text+0x14): undefined reference to `pruio_new'1.c:(.text+0x28): undefined reference to `pruio_config'1.c:(.text+0x8e): undefined reference to `pruio_destroy'
I compiled on 4.14 kernel, libtinfo-6 seems to be the default on that kernel. May I ask why you downgraded? The latest debian image should solve the dependency issue.
Hi TJF,I compiled on 4.14 kernel, libtinfo-6 seems to be the default on that kernel. May I ask why you downgraded? The latest debian image should solve the dependency issue.May I ask which debian image that you used? Because the latest debian image is debian 9 (stretch), while the PPA hosted is using debian 8 (jessie).
Do you mean I should use latest image for debian 8, which is Debian 8.10?
Thank you & Best Regards
For now, the latest image (Debian 9.5, stretch) and installing the linux-headers will solve your problems. I've to find a solution for better handling the versions in future.
/tmp/ccS0jPtl.o: In function `main':
1.c:(.text+0x14): undefined reference to `pruio_new'
1.c:(.text+0x28): undefined reference to `pruio_config'
1.c:(.text+0x8a): undefined reference to `pruio_destroy'
For now, the latest image (Debian 9.5, stretch) and installing the linux-headers will solve your problems. I've to find a solution for better handling the versions in future.
pruio_destroy(io);
Is it because my ADC pins are not properly linked? I have checked my ADC are running fine, by running the line: cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
lsmod
Post the output from lsmod
debian@beaglebone:/var/lib/cloud9$ lsmodModule Size Used bypruss_soc_bus 16384 0evdev 24576 1uio_pdrv_genirq 16384 0usb_f_mass_storage 53248 2usb_f_acm 16384 2u_serial 20480 3 usb_f_acmusb_f_ecm 20480 2usb_f_rndis 32768 4u_ether 20480 2 usb_f_ecm,usb_f_rndislibcomposite 65536 18 usb_f_ecm,usb_f_acm,usb_f_mass_storage,usb_f_rndisiptable_nat 16384 0nf_conntrack_ipv4 20480 1nf_defrag_ipv4 16384 1 nf_conntrack_ipv4nf_nat_ipv4 16384 1 iptable_natnf_nat 32768 1 nf_nat_ipv4nf_conntrack 143360 3 nf_conntrack_ipv4,nf_nat_ipv4,nf_natiptable_mangle 16384 0iptable_filter 16384 0
libpruio 16384 0uio_pruss 16384 0
uio 20480 2 uio_pruss,uio_pdrv_genirqspidev 20480 0pru_rproc 28672 0pruss 16384 1 pru_rprocpruss_intc 16384 1 pru_rprocip_tables 24576 3 iptable_mangle,iptable_filter,iptable_natx_tables 36864 3 iptable_mangle,ip_tables,iptable_filter
On Friday, 9 November 2018 18:35:46 UTC+8, TJF wrote:Post the output from lsmod
libpruio 16384 0
debian@beaglebone:/var/lib/cloud9$ lsmodModule Size Used by
...
pru_rproc 28672 0
uio_pruss 16384 0uio 20480 2 uio_pruss,uio_pdrv_genirq
...
pruss 16384 1 pru_rprocpruss_intc 16384 1 pru_rproc
...
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_uio (4.4.x-ti, 4.14.x-ti & mainline/bone kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
cd /boot/dtbs/`uname -r` && mv am335x-boneblack-uboot-univ.dtb am335x-boneblack-uboot-univ.dtb.org
You're loading uio_pruss and rproc drivers at the same time. Edit your /boot/uEnv.txt file and comment out the rproc trigger
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_uio (4.4.x-ti, 4.14.x-ti & mainline/bone kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
I had exactly the same problem. I commented out the line according to your example. I don't know I was supposed to uncomment the bottom line. I tried both uncommented and commented... Anyway after reboot I am stuck with the same problem. lsmod gives the same output while the /boot/uEnv.txt file is modified and the debug information (running 1.c) is the same as well.
This is the output of the c compiler:/tmp/ccNSrhGX.o: In function `main':1.c:(.text+0x14): undefined reference to `pruio_new'1.c:(.text+0x28): undefined reference to `pruio_config'1.c:(.text+0x8a): undefined reference to `pruio_destroy'collect2: error: ld returned 1 exit status<builtin>: recipe for target '1' failedmake: *** [1] Error 1
Hi Hans!
Am Montag, 25. Februar 2019 16:42:07 UTC+1 schrieb Hans Leeuw:I had exactly the same problem. I commented out the line according to your example. I don't know I was supposed to uncomment the bottom line. I tried both uncommented and commented... Anyway after reboot I am stuck with the same problem. lsmod gives the same output while the /boot/uEnv.txt file is modified and the debug information (running 1.c) is the same as well.I need to know if you're booting from eMMC or uSD and which kernel you use (uname -r).
This is the output of the c compiler:/tmp/ccNSrhGX.o: In function `main':1.c:(.text+0x14): undefined reference to `pruio_new'1.c:(.text+0x28): undefined reference to `pruio_config'1.c:(.text+0x8a): undefined reference to `pruio_destroy'collect2: error: ld returned 1 exit status<builtin>: recipe for target '1' failedmake: *** [1] Error 1That's a diferent issue. It's not related to the boot process loading drivers. Instead it's a linker problem. Assuming you installed the libpruio-dev package, then executing once the command sudo ldconfig should solve the problem.
Regards
Op maandag 25 februari 2019 18:59:48 UTC+1 schreef TJF:Hi Hans!Hi TJF, thanks for the very quick response.
Am Montag, 25. Februar 2019 16:42:07 UTC+1 schrieb Hans Leeuw:I had exactly the same problem. I commented out the line according to your example. I don't know I was supposed to uncomment the bottom line. I tried both uncommented and commented... Anyway after reboot I am stuck with the same problem. lsmod gives the same output while the /boot/uEnv.txt file is modified and the debug information (running 1.c) is the same as well.I need to know if you're booting from eMMC or uSD and which kernel you use (uname -r).Kernel 4.14 .71-ti-r80Debian 9.8I have a pocket beagle so I guess that I boot from uSDand I use the cloud9 IDE
lsmod | grep uio
ls -l /dev/uio*
ls -l /sys/devices/
This is the output of the c compiler:/tmp/ccNSrhGX.o: In function `main':1.c:(.text+0x14): undefined reference to `pruio_new'1.c:(.text+0x28): undefined reference to `pruio_config'1.c:(.text+0x8a): undefined reference to `pruio_destroy'collect2: error: ld returned 1 exit status<builtin>: recipe for target '1' failedmake: *** [1] Error 1That's a diferent issue. It's not related to the boot process loading drivers. Instead it's a linker problem. Assuming you installed the libpruio-dev package, then executing once the command sudo ldconfig should solve the problem.I did that but it did not solve anything.
gcc -Wall -o 1 1.c -lpruio
Please post the output from
lsmod | grep uio
ls -l /dev/uio*
ls -l /sys/devices/
lsmod | grep uio
ls -l /dev/uio*
ls -l /sys/devices/platform/libpruio
debian@beaglebone:/var/lib/cloud9$ lsmod | grep uiouio_pdrv_genirq 16384 0libpruio 16384 0
uio_pruss 16384 0uio 20480 2 uio_pruss,uio_pdrv_genirq
debian@beaglebone:/var/lib/cloud9$ ls -l /dev/uio*crw-rw---- 1 root users 243, 0 Feb 25 19:11 /dev/uio0crw-rw---- 1 root users 243, 1 Feb 25 19:11 /dev/uio1crw-rw---- 1 root users 243, 2 Feb 25 19:11 /dev/uio2crw-rw---- 1 root users 243, 3 Feb 25 19:11 /dev/uio3crw-rw---- 1 root users 243, 4 Feb 25 19:11 /dev/uio4crw-rw---- 1 root users 243, 5 Feb 25 19:11 /dev/uio5crw-rw---- 1 root users 243, 6 Feb 25 19:11 /dev/uio6crw-rw---- 1 root users 243, 7 Feb 25 19:11 /dev/uio7debian@beaglebone:/var/lib/cloud9$ ls -l /sys/devices/total 0drwxr-xr-x 5 root root 0 Jan 1 2000 armv7_cortex_a8drwxr-xr-x 3 root root 0 Jan 1 2000 breakpointdrwxr-xr-x 20 root root 0 Jan 1 2000 platformdrwxr-xr-x 3 root root 0 Jan 1 2000 soc0drwxr-xr-x 3 root root 0 Jan 1 2000 softwaredrwxr-xr-x 6 root root 0 Jan 1 2000 systemdrwxr-xr-x 3 root root 0 Jan 1 2000 tracepointdrwxr-xr-x 14 root root 0 Jan 1 2000 virtualdebian@beaglebone:/var/lib/cloud9$ ls -l /sys/devices/platform/libpruiototal 0-rw-r--r-- 1 root root 4096 Feb 26 19:56 driver_override-r--r--r-- 1 root root 4096 Feb 26 19:56 modaliasdrwxr-xr-x 2 root root 0 Feb 26 19:56 power-rw-rw-r-- 1 root pruio 4096 Feb 25 19:11 statelrwxrwxrwx 1 root root 0 Feb 26 19:56 subsystem -> ../../../bus/platform-rw-r--r-- 1 root root 4096 Feb 25 19:11 ueventdebian@beaglebone:/var/lib/cloud9$
And compiling from command line seems to work!!! So I have to link something in Cloud9?Hmmm, at least it is not your package!!!Thanks a lot.
First time post. Thank you for all your work on libpruio.I am trying the pwm_cap example but am getting the following error:sudo ./pwm_capfailed setting input @P_IN (pin P9_42 claimed by: ocp:P9_42_pinmux)I am running 4.14 and have installed from the Debian packages, including libpruio, libpruio-dev and libpruio-lkm. I have made the following changes to uEnv.txt...
- enable_uboot_cape_universal=0
- uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
What else might I be missing? Thank you for the help.
debian@beaglebone:/usr/share/doc/libpruio-dev/examples$ sudo /opt/scripts/tools/version.shgit:/opt/scripts/:[1aa73453b2c980b75e31e83dab7dd8b6696f10c7]eeprom:[A335BNLTEIA00917BBBK4F44]model:[TI_AM335x_BeagleBone_Black]dogtag:[BeagleBoard.org Debian Image 2018-10-07]bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR]kernel:[4.14.71-ti-r80]nodejs:[v6.17.0]uboot_overlay_options:[enable_uboot_overlays=1]uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]uboot_overlay_options:[enable_uboot_cape_universal=0]pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]pkg:[bb-cape-overlays]:[4.4.20190227.0-0rcnee0~stretch+20190227]pkg:[bb-wl18xx-firmware]:[1.20190227.1-0rcnee0~stretch+20190227]pkg:[kmod]:[23-2rcnee1~stretch+20171005]pkg:[librobotcontrol]:[1.0.4-git20190107.0-0rcnee0~stretch+20190108]pkg:[firmware-ti-connectivity]:[20180825+dfsg-1rcnee1~stretch+20181217]groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai pruio]cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]dmesg | grep pinctrl-single[ 1.122289] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568dmesg | grep gpio-of-helper[ 1.134289] gpio-of-helper ocp:cape-universal: readyENDdebian@beaglebone:/usr/share/doc/libpruio-dev/examples$
debian@beaglebone:/usr/share/doc/libpruio-dev/examples$ sudo ./pwm_capfailed setting input @P_IN (pin P9_28 claimed by: 48038000.mcasp)
I am trying the pwm_cap example but am getting the following error:sudo ./pwm_capfailed setting input @P_IN (pin P9_42 claimed by: ocp:P9_42_pinmux)I am running 4.14 and have installed from the Debian packages, including libpruio, libpruio-dev and libpruio-lkm. I have made the following changes to uEnv.txt...
- enable_uboot_cape_universal=0
- uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
What else might I be missing? Thank you for the help.
###Cape Universal Enableenable_uboot_cape_universal=0
###Cape Universal Enable#enable_uboot_cape_universal=1
Thank you again. While I was disabling HDMI (both audio and video, just for good measure) in /boot/uEnv.txt, I noticed that I had incorrectly disabled the universal cape earlier. What I did was to change the value from one to zero as follows...
###Cape Universal Enableenable_uboot_cape_universal=0
...but I should have commented the line out like this...
###Cape Universal Enable#enable_uboot_cape_universal=1
So now the pwm_cap example is working on both P9_28 and P9_42.
Hi TJF,
root@beaglebone:/var/lib/cloud9# lsmod
Module Size Used byxt_conntrack 16384 1ipt_MASQUERADE 16384 1nf_nat_masquerade_ipv4 16384 1 ipt_MASQUERADEaes_arm_bs 20480 0crypto_simd 16384 1 aes_arm_bscryptd 24576 1 crypto_simdwl18xx 110592 0wlcore 237568 1 wl18xxmac80211 696320 2 wl18xx,wlcorecfg80211 622592 3 wl18xx,wlcore,mac80211bnep 28672 2hci_uart 69632 0btqca 16384 1 hci_uartbluetooth 552960 24 hci_uart,btqca,bnepecdh_generic 28672 1 bluetoothwlcore_sdio 16384 0
evdev 24576 1uio_pdrv_genirq 16384 0usb_f_mass_storage 53248 2usb_f_acm 16384 2u_serial 20480 3 usb_f_acmusb_f_ecm 20480 2usb_f_rndis 32768 4u_ether 20480 2 usb_f_ecm,usb_f_rndislibcomposite 65536 18 usb_f_ecm,usb_f_acm,usb_f_mass_storage,usb_f_rndis
iptable_nat 16384 1nf_conntrack_ipv4 20480 3
nf_defrag_ipv4 16384 1 nf_conntrack_ipv4nf_nat_ipv4 16384 1 iptable_nat
nf_nat 32768 2 nf_nat_masquerade_ipv4,nf_nat_ipv4nf_conntrack 143360 6 nf_conntrack_ipv4,ipt_MASQUERADE,nf_nat_masquerade_ipv4,xt_conntrack,nf_nat_ipv4,nf_natiptable_mangle 16384 0iptable_filter 16384 1
libpruio 16384 0uio_pruss 16384 0uio 20480 2 uio_pruss,uio_pdrv_genirq
spidev 20480 0pruss_soc_bus 16384 0pru_rproc 28672 0
pruss 16384 1 pru_rprocpruss_intc 16384 1 pru_rproc
ip_tables 24576 3 iptable_mangle,iptable_filter,iptable_natx_tables 36864 5 iptable_mangle,ip_tables,iptable_filter,ipt_MASQUERADE,xt_conntrack
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
##uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_rproc (4.14.x-ti kernel)
##uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_uio (4.4.x-ti, 4.14.x-ti & mainline/bone kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
root@beaglebone:/var/lib/cloud9# ls -l /dev/uio*ls: cannot access '/dev/uio*': No such file or directory
root@beaglebone:/var/lib/cloud9# ls -l /sys/devices/platform/libpruiototal 0-rw-r--r-- 1 root root 4096 Mar 21 14:00 driver_override-r--r--r-- 1 root root 4096 Mar 21 14:00 modaliasdrwxr-xr-x 2 root root 0 Mar 21 14:00 power-rw-rw-r-- 1 root pruio 4096 Mar 21 13:36 statelrwxrwxrwx 1 root root 0 Mar 21 14:00 subsystem -> ../../../bus/platform-rw-r--r-- 1 root root 4096 Mar 21 13:36 uevent