移植am335蓝牙协议栈出现错误
下载AM335xBluetopiaLinuxProduction-4.0.3.0.1.0后 ,
修改了setup-bt 的
# Path to local toolchain installation export TOOLCHAIN_PATH=~/ti-processor-sdk-linux-am335x-evm-03.02.00.05/linux-devkit/sysroots/ # Path to SDK compiled kernel export KERNEL_PATH=~/ti-processor-sdk-linux-am335x-evm-03.02.00.05/board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8/
修改其中的build/proj toochain-defs.mak文件中的
TOOLCHAIN_PATH_NATIVE=$(TOOLCHAIN_PATH)/x86_64-arago-linux/ TOOLCHAIN_PATH_TARGET=$(TOOLCHAIN_PATH)/armv7ahf-neon-linux-gnueabi/
在build目录下make出现:
LinuxHFRM_AG.c:(.text+0x4bcc): undefined reference to `PM_VS_DisableWBS'
LinuxHFRM_AG.c:(.text+0x5c48): undefined reference to `PM_VS_EnableWBS'
collect2: error: ld returned 1 exit status
make: *** [../BluetopiaPM/bin/LinuxHFRM_AG] Error 1
此错误是否和上面的路径有关?
求大神解答
你用的是什么蓝牙芯片,wilink?
配置PM的环境有问题,查看:
http://processors.wiki.ti.com/index.php/TI_Bluetooth_Stack_for_WL18xx_-_Build_Process
Modification of the PM build environment
蓝牙芯片:cc2560b
蓝牙协议栈版本:TI Bluetooth Linux Add-On for AM335x EVM, AM437x EVM and BeagleBone With WL18xx and CC256x(v4.0.3.0.1.0 )
http://www.ti.com/tool/TI-BT-STACK_LINUX-ADDON
按照如下http://processors.wiki.ti.com/index.php/TI_Bluetooth_Stack_for_WL18xx_-_Getting_Started_Guide修改:
1.setup-bt
# Path to local toolchain installation
export TOOLCHAIN_PATH=/home/jonet/zhangwei/sdk/linux-devkit/sysroots/
# Path to SDK compiled kernel
export KERNEL_PATH=/home/jonet/yangyang/am335x/linux-4.4.12/
2. proj/proj-defs.mak
#DEVICE = wl18xx
DEVICE = cc256x
3. proj/toochain-defs.mak
TOOLCHAIN_PATH_NATIVE=$(TOOLCHAIN_PATH)/x86_64-arago-linux/
TOOLCHAIN_PATH_TARGET=$(TOOLCHAIN_PATH)/armv7ahf-neon-linux-gnueabi/
source configure.sh
make
创建bt-en.sh:
echo 45 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio45/direction
echo 1 > /sys/class/gpio/gpio45/value
echo "Done enabling BT"
gpio="nshutdown_gpio=45"
tty="tty=/dev/ttyO4"
flow="flow_cntrl=1"
baud_rate="baud_rate=3000000"
mkdir /home/root/tibt
echo $gpio > /home/root/tibt/config
echo $tty >> /home/root/tibt/config
echo $flow >> /home/root/tibt/config
echo $baud_rate >> /home/root/tibt/config
Init-scripts:
CC256XB-BT-SP:(http://www.ti.com/tool/cc256xb-bt-sp?keyMatch=cc256xb-bt-sp&tisearch=Search-EN-Everything)
initscripts-TIInit_6.7.16_bt_spec_4.1.bts
运行示例应用程序:
#./SS1BTPM&
#./LinuxSPPM
SPPM>Initialize 1
SPPM>SetDevicePower 1
echo 45 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio45/direction
echo 0 > /sys/class/gpio/gpio45/value
echo 1 > /sys/class/gpio/gpio45/value
echo 0 > /sys/class/gpio/gpio45/value
echo 1 > /sys/class/gpio/gpio45/value
BT COMM PORT (/dev/ttyO4): 1
DEVM_PowerOnDevice() Failure: -4, Unknown Error.
Function Error。
蓝牙芯片:cc2560b
蓝牙协议栈版本:TI Bluetooth Linux Add-On for AM335x EVM, AM437x EVM and BeagleBone With WL18xx and CC256x(v4.0.3.0.1.0 )
http://www.ti.com/tool/TI-BT-STACK_LINUX-ADDON
按照如下http://processors.wiki.ti.com/index.php/TI_Bluetooth_Stack_for_WL18xx_-_Getting_Started_Guide修改:
1.setup-bt
# Path to local toolchain installation
export TOOLCHAIN_PATH=/home/jonet/zhangwei/sdk/linux-devkit/sysroots/
# Path to SDK compiled kernel
export KERNEL_PATH=/home/jonet/yangyang/am335x/linux-4.4.12/
2. proj/proj-defs.mak
#DEVICE = wl18xx
DEVICE = cc256x
3. proj/toochain-defs.mak
TOOLCHAIN_PATH_NATIVE=$(TOOLCHAIN_PATH)/x86_64-arago-linux/
TOOLCHAIN_PATH_TARGET=$(TOOLCHAIN_PATH)/armv7ahf-neon-linux-gnueabi/
source configure.sh
make
创建bt-en.sh:
echo 45 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio45/direction
echo 1 > /sys/class/gpio/gpio45/value
echo "Done enabling BT"
gpio="nshutdown_gpio=45"
tty="tty=/dev/ttyO4"
flow="flow_cntrl=1"
baud_rate="baud_rate=3000000"
mkdir /home/root/tibt
echo $gpio > /home/root/tibt/config
echo $tty >> /home/root/tibt/config
echo $flow >> /home/root/tibt/config
echo $baud_rate >> /home/root/tibt/config
Init-scripts:
CC256XB-BT-SP:(http://www.ti.com/tool/cc256xb-bt-sp?keyMatch=cc256xb-bt-sp&tisearch=Search-EN-Everything)
initscripts-TIInit_6.7.16_bt_spec_4.1.bts
运行示例应用程序:
#./SS1BTPM&
#./LinuxSPPM
SPPM>Initialize 1
SPPM>SetDevicePower 1
echo 45 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio45/direction
echo 0 > /sys/class/gpio/gpio45/value
echo 1 > /sys/class/gpio/gpio45/value
echo 0 > /sys/class/gpio/gpio45/value
echo 1 > /sys/class/gpio/gpio45/value
BT COMM PORT (/dev/ttyO4): 1
DEVM_PowerOnDevice() Failure: -4, Unknown Error.
Function Error.
DEVM_PowerOnDevice() Failure代表CC2560还没上电或者引脚使能,看到你用45号 引脚来使能它,有没有测过这个引脚的电压?
测过 ,对这个gpio写1电压测得3.3v。写0时变为0V。
2560b 可以用这个蓝牙协议栈版本么——TI Bluetooth Linux Add-On for AM335x EVM, AM437x EVM and BeagleBone With WL18xx and CC256x(v4.0.3.0.1.0 )
http://www.ti.com/tool/TI-BT-STACK_LINUX-ADDON
256xc可以直接替换2560b么 ?
可以用这个版本,
但是CC2560的所有IO是1.8V的,给3.3V是有问题
串口波特兰率很高啊!
io是1.8, 3.3是经过一个电平转换后测量的值。出现这种错误和gpio关系最大?
波特率设过115200,问题依旧出现
引脚VSS_FREF ,VSS_DCO 如果没有接地,会导致DEVM_PowerOnDevice() Failure吗?
VSS_FREF ,VSS_DCO 是关于时钟起振的GND,必须要接地,芯片有时序才能工作,我觉得是导致DEVM_PowerOnDevice() Failure的原因