Ubuntu配置上位机Blackfin开发环境手记:[参考]http://blog.csdn.net/cp1300/article/details/8205282
My note for configuring the Software Development Environment(SDE) for TLL board on Ubuntu 12.04
【Section 0: Working Aim 工作目的】
现在手里有一个嵌入式开发板,搭载的是 AnalogDevices 公司的 Blackfin527 Processor,预装板载Uclinux操作系统。现在要配置上位机Linux/Ubuntu12.04 的开发环境,包括Blackfin Toolchain,Eclipse开发环境,和Library.
【Section1: Install Toolchain】
Install Blackfin Toolchain
Refer to the Note after this section if you meet some issue during this installation.
1.1 Package Installation (recommended)
· Get the latest Blackfin Toolchain from ADI
· Current up to date version is: 2011R1-RC4
· Example download command:
> wgethttp://blackfin.uclinux.org/gf/download/frsrelease/531/9508/blackfin-toolchain-2011R1-RC4.i386.rpm
> wgethttp://blackfin.uclinux.org/gf/download/frsrelease/531/9512/blackfin-toolchain-elf-gcc-4.3-2011R1-RC4.i386.rpm
· Check if a previous toolchain is already installed
· If so, remove old tool chain using rpm -e ...
> rpm -qa blackfin-toolchain\*
· Install Toolchain using RPM.
· Note: If a previous toolchain is installed, you may need to uninstall the previous toolchain see above
rpm -ivh blackfin-toolchain-*
More details on toolchain installation can be found at ADI's installation wiki entry.
1.2 Source Installation (advanced)
· Prequisites
yum install automake autoconf ncurses-devel zlib-devel texinfo
· set desired version
set VERSION=2011R1-RC2
· Get the latest Version of the GNU toolchain
svn checkout svn://sources.blackfin.uclinux.org/toolchain/tags/$VERSION/
· Compile and Install
> cd bfin_toolchain.$VERSION/buildscript/ > ./BuildToolChain -o <COMPILER_NSTALLATION_DIR>
Note: 这里要注意的是:
1.ADI offers serious packages of toolchain of one version for different usages. You should select which one is needed. I downloaded the 3 packages:
> blackfin-toolchain-2012R2-RC1.i386.rpm
> blackfin-toolchain-elf-gcc-4.3-2012R2-RC1.i386.rpm
> blackfin-toolchain-uclibc-default-2012R2-RC1.i386.rpm
from the Blackfin Linux website in the toolchain file release page
2. Ubuntu does not support installing this toolchain by RPM tool.
> I used the "How to Install rpm package on Ubuntu" approach to go around it. Chinese tutorial:
注意,用alien转换的deb包并不能保证100%顺利安装,所以可以找到deb最好直接用deb
有时候,我们想要使用的软件并没有被包含到 Ubuntu 的仓库中,而程序本身也没有提供让 Ubuntu可以使用的 deb 包,你又不愿从源代码编译。但假如软件提供有 rpm 包的话,我们也是可以在 Ubuntu中安装的。
方法一:
1. 先安装 alien 和 fakeroot 这两个工具,其中前者可以将 rpm 包转换为 deb 包。安装命令为: Intall the "alien" and "fakeroot" tools:
$ sudo apt-get install alien fakeroot
2. 将需要安装的 rpm 包下载备用,假设为 package.rpm。 Assume your package is: package.rpm
3. 使用 alien 将 rpm 包转换为 deb 包: use alien to convert rpm package into deb package:
$ fakeroot alien package.rpm
4. 一旦转换成功,我们可以即刻使用以下指令来安装: After a while, if succeed, install it using command:
$ sudo dpkg -i package.deb
如何转换rpm详细教程,参考这里: http://zhidao.baidu.com/question/377062512
[Section2. Install Eclipse]
Follow OS independent instructions:
Generally, follow instructions at: link
Note: It seems that Blackfin Toolchain only works in Helios Eclipse
Install components:
• Blackfin ucLinux
• GDB Hardware Debugging
• Target Terminal Management
• ZynxCDT
Below is my steps:
Refer to this web page: http://docs.blackfin.uclinux.org/doku.php?id=toolchain:eclipse:install
2.1.Install the Java Runtime Environment (JRE)
Checking your Java Runtime Environment version:
$ java -version
If you do not have Java installed, go through the :Install Java Runtime Env. 1.6.0
After you finished, the lines below should be displayed:
$ java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
2.2 Install the IDDE (Eclipse)
There are no executable installers for Eclipse. It is distributed as a zip archive which you can unpack anywhere you like, and then just run the eclipse.exe program in the eclipse sub-directory.
To get the installer, visit the Eclipse download page.
You will be presented with a variety of download choices. The only difference between them is the default plug-in set. Since you will most likely be compiling/debugging code for the Blackfin processor, you should pick Eclipse IDE for C/C++ Developers.:
Note: It seems that Blackfin Toolchain only works in Helios Version (Download this verion)
Extract: eclipse-cpp-helios-SR2-linux-gtk.tar.gz ,
1.Double-Click on Archive and Extract Eclipse into /tmp
2.Open Terminal Window
3.Install Required Packages
$ sudo su
# apt-get install g++
4.Relocate Eclipse
# mv /tmp/eclipse /opt
5.Create a Symlink
# ln -s /opt/eclipse/eclipse /usr/bin/eclipse
6. After, you can Start Eclipse from Terminal simply with:
# eclipse
or: (the way by which we launch Eclipse is under the Super User permision)
$ exit
$ sudo eclipse
If you want to overcome the root permission issue, refer to: here. but it does not work on my Ubuntu.
Reference: How-to Install Eclipse Juno 4.2 C/C++ on Ubuntu
If Installed Eclipse on Linux, but it does not start,read this
2.3 Install the Blackfin Plug-ins
The Blackfin plug-ins will require Eclipse 4.2, as well as the CDT. Additionally, you will have to install the GDB Hardware Debugging CDT plug-in (it is usually not installed by default).
To install the GDB Hardware Debugging plug-in, the CDT update site needs enabled.
To enable the CDT site:
1. Select the Eclipse menu Window→Preferences.
2. Select Install/Update→Available Software Sites and select the site, http://download.eclipse.org/tools/cdt/releases/juno.
(Here I used Helios, it's a little different. Keep it Enabled. Maybe we need to add the link in the last line)
3. Use the Enable button to enable the site.
Install the GDB Hardware Debugging plug-in via the Update Manager:
1. Select the Eclipse menu Help→Install New Software
2. Select the http://download.eclipse.org/tools/cdt/releases/indigo site in the Work With list(Add this, if there isn't.)
3. Enable the GDB Hardware Debugging plugin under CDT Optional Features
The Blackfin plug-ins can be obtained from the http://blackfin.uclinux.org/eclipse/ site via the Update Manager:
Then you can select the plug-ins to install:
The Blackfin Debug plug-in results in extra selectable entries in the “Debug Configuration” dialog, while the Tool chain plug-in allows for selecting the desired tool chain out of a list from within the New Project Wizard dialog.
The Eclipse C/C++ Development Tools (CDT) has excellent GDB support. However, there are a few stumbling blocks when trying to debug embedded applications, which Zylin AS has made some modifications in Eclipse CDT to improve support for GDB embedded debugging.
Path for update manager “Add Site”: http://opensource.zylin.com/zylincdt
While not released with Eclipse, there is a Subversion plugin called Subclipse. Visit the Subclipse homepage for some concise install directions.
Once you have Subclipse installed, the interface is the same as using the CVS plugin.
An ANSI (vt102) compatible Terminal including plug-ins for Serial, SSH and Telnet connections.
To use a serial terminal in Eclipse Juno. (Here we use Helios)
1: Install the software for serial terminals:
Navigate to: Help -> Install New Software...
Dropdown list for Work with: to say Juno - http://download.eclipse.org/releases/juno
Select: Mobile and Device Development, especially Target Management Terminal which is "An ANSI (vt102) compatible Terminal including plug-ins for Serial, SSH and Telnet connections."
Click Next and anything else to finish the install ...
2: Open the view
Navigate to: Window -> Show View -> Other ... -> Terminal -> Terminal (NOTE: singular Terminal, not plural Terminals)
3: Open a terminal
The rest should be fairly obvious as the view contains icons to Connect, Disconnect, Settings, etc which are related to Serial, SSH and Telnet connections.
Reference: click here
Target Management Terminal Serial Connector requires RXTX
Installation as an Eclipse Plugin via Update Manager:
Name = RXTX URL = http://rxtx.qbang.org/eclipse/
· select proper version, Install All
> svn co https://nuforge.coe.neu.edu/svn/pal/tags/v1.1_gnu/0.1/bare-c
> # --- Installation directories prefix = /home/student/agarwal/temp/pal
/opt/uClinux/
#-- Compiler COMPILER = <COMPILER_NSTALLATION_DIR> /bfin-elf/bin/bfin-elf-gcc
eg. #-- Compiler COMPILER = /opt/uClinux/bfin-elf/bin/bfin-elf-gcc
For tcsh shellHere we use:
> setenv PATH <COMPILER_NSTALLATION_DIR>/bfin-elf/bin/:$PATH
For bash shell
> export PATH; PATH=<COMPILER_NSTALLATION_DIR>/bfin-elf/bin:$PATH
> export PATH; PATH = /opt/uClinux/bfin-elf/bin:$PATH
> cd common
> make clean
> make
> sudo make install
> source <installation path>/bin/setup.sh
eg. > source /usr/uClinux/bfin-elf/bin/setup.sh
> cd demo
> make clean
> make
> sudo gedit /etc/profile
> export PATH=$PATH:/opt/uClinux/bfin-linux-uclibc/bin
> JAVA_HOME=/opt/java/32/jre1.6.0_16
> PATH=$JAVA_HOME/bin:$PATH
> cd /home/yourname/programfiles/eclipse
> ./eclipse
> sudo apt-get install minicom
The TLL System Design Environment (SDE) running on the host PC comes pre-configured with
the required settings for serial-UART communications between the host PC and the TLL6527M
base module. Generally, for use with TLL6527M the settings need not to be changed
(Note: From the SDE OS version 0.3.2, the serial terminal program Minicom is set to
open /dev/ttyUSB0 with the needed configuration as mentioned above.).
The TLL6527M on power-up is set by default to the following serial-UART communication settings:
$ sudo su# make
# [root@localhost template]# make install
1. Identify the Ethernet Interface Name inside the Virtual Machine
> ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:51:9B:E6
inet addr:192.168.64.138 Bcast:192.168.64.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe51:9be6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
B) Interface without IP address (connection to PAL)
The device #: 00:50:B6:xx:xx:xx is your Ethernet Adapter #
eth1 Link encap:Ethernet HWaddr 00:50:B6:0A:2A:1A
inet6 addr: fe80::20c:29ff:fe51:9be7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
The PAL interface can be recognized by
(1) a different second line: the line starting with "inet addr" is missing (even though the "inet6 addr"
may be listed)
(2) the HWaddr starts with 00:50:B6.
2. Set IP address for interface connected to PAL
> sudo ifconfig eth1 192.168.40.1
3. Validate that the interface has accepted the IP setting
4. Establish a Telnet connection to the board.
> telnet 192.168.40.211
Sometimes, when our automatically network connection is not stable, i.e. the DHCP can not work proplerly,
we need the mannually conifigure the ip for our telnet.
Manually Configuring Ethernet
This section describes how to manually configure the Ethernet connection on SDE 5.3.x. This is an
alternative to running the automated setup script add-trendnet-adapter.py.
===============================================
If you want to use the library "libasound.a/out",
you may need the "libasound2" package.
* For My Nuggets:
* I need library "TLL6527M_C_API_uClinux_TLL2012R1DevTEST" from /prerelease20120823/libary/elfStatic/
* I need include /prerelease2012xxxx/inclue/common/
*
* For Audio:
* I need library "asound" from /opt/ALSA_LIB
* I need include .../prerelease2012xxxx/inclue/audio/
* I need include /opt/ALSA_INCLUDE/alsa/sound
I found there is no /opt/ALSA_LIB folder in my Ubuntu12.04 system disk.
the brown text below is my failed configuration note, just skip it ;)
----so, go to Ubuntu website and download the alsa package:
https://launchpad.net/ubuntu/precise/+source/alsa-lib/1.0.25-1ubuntu10
Download the alsa-lib_1.0.25.orig.tar.bz2, extract it into Download folder.
run the command in Terminal:
$ cd ~/Download/alsa-lib-1.0.25
$ sudo ./configure
$ sudo make
$ sudo make install
There are some errors existed.
-----------------------------
I searched the library "asound", and I find it is in the "libasound2" package.
----Install "libasound2" package: ----
Download the file "libasound2_1.0.22-0ubuntu7_i386.deb" package from:
http://packages.ubuntu.com/lucid/libasound2
Install the .deb package:
> $ sudo dpkg -i libasound2_1.0.22-0ubuntu7_i386.deb
An error happend:Package libpython2.6 is not installed.
It depends on libpython2.6.
----Install the "libpython2.6" package: ----
Download the package at:http://packages.ubuntu.com/zh-cn/lucid/libpython2.6
Install it:
> $ sudo dpkg -i libpython2.6_2.6.5-1ubuntu6.1_i386.deb
but:
libpython2.6 depends on python2.6
libpython2.6 depends on libssl0.9.8
----Install the "python2.6" and "libssl0.9.8"
----Install Python 2.6 in Ubuntu 12.04:
Ref:http://www.ubuntututorials.com/install-python-2-6-ubuntu-12-04/
Ubuntu 12.04 includes Python 2.7.3 and Python 2.6 is no longer available for install.If you need
to run legacy software which only support Python 2.6.Below steps will show you how to install Python 2.6
from PPA,alternatively you also can build it yourself.
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.6 python2.6-dev
some error happens, about dependency.
----Install libssl0.9.8 ----
Download it from:https://launchpad.net/ubuntu/precise/i386/libssl0.9.8/0.9.8o-7ubuntu3.1
Install it by dpkg -i libssl...deb
It seems like succeeded.
----Install Python 2.6 again----
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.6 python2.6-dev
I got:"E: Unmet dependencies."
----Install libpython2.6 :
> sudo dpkg -i libpython2.6_2.6.5-1ubuntu6.1_i386.deb
it still need for python 2.6
----Install Python2.6:
1. Download "Python-2.6.tar.bz2" from:
http://www.python.org/ftp/python/2.6/Python-2.6.tar.bz2
2. Extract it
$ tar jxvf Python-2.6.tar.bz2
3. $ cd Python-2.6
$ sudo ./configure
$ sudo make
$ sudo make install
----Install libpython2.6 :
> cd ~/Downloads
> sudo dpkg -i libpython2.6_2.6.5-1ubuntu6.1_i386.deb
Error: libpython2.6 depends on python2.6 (= 2.6.5-1ubuntu6.1);
however: Version of python2.6 on system is 2.6.8-2+precise1.
----Install python2.6.5-1ubuntu6.1
Download it from:
https://launchpad.net/ubuntu/+archive/primary/+files/python2.6_2.6.5.orig.tar.gz
Extract: $ tar zxvf python2.6_2.6.5.orig.tar.gz
> $ cd ~/Downloads/python2.6-2.6.5
> $ ./configure
> $ sudo make
> $ sudo make install
----Install libpython2.6 :
> cd ~/Downloads
> sudo dpkg -i libpython2.6_2.6.5-1ubuntu6.1_i386.deb
Error: libpython2.6 depends on python2.6 (= 2.6.5-1ubuntu6.1);
however: Version of python2.6 on system is 2.6.8-2+precise1.
----Install libpython2.6_2.6.8-2+precise1_i386.deb
Download it from:
https://launchpad.net/~fkrull/+archive/deadsnakes/+build/3802469/+files/libpython2.6_2.6.8-
2%2Bprecise1_i386.deb
Install it:
$ sudo dpkg -i libpython2.6_2.6.8-2+precise1_i386.deb
It seems like succeeded.
----Install "libasound2" package again:
Install the "libasound2" package:
> $ sudo dpkg -i libasound2_1.0.22-0ubuntu7_i386.deb
It seems like succeeded.
----Check the /opt/ALSA_LIB and /opt/ALSA_INCLUDE
No! :(
There is no folder about alsa in /opt, but check if my uClinux programe compiling can be correct. add
the "asound" library directly as -lasound, but no assigning the path of it because I have installed the
libasound2 package above.
Go back to Eclipse, and configure the library:
asound
"TLL6527M_C_API_uClinux_TLL2012R1DevTEST" from /prerelease20120823/libary/elfStatic/
configure the include:
prerelease../include/audio
prerelease../include/common
usr/include/alsa/sound
When compiling in Eclipse, Get the error: cannot find the lib: -lasound
----Install the libasound2-dev
> $ sudo apt-get install libasound2-dev
Get error:
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
----Install the alsa-lib-1.0.13:
Go to the webpage:
http://www.linuxfromscratch.org/blfs/view/6.3/multimedia/alsa-lib.html
Download the .tar.bz2 package:
http://gd.tuwien.ac.at/opsys/linux/alsa/lib/alsa-lib-1.0.13.tar.bz2
Extract it:
> $ tar jxvf alsa-lib-1.0.13.tar.bz2
> $ cd ~/Downloads/alsa-lib-1.0.13/
Install the library:
> $ ./configure --enable-static && make
> $ sudo make install
It seems that installing the alsa-lib-1.0.13 succeeded,
the library file "libasound.a/out" at: /usr/lib
I just included in Eclipse the header files at: /usr/include/alsa/sound
But the Eclipse still report error:
DescriptionResourcePathLocationType
skipping incompatible /usr/lib/libasound.so when searching for -lasoundaudio_example
C/C++ Problem
skipping incompatible /usr/lib/libasound.a when searching for -lasoundaudio_example
C/C++ Problem
cannot find -lasoundaudio_exampleC/C++ Problem
make: *** [audio_example] Error 1audio_exampleC/C++ Problem
----Copy the /opt/ALSA_INCLUDE/alsa/sound & /opt/ALSA_LIB from the Fedora Host System that released by The
Learning Labs company. Put them into my U-disk.
Now plug in the u-disk, and we need to mount the devices.
Run the command to see which devices do you have:
> $ sudo fdisk -l /dev/sda
And I got:
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029a1e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 14680063 7339008 83 Linux
/dev/sda2 14682110 16775167 1046529 5 Extended
/dev/sda5 14682112 16775167 1046528 82 Linux swap / Solaris
There should be a FAT32 System disk, but there is no.
If you only plugged in one U-disk, and your disk is not scsi interface, its hardware name is: sda1
Build an usb folder at your mnt: $ sudo mkdir /mnt/usb
Mount your u-disk: $ mount -t vfat /dev/sda1 /mnt/usb
I copied it to the /opt folder from my ~/Downloads which is containing the /ALSA_INCLUDE and /ALSA_LIB
which is copied from U-disk:
~/Downloads/opt> $ sudo cp -r ALSA_INCLUDE /opt/
~/Downloads/opt> $ sudo cp -r ALSA_LIB /opt/
Now we have the libraries and head files needed for audio programming.
Test in Eclipse: I don't have the permission to access the foler I copied just now.
[Here, you can try command: "sudo chmod 777 foldername"]
[Ref:http://superuser.com/questions/208606/how-to-change-file-permissions-for-a-directory-in-one-
command]
----Log out linux and log in as the root user:
Ref:http://linuxathena.com/tutorials/login-root-account-gui-ubuntu-12-04/
Open Terminal, input: sudo passwd
update the UNIX password: xxx
By default, Ubuntu doesn't allow root log on the graphic interface.
Modify the "/etc/gdm/gdm.conf" file to allow root log on.
In this file, modify the "AllowRoot = false" into "AllowRoot = true".
Ubuntu 12.04下允许Root用户直接登录图形界面:
Ref:http://askubuntu.com/questions/126286/unable-to-login-as-root-from-the-login-screen-even-though-
i-have-a-root-account
Now, I'm using Ubuntu 12.04, I have to enable it in /etc/lightdm/lightdm.conf
Enter the sudo mode:
> $ su root
Change the file permission of "lightdm.conf"
> # chmod 777 /etc/lightdm/lightdm.conf
> # vi lightdm.conf
Add the following line:
greeter-show-manual-login = true
Save and exit: ":wq"
Reboot the system. Select the user, input "root" and password.
Change the permission of /opt/alsa* folders.
Logout and login as former user.
Test the access to the /opt/alsa* folders in Eclipse.
There are 5 new errors occured.
DescriptionResourcePathLocationType
undefined reference to `_dlsym'audio_exampleline 121, external location: /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/dlmisc.cC/C++ Problem
undefined reference to `_dlclose'audio_exampleline 91, external location: /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/dlmisc.cC/C++ Problem
undefined reference to `_dlsym'audio_exampleline 167, external location: /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/dlmisc.cC/C++ Problem
make: *** [audio_example] Error 1audio_exampleC/C++ Problem
undefined reference to `_dlopen'audio_exampleline 70, external location: /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/dlmisc.cC/C++ Problem
And I received the notes form the TLL board provider:
----------------------
At this moment we're only supporting our Fedora based TLL SDE as Design / Development host OS for TLL platforms, this enables us to ensure all the tools/settings/dependencies work seamlessly with each other and thus requires us to concentrate efforts on a single platform avoiding a proliferation of different OS flavors. Hence we've tested the nuggets and build tools ONLY on TLL SDE(Fedora).
I would guess that ALSA libs would not be OS flavor dependent and might be usable just by coping library binaries and include header files over to your Ubuntu machine. However we'll not be able to support any issues you might face there.
Why don't you consider building a personal TLL SDE bootable pen drive which you can plug into your own machine while working with TLL platforms and then just reboot your system into your ubuntu when you need to use other things you are using. You can install it on a 4GB (or greater) pen drive.
Here is a link to SDE installation notes:
https://tll.assembla.com/spaces/designcenter/wiki/System_Design_Environment#2._installation_of_tll_sde
Please feel free to let us know any issues you face with this use mode of SDE.
---------
Hello ,
let me echo his words.
I would not recommend any use on a custom installation. There are too many variables that can not be sufficiently controlled. As such it is practically infeasible to support such an installation.
Alternatively, you can install/run the SDE directly as outlined by Ashish, however at a loss of company-specific customizations.
----------------------------
至此,我配置好了blackfin的开发环境,但是没法配置适用于TLL所有板载功能的开发环境。因为TLL板自己的开发环境为了使用TLL板,有太多的东西需要配置。我并没有完整的配置文档。或许他们公司经过一次次的修改,才发布的SDE本身已经不知道要配置哪些东西了。
到此为止吧。。。。。但是:
=============================================================================
But when I compile the accelerometer, there is no errors happened. This
makes me burn a new fire in my mind.
I began to test the other nuggets except audio.
=============================================================================
OMG!!!
I fixed this problem by: add the libarary -ldl into my objects.mk file which is created
by Eclipse.
so:
* For My Nuggets On Ubuntu12.04: * You need library "TLL6527M_C_API_uClinux_TLL2012R1DevTEST" at /prerelease20120823/libary/elfStatic/ * You need include /prerelease2012xxxx/inclue/common/ * * For Audio: * You need library "dl" (No need to assign its path, system default.) * You need library "asound" from /opt/ALSA_LIB * You need include .../prerelease2012xxxx/inclue/audio/ * You need include /opt/ALSA_INCLUDE/alsa/sound=====================================================
遇到 Eclipse 编译时出现:
undefined reference to '_dlclose'
undefined reference to '_dlopen'
undefined reference to '_dlsym'
undefined reference to '_dlsym'
我的解决办法:
我是修改了.mk 文件,实际上是增加了一个库, dl (dynamic link)
在原本描述链接库的地方:
LIBS := -lTLL6527M_C_API_uClinux_TLL2012R1DevTEST -lasound修改为:"
LIBS := -lTLL6527M_C_API_uClinux_TLL2012R1DevTEST -lasound -ldl再重新编译,就没有错误产生了。
But I met the errors when I launch the app bin file on my target board! :(
See the log below:
root:/home> ls
audio_example matlab-serial
root:/home> ./audio_example
Switching to default type SSM2603, for stereo capture
through Line In, at 16 bits per sample and 48000 Hz
sampling rate
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/dlmisc.c:246:(snd1_dlobj_cache_get) symbol _snd_ctl_hw_open is not defined inside [builtin]
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/conf.c:3326:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: No such device or address
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/dlmisc.c:246:(snd1_dlobj_cache_get) symbol _snd_ctl_hw_open is not defined inside [builtin]
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device or address
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/conf.c:4184:(_snd_config_evaluate) function snd_func_concat returned error: No such device or address
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such device or address
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/conf.c:4663:(snd_config_expand) Evaluate error: No such device or address
ALSA lib /home/Lavanya/2011R1_Release/blackfin-linux-dist_RC3/lib/alsa-lib/alsa-lib-1.0.24/src/pcm/pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.default
Cannot open device::No such device or address
Cannot Init
root:/home>