Search This Blog

Thursday, June 4, 2015

Set up debugger for BeagleBoneBlack and Eclipse

Today, I would like to show you how to set up debugger for development BeagleBoneBlack with Eclipse IDE. Let's see ...

1. First, install gdb-server on BBB

     $ sudo apt-get install gdb-server

2. install cross gdb on PC,
     2.1)  get it with apt-get
       $ apt-get install gdb-arm-linux-gnueabi
     2.2) If you can not install cross gdb package you can download sourcecode and build it from sourcecode instead.
http://www.gnu.org/software/gdb/download/
     
extract sourcecode and make cross gdb with ... 
       $  ./configure --target=arm-linux-gnueabi
       $ ./make -j4
       $ ./make install


3. open Eclipse and setup remote debugger


4. On BBB, set no asking password for the user. It was because the board always asking permission to run your application. This setting will prevent that.
  
   $ sudo visudo

   Then add this line at the bottom of the file
   
   username ALL=NOPASSWD: ALL



5. Now try to connect with gdb server on the BBB board. If all configurations were right, you should see the debug view like this ...


That is. Hope this tutorial could be useful for you. See you next time :)

Saturday, March 21, 2015

How to control LEDs using only Linux commands

I just learned how to control LEDs on the BBB using just basic linux command. Let's see...

1. I'm using Ubuntu running on the BBB board for this article. First login into the board and become root with command ...
$sudo bash

2. Access to /sys/class/leds , you can find 4 folders that contain control files for all USER 4 LEDs.


3. Let's control LED number 4 (the one that placed next to the Ethernet Port). Access the beaglebone:green:usr3 folder.

4. You can see the values inside control files with cat command.

5. Use this comand to turn On/Off LED
# echo 1 > brightness
# echo 0 > brightness

6. To blinking the LED, use this command ...
# echo timer > trigger
# echo 1000 > delay_off
# echo 500 > delay_on

That is for today. See you next time :)

 


Monday, December 29, 2014

Set up Eclipse to develop with BeagleBoneBlack

  BBB comes with various ways to develop application but I prefer the old method to making binary file on Linux PC with cross-compiler toolchain and execute the binary file on the target board. Here is what I have done ...



 1. On your Ubuntu PC, Install Toolchain for Beagle Bone Black
    $ sudo apt-get install gcc-arm-linux-gnueabi

2. Download and install Eclipse IDE for C/C++ Developers (I using  Eclipse Kepler (4.3) )



3. Install new software, Select Help -> Install New Software and select 
   General Purpose Tools -> Remote System Explorer End-User Runtime
   and
   Mobile and Device Development -> C/C++ Remote Launch


4. Create new C project by select New -> C project
   and setup cross build tools at wizard as shown below


5. Click on Run icon -> Run configurations
   then right click on C/C++ Remote Application -> New then click on "New" button




Select remote system type, I chose SSH Only

Fill BBB's IP address and description.


6. Fill "Remote Absolute File Path" for directory for store binary file on BBB. Then enter "Command to execute before application" with chmod +x <path/binaryfilename>  to allow execute permission.
7. Right click on Project->Properties, Select on Setting->Tool Setting->Cross CGC Linker and tick on "No Shared Libraries(-static)"

8. Writing/modify test code then clean and build up binary file.

9. Click on Run testbbb , If everything OK the binary file will be transferred to the BBB board via SSH and executing. The result will appear on the console. Hope it works for you too :D



Saturday, August 23, 2014

Set up home media server using BBB

     I got an idea to set up home media server based on my BeagleBoneBlack. Here is what I have done.

1.Get these stuffs
  • BeagleBoneBlack board
  • LAN Cable + Wifi network hub
  • USB hub
  • USB harddisk or other usb media drive. 
  • Your PC
  • Android Phone


 2. Put everything together.
 3. Next step, setup the software,
             $sudo apt-get install vim

  • Install Mediatomb for MediaServer.
             $sudo apt-get install mediatomb

  • Setup mediatomb as you wish. Using vim to edit /etc/mediatomb/config.xml
            https://help.ubuntu.com/community/MediaTomb

          Enable Web Interface ->
               <ui enabled="yes" show-tooltips="yes">

          Allowing Accounts ->
                <accounts enabled="no" session-timeout="30">

           Change port and interface by adding these lines after server tag ->
                 <server>
                       <port>49154</port>
                         <interface>eth0</interface>

        
            Save config file and exit

4.Mount the usb harddisk at /media
         $sudo mount /dev/sdXX /media

5.Restart mediatomb
          $sudo /etc/init.d/mediatomb restart   
    
6.On PC, Open web browser and enter http://<BBB ip address> : 49154

7.Login to mediatomb with it's web interface (Username: mediatomb ,Password:mediatomb)


8.Add media you want to play to database


9.Next, Connect to play media with your media player (In my case, I using VLC)
  •    Open Play list and select UPNP(Universal Plug and Play) on Local network.
Right click and select play, it will ask for network URL. Just enter the BBB IP address with setting port.
 

  • Then the play list should appeared.Enjoy the music !! 


10. For Android phone, I using Upnplay app to do the same job.




Wednesday, August 20, 2014

Run Ubuntu on BeagleBoneBlack

   I've tried another Linux distribution on my BBB. It's Ubuntu ! Here is what I've done.

1.You need these stuffs.
  •       Beagle Bone Black board. 
  •       micro-SDcard 8 GB (and SD Card adepter)
  •       5V power adepter.
  •       USB hub
  •       USB Keyboard
  •       LAN Cable and network to internet. 
  •       micro HDMI cable for connecting with monitor(For my case, I used 4D System's 4.3 inches LCD Cape instead of that)
 

2.Download Ubuntu Image file from ...
http://elinux.org/BeagleBoardUbuntu#eMMC:_BeagleBone_Black

3. Extract it with this below command.
# unxz BBB-eMMC-flasher-ubuntu-14.04-console-armhf-2014-08-13-2gb.img.xz

4. Put micro-SDcard into the adepter and plug it into computer ( I using Ubuntu base PC) then write image to the micro-sdcard with this command.
# dd if=BBB-eMMC-flasher-ubuntu-14.04-console-armhf-2014-08-13-2gb.img of=/dev/sdX
where X is your sdcard drive.

5. After a while, unplug the micro-SDcard from your PC and put it into the slot on the BBB. Afterthat, hold down S2 switch(or boot switch) and plug in the power adepter. When the Linux boot screen was appeared then release the S2 switch. The flashing eMMC progress has just begun. you have to wait until the "System halt" message was displayed.



6.Unplug the micro-SDcard and reset the board. After a minute, the log-in screen will appeared. (Username: ubuntu , Password: temppwd)



Reference :
http://elinux.org/Beagleboard:Ubuntu_On_BeagleBone_Black

Friday, April 18, 2014

4D System's 4.3 inches LCD Cape

I bought 4D System's 4.3 inches LCD Cape for my BBB. Just put the cape with the board and turn on the power. It works very well.


Produce detail :
http://www.4dsystems.com.au/product/4DCAPE_43/

  • 4DCAPE-43T (Resistive Touch version)
  • 4.3" TFT LCD Display, 480x272 Resolution
  • 7 push buttons, including LEFT, RIGHT, UP, DOWN, ENTER, RESET and POWER
  

Tuesday, April 8, 2014

How to update BBB firmware (by Linux pc)

Today I just updated new firmware image to my BBB by using my Linux pc. So, I will show you how to do it.

1. Better to check your BBB firmware version by access /media/BEAGLEBONE_/ID.txt file on the board.



2. Go to  http://beagleboard.org/latest-images and find the latest image (eMMC flasher version) that newer than your BBB firmware version. Then download it.



3. Extract image file, because I using Linux for all processes. So, I use xz tool to do that. (tar should do the same trick but my tar version just too old to do that and somehow I can't update it)

# xz -d BBB-eMMC-flasher-2013.09.04.img.xz

4. Now you need micro-sdcard + micro to sdcard adapter (and maybe sdcard to usb adapter in case that your pc has no sdcard slot) the image size is about 3.4 GByte so you need sdcard with more space than that.


5. Plug sdcard into pc and write the image to the sdcard with dd command.

# dd if=BBB-eMMC-flasher-2013.09.04.img of=/dev/sdc bs=1M
*** note: replace (/dev/sdc) with your sdcard device. check it carefully if you don't want to lose your data !!

6. After a while, when dd command is done, try to mount the sdcard and explore it.you will see something like this. 


7. Remove the sdcard and install micro-sdcard to the BBB. Remove all cables, hold "S2" Boot switch down while plug the power in. For about 2-3 seconds the user LEDs will flashing then it's ok the release the button. Now just wait... patiently



8. the user LEDs will flashing for about 30-45 minutes then they are all light up. That's mean the upgrade process was done. unplug the power and micro-sdcard. 


9.Power on and go check to ID.txt file. If it shows the new firmware version then everything is well done.

That is for today. See you next time :)