I've done some progress already, I can now run without Xenomai. Now cleaning it up and pushing soon.
AI-64
Nice one, you are having more success that I have been having.
Been nose deep in trying to work out what the hell is going on with this board.
The two C66 DSPs, the C71 DSP and two of the R5Fs seem to be being used for some TI vision shenanigans, I'm guessing this is just to do with the dts stuff from TI, not sure it is really needed!
All the pru stuff seems to be installed and none of the prus "seem" to be doing anything currently, once I manage to just get a gpio toggling I will be happy!
OK, I have done my share.
The allow-no-xenomai branch should be able to run a bare minimum program on regular BBB without Xenomai.
And BBAI-support-rebased is now rebased on top of that and should work as a starting point for BBAI-64 work.
In both cases, to setup the build in xenomai-free mode, do as follows:
make coreclean
make -f Makefile.libraries cleanall
echo "BELA_RT_BACKEND=" >> CustomMakefileTop.in
alternatively to the last line, you can pass BELA_RT_BACKEND=
as an option to make
but the above is more consistent (remember to do the same thing again but setting BELA_RT_BACKEND=xenomai
in order to revert to normal mode).
Nice one.
First I will try to get the allow-no-xenomai built and running on a BBB...
- Edited
ignore post
Ok after a bit of flaffing about I got it built on BBB: Linux beaglebone 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 armv7l GNU/Linux
Couple of issues:
sock not defined, so quick hack:
diff --git a/libraries/Midi/Midi.h b/libraries/Midi/Midi.h
index 504c6908..16cd7c4f 100644
--- a/libraries/Midi/Midi.h
+++ b/libraries/Midi/Midi.h
@@ -416,4 +416,5 @@ private:
#ifdef XENOMAI_SKIN_posix
int sock;
#endif
+ int sock;
};
and stdargs missing:
diff --git a/libraries/Scope/Scope.cpp b/libraries/Scope/Scope.cpp
index e3421810..6f8e2f0c 100644
--- a/libraries/Scope/Scope.cpp
+++ b/libraries/Scope/Scope.cpp
@@ -5,6 +5,7 @@
#include <JSON.h>
#include <AuxTaskRT.h>
#include <stdexcept>
+#include <stdarg.h>
Scope::Scope(): isUsingOutBuffer(false),
isUsingBuffer(false),
So now I am at the stage where I have missed something but am not sure how to fix it:
debian@beaglebone:~/development/Bela$ sudo /home/debian/development/Bela/projects/exampleTempProject/exampleTempProject
grep: /proc/xenomai/sched/stat: No such file or directory
Failed to open PRU driver
Segmentation fault
How do I install the PRU driver?
AndyCap How do I install the PRU driver?
Oh right that's because you need the following additional
parameters to make
:
ENABLE_PRU_UIO = 0 ENABLE_PRU_RPROC = 1
Currently it's trying to use libprussdrv, which doesn't work because you have to use rproc on a stock BBB image.
AndyCap #ifdef XENOMAI_SKIN_posix
int sock;
#endif
+ int sock;
};
hmm I must have done something wrong there as I thought I had removed all occurrencies of XENOMAI
also in libraries
... need to investigate more. Btw, to build a basic C++ project you shouldn't need ant libraries
. Maybe go back to Fundamentals/sinetone
?
- Edited
ok, did a clean and:
debian@bela:~/development/Bela$ sudo make EXAMPLE=Fundamentals/sinetone ENABLE_PRU_UIO=0 ENABLE_PRU_RPROC=1 run CL=-v
Failed to stop bela_startup.service: Unit bela_startup.service not loaded.
grep: /proc/xenomai/sched/stat: No such file or directory
No process to kill
Building render.cpp...
...done
Linking...
...done
Running /home/debian/development/Bela/projects/exampleTempProject/exampleTempProject -v
grep: /proc/xenomai/sched/stat: No such file or directory
Bela_initAudio()
Starting with period size 16 ;analog enabled
DAC level 999999.000000 dB; ADC level 999999.000000 dB; headphone level 999999.000000 dB
Detected hardware: Bela
Hardware specified at the command line: NoHardware
Hardware specified in the user's belaconfig: NoHardware
Hardware to be used: Bela
Codec mode: 0 ()
gFifoFactor: 1
core audioFrames: 16
Project name: exampleTempProject
Failed to open PRU driver
Segmentation fault
make: *** [Makefile:605: runonly] Error 139
p.s. that is after it has built everything!
Ok, edited the makefile and am building with sudo make "CFLAGS=-DENABLE_PRU_UIO=0 -DENABLE_PRU_RPROC=1" EXAMPLE=Fundamentals/sinetone run CL=-v
fingers crossed...
ok, getting past that and now onto this:
Starting program: /home/debian/development/Bela/projects/exampleTempProject/exampleTempProject
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[Detaching after fork from child process 3721]
grep: /proc/xenomai/sched/stat: No such file or directory
Program received signal SIGSEGV, Segmentation fault.
PRU::initialise (this=this@entry=0x9c0a8, newBelaHw=<optimized out>, pru_num=1, uniformSampleRate=<optimized out>, mux_channels=0,
stopButtonPin=stopButtonPin@entry=115, enableLed=true) at core/PRU.cpp:385
385 pruMemory = new PruMemory(pru_number, context, *pruManager);
ah ENABLE_PRU_RPROC not set, just going to force those flags in the makefile...
Right it seems to be building the rproc stuff now, I think I may be missing some more defines though:
Building PruManager.cpp...
core/PruManager.cpp:41:2: warning: #warning Untested PRU addresses for am3358 [-Wcpp]
#warning Untested PRU addresses for am3358
^~~~~~~
core/PruManager.cpp:62:2: error: #error No PRU firmware defined. Pass the name of firmware.out file using firmwareBelaRProcNoMcaspIrq=<path> and firmwareBelaRProcMcaspIrq=<path>
#error No PRU firmware defined. Pass the name of firmware.out file using firmwareBelaRProcNoMcaspIrq=<path> and firmwareBelaRProcMcaspIrq=<path>
^~~~~
make: *** [Makefile:463: build/core/PruManager.o] Error 1
- Edited
And an update from the AI-64
Basically got everything building (for sinetone) apart from the assembler: so the .S files and math_runfast.
After a rest I might take it upon myself to just replace this with C code to see if I can get it going...
- Edited
AndyCap Right it seems to be building the rproc stuff now, I think I may be missing some more defines though:
yes
Honestly, you should probably be trying to build the BBAI-support branch, where the RPROC stuff should just work when you pass ENABLE_PRU_UIO=0 ENABLE_PRU_RPROC=1
to make
( that's what I was referring to earlier, didn't realise yo were still on allow-no-xenomai
). This sets the various firmwareBelaRProc...
here https://github.com/BelaPlatform/Bela/blob/BBAI-support-rebased/Makefile#L334
AndyCap Basically got everything building (for sinetone) apart from the assembler: so the .S files and math_runfast.
well you don't normally need the .S files (I know they are built as part of the core but FormatConvert.S
is unused and OscillatorBank_routines.S
is only used by some example. As for math_runfast()
, you can just ifdef out the content of enable_runfast()
. I don't even know whether it is supposed to have any effect on the vfpv4 that (I think) comes with these A72.
I am also guessing that these should go: -march=armv7-a -mtune=cortex-a8
Right something new now
debian@AI64:~/development/Bela$ sudo make EXAMPLE=Fundamentals/sinetone run CL=-v
Failed to stop bela_startup.service: Unit bela_startup.service not loaded.
grep: /proc/xenomai/sched/stat: No such file or directory
No process to kill
/bin/sh: 1: screen: not found
Building render.cpp...
...done
Linking...
...done
Running /mnt/usb/development/Bela/projects/exampleTempProject/exampleTempProject -v
grep: /proc/xenomai/sched/stat: No such file or directory
Bela_initAudio()
Starting with period size 16 ;analog enabled
DAC level 999999.000000 dB; ADC level 999999.000000 dB; headphone level 999999.000000 dB
Warning: couldn't export amplifier mute pin 124
gpio/direction: No such file or directory
Couldn't set direction on amplifier mute pin
Error: unable to initialise audio
make: *** [Makefile:670: runonly] Error 1
Looks like nothing can be written to gpio/export, looking into it...
AndyCap /bin/sh: 1: screen: not found
WHAT? is that even Linux if it doesn't have screen
?
AndyCap Looks like nothing can be written to gpio/export, looking into it...
it may be that they have dropped that interface and there is a new libgpio (???) around? They mentioned it years ago. And even if that worked, all Gpios via Gpio.h won't work (needs updating addresses in GPIO.cpp).
AndyCap Couldn't set direction on amplifier mute pin
This has to be disabled via commenting out settings->ampMutePin = -1
. E.g.: put this in the render file:
void Bela_userSettings(BelaInitSettings *settings)
{
settings->ampMutePin = -1;
}
Then also run the project with -G 0
and -N 0
to disable digital and analogs.