The Beagle boards are perfectly placed for the integration of high-level software and low-level electronics in any type of project.
The major advantage over more traditional embedded systems, such as the Arduino, PIC, and AVR microcontrollers, is apparent when you leverage the Linux OS for your projects. For example, if you built a home automation system using the BeagleBone and you then decided that you wanted to make certain information available on the internet, you could simply install a web server.
The BeagleBone Black was one of the first ever BeagleBoards I have had, and it was a bit of a hassle for me to set it up initially. Few things to keep in mind here.
/boot/uEnv.txtfile and uncomment the last line. After doing that, I was finally able to flash the eMMC with the latest debian image.
Created a new partition 1 of type 'Linux' and of size 29.7 GiB. Partition #1 contains a ext4 signature. Do you want to remove the signature? [Y]es/[N]o:N
Where you have to type in N and press enter.
resize2fs /dev//mmcblk0p1as root and you'll get a similar output:
resize2fs 1.43.4 (31-Jan-2017) Filesystem at /dev//mmcblk0p1 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 4 The filesystem on /dev//mmcblk0p1 is now 7790720 (4k) blocks long.
Inorder to take a backup of your entire SD card, run the command:
sudo dd if=/dev/sdd of=backup.img bs=1M count=4096 status=progress
I followed this procedure to make the release Bela on BBAI image:
sudo dd if=/dev/sdd of=gsoc21/bkps/belaAI.img bs=1M status=progress count=3462for a 3.5GB SD Card image.
xz -k -9 -v belaAI.img
Refer the image below to see the IO pins to the PRU in the BeagleBone black (taken from here )
ref1: Rebuilding PRU Firmwares on Target Using Sitara Processors The most basic example is given on the homepage where you can learn how to simple start or stop the PRU. Here, we will look at some basic examples in C which can be downloaded from
git clone git://git.ti.com/pru-software-support-package/pru-software-support-package.git. Let's look at how to run the most basic example that echos whatever we send to the PRU back to us.
# Make sure that you are su $ sudo -i # Enter the passwd: temppwd $ cd /home/debian/pru-software-support-package/examples/am572x/PRU_RPMsg_Echo_Interrupt1_0 # Navigate to the example $ export PRU_CGT=/usr/share/ti/cgt-pru $ ln -s /usr/bin/ /usr/share/ti/cgt-pru/bin # Create a symbolic link $ vim main.c
First change the following lines:
#define CHAN_DESC "Channel 39" #define CHAN_PORT 39
and then, go to line#101 and inside the while loop write:
payload = 'T' payload = 'I'
Once done, save and exit the editor and then run
Assuming that everything went as planned, you should see an output like this:
Building project: PRU_RPMsg_Echo_Interrupt1_0 Output files can be found in the "gen" directory Finished building project: PRU_RPMsg_Echo_Interrupt1_0
and the contents of
gen folder should look something like this:
-rw-r--r-- 1 root root 74832 Jun 27 05:25 PRU_RPMsg_Echo_Interrupt1_0.out -rw-r--r-- 1 root root 14595 Jun 27 05:25 PRU_RPMsg_Echo_Interrupt1_0.map -rw-r--r-- 1 root root 58664 Jun 27 05:25 main.object -rw-r--r-- 1 root root 747 Jun 27 05:25 main.pp
Now you need to first make a folder by the name
\lib\firmware\. and then,
cp /home/debian/pru-software-support-package/examples/am572x/PRU_RPMsg_Echo_Interrupt1_0/gen/PRU_RPMsg_Echo_Interrupt1_0.out echomod.out
Now you need to create a symbolic link to this new pru firmware, and delete the older one.
rm am57xx-pru1_0-fw;ln -s /lib/firmware/pru/echomod.out am57xx-pru1_0-fw
cd /dev/remoteproc/ and then
pruss1-core0/. Here, you will first stop the pru incase it is running using
echo 'stop' > state. Now it's time to load the new firmware into the PRU using:
echo 'am57xx-pru1_0-fw' > firmware
Finally, the new program has been uploaded and you can start the PRU again using
echo 'start' > state.
To test this, we will check first if the right rpmsg handle has been created in
/dev/ folder using
# ls /dev/ | grep pru rpmsg_pru39
If you get an output similar to above, everything is going great so far! Now we can finally get to testing if our new program works that basically replaces the first 2 characters of the input string. To do that, we will
$ echo 'test' > /dev/rpmsg_pru39 # The above just sends test as the input string to the PRU # Now to view the result, we will $ cat /dev/pmsg_pru39 TIst
If you get that output to
cat then the firmware has been loaded and is up and running successfully. You have just learned the following from this tutorial:
To boost the CPU speed, use
sudo cpupower frequency-set -d 1.5GHz -u 1.5GHz. Remember to install a fan or fan cape before that so your BBAI does not over heat!
Some keywords to remember:-
Preemption: In computing, preemption is the act of temporary interruption of an executing task, with the intention of resuming that at a time later.
McASP is an acronym for Multichannel Audio Serial Port, a communication peripheral found in Texas Instruments family of digital signal processors. McASP functions as a general-purpose audio serial port.