林林non 2023-05-14 13:12 采纳率: 50%
浏览 39
已结题

tinyos 2.1.2 ubuntu下运行make micaz sim出现问题

tinyos 2.1.2 ubuntu下运行make micaz sim出现问题

在Ubuntu虚拟机中安装了Tinyos2.1.2,需要进行基于Python的仿真,利用TOSSIM工具,具体的步骤如下:
https://blog.csdn.net/HoraceYan/article/details/130295664

但是在我进行到2.2的时候,切换到 RadioCountToLeds程序所在目录并执行指令:make micaz sim
报错如下:

root@user-virtual-machine:/opt/tinyos-2.1.2/apps/RadioCountToLeds# make micaz sim
mkdir -p simbuild/micaz
mig python -target=micaz -DIDENT_APPNAME=\"RadioCountToLed\" -DIDENT_USERNAME=\"root\" -DIDENT_HOSTNAME=\"user-virtual-ma\" -DIDENT_USERHASH=0x0859c1faL -DIDENT_TIMESTAMP=0x64606722L -DIDENT_UIDHASH=0x02a153fbL -python-classname=RadioCountMsg RadioCountToLeds.h radio_count_msg -o RadioCountMsg.py
In file included from /opt/tinyos-2.1.2/tos/chips/atm128/atm128hardware.h:50,
                 from /opt/tinyos-2.1.2/tos/platforms/micaz/hardware.h:56,
                 from /opt/tinyos-2.1.2/tos/system/SchedulerBasicP.nc:52:
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/io.h:623:6: warning: #warning "device type not defined"
In file included from /opt/tinyos-2.1.2/tos/chips/atm128/atm128hardware.h:57,
                 from /opt/tinyos-2.1.2/tos/platforms/micaz/hardware.h:56,
                 from /opt/tinyos-2.1.2/tos/system/SchedulerBasicP.nc:52,
                 from /opt/tinyos-2.1.2/tos/system/TinySchedulerC.nc:51:
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h: In function `wdt_enable':
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:454: `WDT' undeclared (first use in this function)
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:454: (Each undeclared identifier is reported only once
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:454: for each function it appears in.)
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:465: `WDCE' undeclared (first use in this function)
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:465: `WDE' undeclared (first use in this function)
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h: In function `wdt_disable':
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:494: `WDT' undeclared (first use in this function)
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:508: `WDCE' undeclared (first use in this function)
/usr/lib/gcc/avr/5.4.0/../../../avr/include/avr/wdt.h:508: `WDE' undeclared (first use in this function)
In file included from /opt/tinyos-2.1.2/tos/system/TinySchedulerC.nc:52:
In component `McuSleepC':
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc: At top level:
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:68: `SM0' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:69: `SM2' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:69: `SM1' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:69: `SM0' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:70: `SM1' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:70: `SM0' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:71: `SM2' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:71: `SM1' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:72: `SM1' undeclared here (not in a function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc: In function `getPowerState':
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:80: `TIMSK' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:80: `OCIE0' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:80: `TOIE0' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:80: `TOIE1' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:80: `TOIE2' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:81: `ETIMSK' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:81: `TOIE3' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:85: `SPCR' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:85: `SPE' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:89: `UCSR0B' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:89: `UCSR1B' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:89: `TXEN' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:89: `RXEN' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:93: `TWCR' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:93: `TWEN' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:97: `ADCSR' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:97: `ADEN' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc: In function `McuSleep.sleep':
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:109: `MCUCR' undeclared (first use in this function)
/opt/tinyos-2.1.2/tos/chips/atm128/McuSleepC.nc:110: `SE' undeclared (first use in this function)
failed to parse message file RadioCountToLeds.h
make: *** [Makefile:7:RadioCountMsg.py] 错误 1


我已经尝试了很多种办法,例如切换gcc版本等,还是无法解决。
但我觉得这不是特定的头文件或代码出现的问题。
这应该如何解决?

  • 写回答

1条回答 默认 最新

  • Treabhar 2023-05-14 13:29
    关注

    来自NewBing和LP的编写:

    • 问题可能是TinyOS与你的开发环境之间存在不兼容性。这个错误表示你的系统在尝试编译TinyOS代码时,没有找到正确的AVR设备类型定义,这可能是编译器和TinyOS版本之间存在不兼容性。

    以下是一些可能的解决方案:

    1. 更新TinyOS: 正在用的TinyOS 2.1.2可能并不完全兼容你的Ubuntu系统或你的AVR编译器。试试更新到更新的TinyOS版本,可能可以解决这个问题。

    2. 检查AVR编译器版本: 你的错误消息显示你正用的AVR编译器是5.4.0版本。尝试用与TinyOS更兼容的版本,可能可以解决这个问题。尽管你已经尝试过切换GCC版本,但确认你的AVR-GCC版本是否也进行了相应的切换。

    3. 检查环境变量: 确保你的环境变量被正确地设置。你应该在你的.bashrc或.zshrc文件中添加以下两行(根据你的TinyOS安装位置进行修改):

      export TOSROOT="/opt/tinyos-2.1.2"
      export TOSDIR="$TOSROOT/tos"
      

      之后,记得运行source ~/.bashrc或source ~/.zshrc来使变动生效。

    4. 检查make命令: 试运行make micaz,看是否会出现类似的错误。如果这个命令能成功执行,那么可能是你的TOSSIM环境出了问题。

    5. 重新安装开发环境: 如果上述方法都无法解决问题,你可能要考虑重新安装你的开发环境,包括Ubuntu系统、AVR编译器和TinyOS。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 5月22日
  • 已采纳回答 5月14日
  • 修改了问题 5月14日
  • 创建了问题 5月14日

悬赏问题

  • ¥100 有偿,谁有移远的EC200S固件和最新的Qflsh工具。
  • ¥15 找一个QT页面+目标识别(行人检测)的开源项目
  • ¥15 有没有整苹果智能分拣线上图像数据
  • ¥20 有没有人会这个东西的
  • ¥15 cfx考虑调整“enforce system memory limit”参数的设置
  • ¥30 航迹分离,航迹增强,误差分析
  • ¥15 Chrome Manifest扩展引用Ajax-hook库拦截请求失败
  • ¥15 用Ros中的Topic通讯方式控制小乌龟的速度,走矩形;编写订阅器代码
  • ¥15 LLM accuracy检测
  • ¥15 pycharm添加远程解释器报错