关于CC2540/2541编译Performing Post-Build Action卡住的问题

本文详细介绍了在使用TI官方技术手册编译CC2540/2541单片机时遇到的Post-Build Action卡住问题,并提供了两种解决方案:修改cc254x_ubl_pp.bat文件或直接将工程拷贝至软件和协议栈安装的盘。解释了问题原因在于使用的批处理文件路径问题,适用于特定的协议栈版本和工程配置。

[转]关于CC2540/2541编译Performing Post-Build Action卡住的问题

转自facai_sdu的专栏,原文:http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece7631049c0666e04de3e69c0d0622e95c51484642c1d1020feeb797f451987962d345ab84e28aba6716f310221b59fc28341c9fecf68798765633048db014d8845fadc4654837dd11cfeaf68b7fdab6cc5b9d2a28c0515910e59&p=87759a44d18913f101be9b7c5949&newp=8965d61c85cc43f508e29579494792695803ed6336d2d04f&user=baidu&fm=sc&query=performing+post+build+action&qid=8abeb63100090683&p1=1


CC2540/2541是TI推出的BLE单片机,并且支持空中固件升级(OAD)。本人按照TI官方的技术手册,在使用OAD编译产生bin文件时,发现出现了问题,编译卡在了Performing Post-Build Action 这一步并且无法产生bin文件。如下图所示


后来在TI社区看到有国外的技术大牛讨论这个问题,并且提出过解决方案,详见如下连接

http://e2e.ti.com/support/wireless_connectivity/f/538/t/314089

意思就大概就是说,出现这种问题,是因为使用的批处理文件C:\Program Files\Texas Instruments\BLE-CC254x-1.4.0\Projects\ble\common\cc2540\cc254x_ubl_pp.bat运行错误。这应该算是TI协议栈的一个bug,当软件或者工程安装在了其它盘符时,就会产生这种问题。

解决方案是编辑C:\Program Files\Texas Instruments\BLE-CC254x-1.4.0\Projects\ble\common\cc2540\cc254x_ubl_pp.bat文件,将其中的

@echo off
chdir %1\..\..\common\cc2540
start cc254x_ubl_pp.js %2 %3 %4 %5

改为如下:

@echo off

%~d1
chdir %1\..\..\common\cc2540

start cc254x_ubl_pp.js %2 %3 %4 %5

即可。

这种方法是可行的,但是需要注意的是,所指的是关联自己工程的cc254x_ubl_pp.bat,并不一定是协议栈中的固定的链接C:\Program Files\Texas Instruments\BLE-CC254x-1.4.0\Projects\ble\common\cc2540\cc254x_ubl_pp.bat,如果用户自己建的了一个完整的工程,其中拷贝了新的外部链接文件(你的工程目录)\Projects\ble\common\cc2540\cc254x_ubl_pp.bat,需要找到自己工程使用的文件,然后做如上更改。

修改后再次编译,就会出现编译通过,同时产生了bin文件



还有另外一种解决方法比较简单,是直接将该工程拷贝到C盘(软件和协议栈安装的盘)中,也可以实现上述目的。


老公 你帮我看一下 我是不是可以去睡觉 等它自己编译就好了?”PowerShell 7 环境已加载 (版本: 7.5.2) PowerShell 7 环境已加载 (版本: 7.5.2) PS C:\Users\Administrator\Desktop> cd E:\PyTorch_Build\pytorch PS E:\PyTorch_Build\pytorch> python -m venv rtx5070_env PS E:\PyTorch_Build\pytorch> .\rtx5070_env\Scripts\activate (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 1. 运行修复脚本 (rtx5070_env) PS E:\PyTorch_Build\pytorch> .\complete_install_fix.ps1 尝试从备用源下载: https://pilotfiber.dl.sourceforge.net/project/openblas/v0.3.27/OpenBLAS-0.3.27-x64.zip ❌ 下载失败: The variable '$localZip' cannot be retrieved because it has not been set. 尝试从备用源下载: https://cfhcable.dl.sourceforge.net/project/openblas/v0.3.27/OpenBLAS-0.3.27-x64.zip ❌ 下载失败: The variable '$localZip' cannot be retrieved because it has not been set. 尝试从备用源下载: https://superb-sea2.dl.sourceforge.net/project/openblas/v0.3.27/OpenBLAS-0.3.27-x64.zip ❌ 下载失败: The variable '$localZip' cannot be retrieved because it has not been set. 尝试从GitHub直接下载... InvalidOperation: E:\PyTorch_Build\pytorch\complete_install_fix.ps1:25 Line | 25 | Invoke-WebRequest -Uri $githubRaw -OutFile $localZip | ~~~~~~~~~ | The variable '$localZip' cannot be retrieved because it has not been set. InvalidOperation: E:\PyTorch_Build\pytorch\complete_install_fix.ps1:35 Line | 35 | [System.IO.Compression.ZipFile]::ExtractToDirectory($localZip, $newIn … | ~~~~~~~~~ | The variable '$localZip' cannot be retrieved because it has not been set. Find-BLASBinary: E:\PyTorch_Build\pytorch\complete_install_fix.ps1:38 Line | 38 | $blasFile = Find-BLASBinary -SearchPath $newInstallPath | ~~~~~~~~~~~~~~~ | The term 'Find-BLASBinary' is not recognized as a name of a cmdlet, function, script file, or executable | program. Check the spelling of the name, or if a path was included, verify that the path is correct and try | again. ⚠️ 二进制分发版无效,尝试从源码编译... Chocolatey v2.5.0 3 validations performed. 2 success(es), 1 warning(s), and 0 error(s). Validation Warnings: - A pending system reboot request has been detected, however, this is being ignored due to the current Chocolatey configuration. If you want to halt when this occurs, then either set the global feature using: choco feature enable --name="exitOnRebootDetected" or pass the option --exit-when-reboot-detected. Installing the following packages: cmake By installing, you accept licenses for the packages. Downloading package from source 'https://community.chocolatey.org/api/v2/' Progress: Downloading cmake.install 4.1.1... 100% cmake.install v4.1.1 [Approved] cmake.install package files install completed. Performing other installation steps. Installing 64-bit cmake.install... cmake.install has been installed. The install of cmake.install was successful. Software installed as 'msi', install location is likely default. Downloading package from source 'https://community.chocolatey.org/api/v2/' Progress: Downloading cmake 4.1.1... 100% cmake v4.1.1 [Approved] cmake package files install completed. Performing other installation steps. The install of cmake was successful. Deployed to 'C:\ProgramData\chocolatey\lib\cmake' Chocolatey installed 2/2 packages. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). Chocolatey v2.5.0 3 validations performed. 2 success(es), 1 warning(s), and 0 error(s). Validation Warnings: - A pending system reboot request has been detected, however, this is being ignored due to the current Chocolatey configuration. If you want to halt when this occurs, then either set the global feature using: choco feature enable --name="exitOnRebootDetected" or pass the option --exit-when-reboot-detected. Installing the following packages: mingw By installing, you accept licenses for the packages. Downloading package from source 'https://community.chocolatey.org/api/v2/' Progress: Downloading mingw 13.2.0... 100% mingw v13.2.0 [Approved] mingw package files install completed. Performing other installation steps. Downloading mingw 64 bit from 'https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev0/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev0.7z' Progress: 73% - Saving 51.17 MB of 69.57 MB“
最新发布
09-03
<think>嗯,用户遇到了在构建PX4-Autopilot时出现的ninja错误,提示缺少libignition-common3-graphics.so.3.17.0库文件。首先,我需要确认这个库属于哪个软件包。通常,这种库文件是某个开发包的一部分,可能和Gazebo或ROS相关,因为PX4常与这些仿真工具一起使用。 用户之前提供的引用中提到了PX4的克隆和依赖安装,以及Ninja构建工具的作用。引用3提到了解决libncurses和libtinfo的问题,这可能与库文件缺失有关联。但这次的问题是不同的库,所以需要寻找对应的解决方案。 首先,我应该考虑安装该库的对应软件包。在Ubuntu或Debian系统中,可以使用apt-file来查找哪个包包含这个库文件。如果用户没有安装apt-file,需要先安装并更新数据库。然后搜索这个库文件,找到对应的包名,进行安装。 另外,可能需要检查Gazebo的安装情况,因为Ignition Common库通常和Gazebo关联。用户可能没有安装完整的Gazebo组件,或者版本不匹配。建议用户安装与PX4兼容的Gazebo版本,比如通过ROS的包或PX4官方推荐的安装方式。 如果安装后仍然找不到库文件,可能需要手动创建符号链接,特别是在库文件安装路径不在系统的库路径中时。或者运行ldconfig更新动态链接库缓存。 此外,确保所有PX4的依赖都已正确安装,可以重新运行PX4提供的安装脚本,如ubuntu.sh,并添加必要的组件参数。用户之前克隆了PX4仓库,但可能在依赖安装过程中遗漏了某些部分。 最后,如果问题依旧,可能需要从源码编译缺失的库,但这种方法较为复杂,应作为最后的手段。建议用户参考PX4的官方文档或社区支持,确认是否有已知的类似问题及其解决方案。</think>### 分步解决方案:解决PX4-Autopilot构建时缺少`libignition-common3-graphics.so.3.17.0`错误 #### 1. 确认系统环境与依赖 首先确保系统为Ubuntu 20.04/22.04(PX4官方推荐环境),并已执行过PX4官方依赖安装脚本: ```bash # 进入PX4-Autopilot目录 cd PX4-Autopilot # 运行官方依赖安装脚本(需提前赋予执行权限) ./Tools/setup/ubuntu.sh ``` 若未安装Gazebo仿真环境,需添加`--no-nuttx`参数跳过嵌入式工具链安装[^2]。 #### 2. 安装缺失的Ignition库 该错误通常由Gazebo仿真工具链的`ignition-common3`库缺失引起。执行以下命令安装: ```bash # 添加Gazebo仓库(若未添加) sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" > /etc/apt/sources.list.d/gazebo-stable.list' wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - sudo apt update # 安装具体库文件 sudo apt install libignition-common3-graphics-dev ``` #### 3. 验证动态库路径 安装后检查库文件是否存在: ```bash # 查找库文件路径 find /usr -name "libignition-common3-graphics.so*" ``` 若输出包含类似`/usr/lib/x86_64-linux-gnu/libignition-common3-graphics.so.3.17.0`的路径,则说明安装成功。 #### 4. 更新动态链接库缓存 ```bash sudo ldconfig ``` #### 5. 完整清理并重新构建 ```bash # 清理构建缓存 make clean # 重新生成构建配置 make px4_sitl gazebo # 使用Ninja构建 ninja ``` #### 替代方案:源码编译(仅当apt安装失败时) ```bash # 安装依赖工具 sudo apt install cmake libignition-cmake2-dev # 下载源码 git clone https://github.com/ignitionrobotics/ign-common cd ign-common git checkout ign-common3_3.17.0 mkdir build && cd build cmake .. && make -j$(nproc) sudo make install ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值