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

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[转]关于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盘(软件和协议栈安装的盘)中,也可以实现上述目的。


ubuntu@ubuntu:~/PX4_Firmware$ make px4_sitl_default gazebo -- PX4 version: v1.11.0-beta1 -- PX4 config file: /home/ubuntu/PX4_Firmware/boards/px4/sitl/default.cmake -- PX4 config: px4_sitl_default -- PX4 platform: posix -- PX4 lockstep: enabled -- cmake build type: RelWithDebInfo -- The CXX compiler identification is GNU 7.5.0 -- The C compiler identification is GNU 7.5.0 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Building for code coverage -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.9", minimum required is "3") -- build type is RelWithDebInfo -- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-255-g47624a0 -- Configuring done -- Generating done -- Build files have been written to: /home/ubuntu/PX4_Firmware/build/px4_sitl_default [0/740] git submodule src/drivers/gps/devices [8/740] git submodule src/lib/ecl [11/740] git submodule mavlink/include/mavlink/v2.0 [13/740] git submodule Tools/sitl_gazebo [19/740] Performing configure step for 'sitl_gazebo' -- install-prefix: /usr/local -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing T
最新发布
03-17
<think>好的,用户遇到了在Ubuntu环境下编译PX4 SITL Gazebo时的问题,想解决或了解编译过程。我需要根据提供的引用信息来整理解决方案。 首先,用户提到的错误可能涉及缺少依赖包,比如gstreamer-base-1.0。根据引用[1],安装这个包可能需要运行sudo apt install命令。另外,引用[2]提到用户可能在conda的base环境中安装了依赖,而正确做法应该是在系统环境中安装。因此需要检查环境,确保退出conda,使用系统环境进行安装。 接下来,引用[3]列出了多个依赖项,包括ninja-build、protobuf-compiler等,用户可能需要安装这些。同时,pip安装的包如jinja2、pyserial等需要确认是否正确安装,并且区分Python2和Python3的包。 另外,PX4的编译需要克隆固件仓库并初始化子模块,用户可能漏掉了子模块更新这一步。最后,编译命令是否正确执行,是否需要添加其他参数。 现在需要将这些步骤有条理地分点说明,确保用户能逐步操作。同时,生成相关问题,帮助用户深入理解可能遇到的其它问题。</think>### PX4 SITL Gazebo 编译问题解决步骤 #### 1. 安装缺失的依赖包 编译过程中报错`No package 'gstreamer-base-1.0' found`,需安装相关依赖: ```bash sudo apt install gstreamer1.0-plugins-base libgstreamer-plugins-base1.0-dev ``` 其他关键依赖可参考引用[3]: ```bash sudo apt install ninja-build exiftool protobuf-compiler libeigen3-dev genromfs xmlstarlet python-pip python3-pip ``` #### 2. 确保依赖安装环境正确 - **退出conda环境**:若使用conda,需执行`conda deactivate`退出base环境,避免依赖安装到虚拟环境中[^2]。 - **区分pip安装目标**: ```bash pip2 install jinja2 pyserial cerberus pyulog==0.7.0 numpy toml pyquaternion empy pyyaml pip3 install packaging numpy empy toml pyyaml jinja2 pyargparse ``` #### 3. 初始化PX4固件仓库 克隆仓库并更新子模块: ```bash git clone https://github.com/PX4/PX4-Autopilot.git --recursive cd PX4-Autopilot git submodule update --init --recursive ``` #### 4. 执行编译命令 在仓库根目录下运行: ```bash make px4_sitl_default gazebo ``` 若仍报错,可尝试清理后重新编译: ```bash make clean make px4_sitl_default gazebo ``` #### 5. 常见问题排查 - **权限问题**:若涉及设备访问(如串口),添加用户到`dialout`组: ```bash sudo usermod -a -G dialout $USER ``` - **Gazebo启动失败**:检查Gazebo版本是否兼容,建议使用ROS自带版本(如ROS Noetic搭配Gazebo 11)[^3]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值