element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Moto Mods
  • Products
  • Manufacturers
  • Moto Mods
  • More
  • Cancel
Moto Mods
Forum Trouble compiling nuttx
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Moto Mods to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 9 replies
  • Subscribers 60 subscribers
  • Views 1480 views
  • Users 0 members are here
Related

Trouble compiling nuttx

lllars
lllars over 8 years ago

I'm working through the hello world example, and trying to get setup to compile the firmware, following the directions here: https://developer.motorola.com/build/tools/build-from-source

 

I'm stuck at the "make" step, under "compile nuttx".  I get this error:

 

Traceback (most recent call last):

  File "/home/lars/programming/moto_mod/bootrom-tools/create-tftf", line 35, in <module>

    from tftf import Tftf, TFTF_SECTION_TYPE_RAW_CODE, \

  File "/home/lars/programming/moto_mod/bootrom-tools/tftf.py", line 34, in <module>

    from string import rfind

ImportError: cannot import name 'rfind'

dd: failed to open 'nuttx.tftf': No such file or directory

make: *** [Makefile.unix:451: pass2] Error 1

 

If I just comment out line 34, and retry I get:

 

Traceback (most recent call last):

  File "/home/lars/programming/moto_mod/bootrom-tools/create-tftf", line 390, in <module>

    main()

  File "/home/lars/programming/moto_mod/bootrom-tools/create-tftf", line 332, in main

    tftf_header = Tftf(args.header_size)

  File "/home/lars/programming/moto_mod/bootrom-tools/tftf.py", line 407, in __init__

    self.reserved = [0] * TFTF_HDR_NUM_RESERVED

TypeError: can't multiply sequence by non-int of type 'float'

dd: failed to open 'nuttx.tftf': No such file or directory

make: *** [Makefile.unix:451: pass2] Error 1

 

I scoured the web, but can't find any answers.  I'm using arch linux, not ubuntu, so maybe that's part of the problem.  Anyone have any clues or ideas for me to try?

  • Sign in to reply
  • Cancel
Parents
  • aarongfranco
    aarongfranco over 8 years ago

    make sure you have defined BUILD_TOP variables.

     

    > echo $BUILD_TOP
    ... should output .. /path/to/your/nuttx/installation

     

    Without it you will continue to get the "nuttx.tftf" No such file or directory error.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lllars
    lllars over 8 years ago in reply to aarongfranco

    Yes, I have BUILD_TOP defined correctly:

     

    lars ~/programming/moto_mod (1) $ echo $BUILD_TOP

    /home/lars/programming/moto_mod

     

    I don't seem to have nuttx.tftf anywhere, I was assuming it gets created during the build process that is failing for me.  This returns no results:

     

    lars ~/programming/moto_mod (1) $ find ./| grep nuttx.tftf

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • garengllc
    garengllc over 8 years ago in reply to lllars

    Can you try building one of their pre-supplied projects without any changes (like usb2)?

     

    $ export PATH=$PATH:$BUILD_TOP/manifesto:$BUILD_TOP/bootrom-tools
    $ cd $BUILD_TOP/nuttx/nuttx
    $ make distclean
    $ cd $BUILD_TOP/nuttx/nuttx/tools
    $ ./configure.sh hdk/muc/usb2

    $ cd $BUILD_TOP/nuttx/nuttx
    $ make

     

    Then you should have the .tftf file in the nuttx/nuttx directory.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lllars
    lllars over 8 years ago in reply to garengllc

    Ok, just tried that.  I get the same error:

     

    MuC

    Traceback (most recent call last):

      File "/home/lars/programming/moto_mod/bootrom-tools/create-tftf", line 35, in <module>

        from tftf import Tftf, TFTF_SECTION_TYPE_RAW_CODE, \

      File "/home/lars/programming/moto_mod/bootrom-tools/tftf.py", line 34, in <module>

        from string import rfind

    ImportError: cannot import name 'rfind'

    dd: failed to open 'nuttx.tftf': No such file or directory

    make: *** [Makefile.unix:451: pass2] Error 1

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • garengllc
    garengllc over 8 years ago in reply to lllars

    Did you make sure to install all the build dependencies begore you got started?

    $ sudo apt-get install -y git gperf flex bison libncurses5-dev gcc-arm-none-eabi python-pip
    $ sudo pip install pyelftools

     

    Also, if you type "python --version" are you get a Python 2.7.x or a 3.5.x?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • garengllc
    garengllc over 8 years ago in reply to lllars

    Did you make sure to install all the build dependencies begore you got started?

    $ sudo apt-get install -y git gperf flex bison libncurses5-dev gcc-arm-none-eabi python-pip
    $ sudo pip install pyelftools

     

    Also, if you type "python --version" are you get a Python 2.7.x or a 3.5.x?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • lllars
    lllars over 8 years ago in reply to garengllc

    $ python --version

    Python 3.6.0

     

    $ python2 --version

    Python 2.7.13

     

    I think I have all dependencies.  Like I said, I'm running arch, so my package names and versions are a bit different.

     

    $ sudo pacman -S git gperf flex bison ncurses arm-none-eabi-gcc python-pip

    warning: git-2.12.0-1 is up to date -- reinstalling

    warning: gperf-3.1-1 is up to date -- reinstalling

    warning: flex-2.6.3-1 is up to date -- reinstalling

    warning: bison-3.0.4-2 is up to date -- reinstalling

    warning: ncurses-6.0+20170128-1 is up to date -- reinstalling

    warning: arm-none-eabi-gcc-6.3.0-1 is up to date -- reinstalling

    warning: python-pip-9.0.1-2 is up to date -- reinstalling

    resolving dependencies...

     

    $ sudo pip install pyelftools

    Requirement already satisfied: pyelftools in /usr/lib/python3.6/site-packages

     

    Any way to check if this is python 2 vs 3 version problem?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • garengllc
    garengllc over 8 years ago in reply to lllars

    Hmm, I am not sure which version of python is really needed, but when I type python --version on my working system, I get Python 2.7.6.  So it is possible that that is an issue.  Anyway you can alias python to python2 and see if that helps any?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • lllars
    lllars over 8 years ago in reply to garengllc

    Ok, we're getting somewhere.  I got it to compile.  It was indeed a python 2 vs 3 problem.

     

    Aliasing didn't work.  I had also originally tried changing the first line of tftf.py to #! /usr/bin/env python2, but that made no difference either, which led me to think it wasn't a python2/3 issue.

     

    What worked was to trick the environment as suggested in the Arch wiki page for python.  The trick involves crating symlinks in ~/bin for python and python-config to the 2.x versions.

     

    Thanks for the help guys.  It worked for usb2, I haven't actually tried it for the original hello world example yet, but I assume that will work now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vpr_motomods
    vpr_motomods over 6 years ago in reply to lllars

    I had the same issue. I fixed it by removing the path for Anaconda which was the environment set for my shell.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube