[Crazyflie 2.1] Problem when flashing [SOLVED]

Post here to get support
Post Reply
Student
Beginner
Posts: 2
Joined: Sat May 01, 2021 8:55 am

[Crazyflie 2.1] Problem when flashing [SOLVED]

Post by Student »

Hey!

I have been setting up my Crazyflie in the past days, following the tutorials with success exactly as laid out in the Documentation. However, I am not able to flash my Crazyflie anymore. After putting in the command "make cload", I get the following console output:

Code: Select all

python3 -m cfloader flash cf2.bin stm32-fw
Restart the Crazyflie you want to bootload in the next 10 seconds...
Failed to flash: 'Bootloader' object has no attribute 'flash_full'
Furthermore, I can't seem to find 'flash_full' in the project, so I reckon it's part of an external library. However, I have no clue how to solve it as the error just came up out of nowhere.
Since flashing succeeded earlier, I tried to go back to an older commit from last week. Unfortunately, the same error appears.

Help is much appreciated. If there is any important information from my part missing, please let me know.
Thank you.
Last edited by Student on Mon May 03, 2021 7:45 am, edited 1 time in total.
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: [Crazyflie 2.1] Problem when flashing

Post by jonasdn »

Hi Student!

So the flash_fuill method is in the cflib library that we maintain (https://github.com/bitcraze/crazyflie-lib-python). It is only available on the master branch of this repository. And only the master branch of the client (https://github.com/bitcraze/crazyflie-clients-python) uses it.

Are you running the master branch of the client from source? In that case you might want to get the master branch of the cflib as well and install it using:

Code: Select all

pip3 install --user -e .
That should make it work, either that or make sure you use a tagged version of the client instead of the master branch.

All the best
Jonas
Student
Beginner
Posts: 2
Joined: Sat May 01, 2021 8:55 am

Re: [Crazyflie 2.1] Problem when flashing [SOLVED]

Post by Student »

Hey Jonas!

I installed the master branch of the cflib and it resolved the issue. Thank you very much!
jacobgk2
Beginner
Posts: 12
Joined: Fri Jul 17, 2020 2:46 pm

Re: [Crazyflie 2.1] Problem when flashing

Post by jacobgk2 »

jonasdn wrote: Mon May 03, 2021 4:36 am Hi Student!

So the flash_fuill method is in the cflib library that we maintain (https://github.com/bitcraze/crazyflie-lib-python). It is only available on the master branch of this repository. And only the master branch of the client (https://github.com/bitcraze/crazyflie-clients-python) uses it.

Are you running the master branch of the client from source? In that case you might want to get the master branch of the cflib as well and install it using:

Code: Select all

pip3 install --user -e .
That should make it work, either that or make sure you use a tagged version of the client instead of the master branch.
Does this method work when using the Virtual Machine as well? I followed the instructions described on the "Getting started with development" tutorial and everything works fine up until the 'make cload' command where I run into the same error as Student. I have attempted to unconfigure and reconfigure the USB setup for the radio dongle, I have restarted the Virtual Machine, and I have tried running the 'make cload' command both while the Crazyflie is already in Bootloader mode and while it is off.
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: [Crazyflie 2.1] Problem when flashing [SOLVED]

Post by jonasdn »

Hi jacobgk2!

Yes this method should work in the VM as well. Which version of the VM do you use?

You should be able to use the Update all projects script, which has an icon on the desktop to make sure all projects are up-to-date.

https://www.bitcraze.io/documentation/t ... ualmachine

Regards
Jonas
knuckles904
Beginner
Posts: 7
Joined: Thu Jan 29, 2015 6:10 am

Re: [Crazyflie 2.1] Problem when flashing [SOLVED]

Post by knuckles904 »

Hey Jonas, I'm getting the same errors as Student above and jacobbgk2. I'm using VirtualBox 6.1 on Windows 10. The VM image used is 2021.04.

Make is successful with:

Code: Select all

bitcraze@ubuntu:~/projects/crazyflie-firmware$ make
  CLEAN_VERSION
  VTMPL version.c
  CC    version.o
  LD    cf2.elf
  COPY  cf2.hex
  COPY  cf2.bin
  DFUse cf2.dfu
Build for the CF2 platform!
Build 181:23e9b80caa91 (2021.03 +181) MODIFIED
Version extracted from git
Crazyloader build!
Flash |  242984/1032192 (24%),  789208 free | text: 237180, data: 5804, ccmdata: 0
RAM   |   71128/131072  (54%),   59944 free | bss: 65324, data: 5804
CCM   |   58444/65536   (89%),    7092 free | ccmbss: 58444, ccmdata: 0
But make cload is unsuccessful:

Code: Select all

bitcraze@ubuntu:~/projects/crazyflie-firmware$ make cload
python3 -m cfloader  flash  cf2.bin stm32-fw
Restart the Crazyflie you want to bootload in the next
 10 seconds ...
Failed to flash: 'Bootloader' object has no attribute 'flash_full'
Upon using update all projects script, the only error I receive is:

Code: Select all

ERROR: cfclient 2021.4.post13+f25f72d has requirement numpy~=1.19.2, but you'll have numpy 1.20.3 which is incompatible.
Upon using "pip3 install --user -e ." I receive the following error:

Code: Select all

bitcraze@ubuntu:~$ pip3 install --user -e .
ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: /home/bitcraze
Any ideas?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: [Crazyflie 2.1] Problem when flashing [SOLVED]

Post by kristoffer »

ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: /home/bitcraze
It looks like you are in the wrong directory (/home/bitcraze)

The dot in

Code: Select all

pip3 install --user -e .
is the path to the directory where your crazyflie lib files are located, that is the current directory in this case. Either use cd to go to the crazyflie lib directory first or use the path when calling pip

Code: Select all

pip3 install --user -e /path/to/my/cf/lib/directory
Post Reply