[SOLVED] Error while building .bin file

Post here to get support
Post Reply
jsmartins
Beginner
Posts: 9
Joined: Tue Dec 16, 2014 3:36 am

[SOLVED] Error while building .bin file

Post by jsmartins »

Hello guys, I have been facing some problems to build the binary file (.bin) from the firmware source code. When I try to execute the command make CLOAD=1 DEBUG=0 it shows the following message:

unisa@unisa-desktop:~/Desktop/crazyflie-firmware-2015.1$ make CLOAD=1 DEBUG=0
CLEAN_VERSION
VTMPL version.c
abort: there is no Mercurial repository here (.hg not found)
Traceback (most recent call last):
File "scripts/versionTemplate.py", line 55, in <module>
identify = subprocess.check_output(["hg", "identify", "-nitb"])
File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['hg', 'identify', '-nitb']' returned non-zero exit status 255
make: *** [version.c] Error 1

Does someone have any idea how to fix the problem? I have already installed Mercurial but it didn't solve the issue.
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Re: Error while building .bin file

Post by poizone »

Let's get some basics:
1. Which CF version do you own?
2. Which branch have you checked out? (master is CF1, crazyflie2 is CF2)
3. Have you installed all dependencies as shown on the Wiki page for building the firmware?
4. Are you using the proper ARM embedded toolchain version?
5. Is your PATH set correctly for the various dependencies?
6. What is your development platform (OS, using the Bitcraze VM, installed tools)

If you're simply looking to get the latest firmware and have a CF1, I have a vanilla build posted here. I'm willing to build the CF2 firmware and post the binary, but I cannot test it. If you're aiming to build your own modified version, I'm here to offer what help I can. I've successfully built my github fork of the official firmware by simply cloning with git and running make on the firmware with the proper toolchain and dependencies from the wiki.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
jsmartins
Beginner
Posts: 9
Joined: Tue Dec 16, 2014 3:36 am

Re: Error while building .bin file

Post by jsmartins »

Hi Poizone.
I'm trying to build my own modified firmware version. I'm gonna list bellow the answers.

1- I have one Crazyflie 1.0
2- I'm not sure about which branch but in the box I can see that the model is Crazyflie nano kit 10-DOF/BC-CF/04-A
3- I have installed all the dependences as shown on the wiki.
4- I'm using "gnu-arm-none-eabi toochain and biuld tools"
5- I think I'm using the correct path but how can I check it?
6- I'm not using any virtual machine, I'm using UBUNTU 14.4.10.

Thanks for the help.
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Re: Error while building .bin file

Post by poizone »

When you download the firmware source, you need to make sure you download the Master branch of the Bitcraze Github. The Bitbucket is out of date, and should not be forked. If you don't have git, apt-get it with

Code: Select all

sudo apt-get install git
Then clone the github to your chosen directory with

Code: Select all

git clone https://github.com/bitcraze/crazyflie-firmware.git
Then you'll need to switch to the master branch using

Code: Select all

git checkout master
Your toolchain version should be 4.7 2013q1, available at https://launchpad.net/gcc-arm-embedded/ ... -q1-update

Once you've ensured you've got the right toolchain and branch selected, you can simply follow the instructions available on the Crazyflie 1 wiki at http://wiki.bitcraze.se/projects:crazyflie:devenv:index to set up your environment. Be sure to modify the path to the toolchain you echo to ~/.bashrc if you don't place it in ~/bin. You can check the path with

Code: Select all

cat ~/.bashrc
Hope you get it built! The toolchain was the step that tripped me up before, but it looks like you're just trying to build an out of date firmware.
Last edited by poizone on Thu Feb 19, 2015 3:55 am, edited 1 time in total.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
jsmartins
Beginner
Posts: 9
Joined: Tue Dec 16, 2014 3:36 am

Re: Error while building .bin file

Post by jsmartins »

Some progress here. I think the problem is in the branch.
I did the steps you told me and when I tryed to switch to the master branch I got this message:

unisa@unisa-desktop:~$ git branch master
fatal: Not a valid object name: 'master'.

How can I create the object?
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Re: Error while building .bin file

Post by poizone »

I'm an idiot who should not be giving support at 1am after a few glasses of wine. That should be

Code: Select all

git checkout master
and not

Code: Select all

git branch master
I've updated my previous post to reflect my mistake. Use checkout to checkout the master branch and then use

Code: Select all

git branch
to check that you've indeed checked out the master branch. The current branch will have an asterisk.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
jsmartins
Beginner
Posts: 9
Joined: Tue Dec 16, 2014 3:36 am

Re: Error while building .bin file

Post by jsmartins »

hi Poizone.
Don't worry about it, a glass of wine always help to think better hahaha.
I tried this command but it didn't work as well. I received the following message:

Code: Select all

root@unisa-desktop:/home/unisa/Desktop/crazyflie-firmware-2015.1# git checkout master
error: pathspec 'master' did not match any file(s) known to git.
Do you know why is it happening?

Thanks again for your attention.
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Re: Error while building .bin file

Post by poizone »

jsmartins wrote:hi Poizone.
Don't worry about it, a glass of wine always help to think better hahaha.
I tried this command but it didn't work as well. I received the following message:

Code: Select all

root@unisa-desktop:/home/unisa/Desktop/crazyflie-firmware-2015.1# git checkout master
error: pathspec 'master' did not match any file(s) known to git.
Do you know why is it happening?

Thanks again for your attention.
A successful clone should work just like this:
Image
Can you post a screenshot of those commands I ran, along with a git status if there's an error? You can also try a git fetch to update your repo.'

Edit: Also, try git branch -d master then git checkout master, to see if you accidentally made a local master branch.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
jsmartins
Beginner
Posts: 9
Joined: Tue Dec 16, 2014 3:36 am

Re: Error while building .bin file

Post by jsmartins »

The problem is solved!! Thank you very much for your help and attention.
I just deleted the old firmware clone file and I started to execute the commands from the beggining and it worked! I guess that some kind of trash or something was the cause of the error.
Thank you again!
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: [SOLVED] Error while building .bin file

Post by chad »

Glad to hear you got this solved! I've marked the topic [SOLVED] in the title and moved it to the more appropriate sub-forum "Crazyflie Nano Quadcopter" -> "Support"

Cheers!
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
Post Reply