[SOLVED]Unable to flash crazyflie-firmware for crazyflie 1.0 nano

Post here to get support
Post Reply
Harsh
Beginner
Posts: 2
Joined: Wed Mar 27, 2019 5:36 am

[SOLVED]Unable to flash crazyflie-firmware for crazyflie 1.0 nano

Post by Harsh » Wed Mar 27, 2019 6:26 am

Hi
I'm new to the crazyflie development environment and my device is the crazyflie nano 1.0. I am attempting to flash the new firmware using Eclipse but for some reason the flash doesn't seem to want to override the per-existing firmware. Here's the error code that comes up

Code: Select all

<06:02:17 **** Build of configuration Default for project crazyflie-firmware ****
make cload 
python3 -m cfloader  flash  cf2.bin stm32-fw
Restart the Crazyflie you want to bootload in the next
 10 seconds ...
 done!
Connected to bootloader on Crazyflie Nano Quadcopter (1.0) (version=0x1)
Target info: stm32 (0xFF)
Flash pages: 128 | Page size: 1024 | Buffer pages: 10 | Start page: 10
118 KBytes of flash available for firmware image.

Flashing 1 of 1 to stm32 (fw): Error: Not enough space to flash the image file.
Traceback (most recent call last):
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfloader/__init__.py", line 179, in main
    bl.flash(filename, targetnames)
  File "/home/bitcraze/.local/lib/python3.6/site-packages/cflib/bootloader/__init__.py", line 208, in flash
    self._internal_flash(target, file_counter, len(files_to_flash))
  File "/home/bitcraze/.local/lib/python3.6/site-packages/cflib/bootloader/__init__.py", line 285, in _internal_flash
    raise Exception()
Exception

06:02:33 Build Finished. 0 errors, 0 warnings. (took 16s.28ms)>
Would i need to flash a new crazyflie-bootloader? If so do i need an external SPI programmer to do this?
Last edited by Harsh on Thu Mar 28, 2019 12:05 am, edited 1 time in total.



arnaud
Bitcraze
Posts: 2024
Joined: Tue Feb 06, 2007 12:36 pm

Re: Unable to flash crazyflie-firmware for crazyflie 1.0 nano

Post by arnaud » Wed Mar 27, 2019 10:49 am

Hi,

What is happening is that you try to flash the Crazyflie 2.x firmware (cf2.bin) into a Crazyflie 1.0, this is not going to work and even more nowadays that the CF2 firmware is bigger than the flash available in the CF1.

We have stopped supporting Crazyflie 1.0 in the master branch of the firmware, see https://github.com/bitcraze/crazyflie-f ... 10-support. Though you can still develop for you Crazyflie you just need to come back to to the latest supported version. The following commands typed in a terminal from within the Crazyflie firmware folder should allow you to build and flash the latest supported version:

Code: Select all

crazyflie-firmware$ make clean
CLEAN

crazyflie-firmware$ git checkout 2017.06
M	vendor/cmock
M	vendor/libdw1000
M	vendor/unity
Note: checking out '2017.06'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at ab6d531 #234 Added support for sharing the deck SPI bus.

crazyflie-firmware$ git submodule update
Submodule path 'vendor/cmock': checked out '8e79a1a831e384bddabf4d9485fa0acd6bdf09c2'
Submodule path 'vendor/libdw1000': checked out '9a24ac60e08d53e7573cc25d4d6879655dc80179'
Submodule path 'vendor/unity': checked out 'bbf2fe3a934f96cd00693841247a689e57a17b0d'

crazyflie-firmware$ make PLATFORM=CF1
(...)

crazyflie-firmware$ make PLATFORM=CF1 cload
Unfortunately, while testing i found out that this fails with modern version of GCC. Adding DEBUG=1 to the build can get you to the end of the build but the linking fails because the RAM is full. This is actually the reason why we dropped support for CF1: it became increasingly hard to make a firmware that worked for both CF1 and CF2.

One solution would be to download an old version of the VM that date from ~2017, it will have a version of the compiler that can compile the cf1 firmware. A better solution if you want to work with the code is to fix the code so that it can compile with more modern compiler.

Harsh
Beginner
Posts: 2
Joined: Wed Mar 27, 2019 5:36 am

Re: Unable to flash crazyflie-firmware for crazyflie 1.0 nano

Post by Harsh » Thu Mar 28, 2019 12:05 am

Hi arnaud

Thank you very much for that, using the 2017.03 version of the VM generated the cf1.bin files and i was able to flash the firmware and consequently connect to the crazyflie 1.0 using the cfclient

Post Reply