Hi all
I’m compiling a fairly simple program that accesses the PRU0 shared ram
When I run it with sudo it has no problems.
I’m guessing it access a privileged space but not sure the ways round the segmentation fault.
Any suggestions appreciated.
Neil
I want to run it from start up, which I think at its simplest means adding something to cloud9/auotrun -
I build the program with
sudo deploy.sh:
mkdir -p bin
gcc bbbio_api_mng.c -D MAIN_LOCAL -o bin/bbbio_api_mng
chmod 755 bin/bbbio_api_mng
./bin/bbbio_api_mng
autorun.sh: target program to add to cloud9/auotrun
#! /bin/bash
This setupup the pins and auto starts the ppm-pru - works manually with sudo.
cd /var/lib/cloud9/git/bbb_pru_ppm
PIN_NUMBER1=P9_25
PIN_NUMBER2=P9_27
PIN_NUMBER3=P9_28
PIN_NUMBER4=P9_29
PIN_NUMBER5=P9_30
PIN_NUMBER6=P9_31
PIN_NUMBER7=P8_11
PIN_NUMBER8=P8_12
config-pin -a $PIN_NUMBER1 pruout
config-pin -a $PIN_NUMBER2 pruout
config-pin -a $PIN_NUMBER3 pruout
config-pin -a $PIN_NUMBER4 pruout
config-pin -a $PIN_NUMBER5 pruout
config-pin -a $PIN_NUMBER6 pruout
config-pin -a $PIN_NUMBER7 pruout
config-pin -a $PIN_NUMBER8 pruout
./mng/bin/bbbio_api_mng
#end