Buffer Error when make cload

Firmware/software/electronics/mechanics
Post Reply
snyderthorst
Beginner
Posts: 23
Joined: Thu Jun 28, 2018 12:00 am

Buffer Error when make cload

Post by snyderthorst »

Hello,

I sometimes get the error:

Code: Select all

make cload
python3 -m cfloader -w radio://0/100/2M/E7E7E7E727 flash  cf2.bin stm32-fw
Reset to bootloader mode ...
Traceback (most recent call last):
  File "/home/thomas/Desktop/crazyflie-clients-python/src/cfloader/__init__.py", line 139, in main
    if bl.start_bootloader(warm_boot=True):
  File "/usr/local/lib/python3.6/dist-packages/cflib/bootloader/__init__.py", line 89, in start_bootloader
    started = self._cload.reset_to_bootloader(TargetTypes.NRF51)
  File "/usr/local/lib/python3.6/dist-packages/cflib/bootloader/cloader.py", line 105, in reset_to_bootloader
    struct.unpack('<BB', pk.data[0:2]) != (target_id, 0xFF)
struct.error: unpack requires a buffer of 2 bytes
unpack requires a buffer of 2 bytes
when I try to flash the CF with a new firmware. make and make clean work fine, only when I try to make cload and at that only sometimes. It used to flash every time and I haven't changed anything except for values in pid.h and crtp_commander_rpyt.c
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Buffer Error when make cload

Post by kimberly »

Hi!

Could you let us know how you have installed the cflib and the cfclient? The cfloader is part of the crazyflie-client-python, but we need to know how old the version is that you are using.
sstroobants
Beginner
Posts: 20
Joined: Wed Jan 30, 2019 1:13 pm

Re: Buffer Error when make cload

Post by sstroobants »

For me, pulling the latest version of the client and python libraries and reinstalling them solved this issue!
snyderthorst
Beginner
Posts: 23
Joined: Thu Jun 28, 2018 12:00 am

Re: Buffer Error when make cload

Post by snyderthorst »

I'm trying to reinstall the crazyflie client, but I'm getting the following error message:

Code: Select all

Obtaining file:///home/thomas/Desktop/crazyflie-clients-python
Requirement already satisfied: PyYAML in /usr/lib/python3/dist-packages (from cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python3.6/dist-packages (from cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: cflib>=0.1.7 in /home/thomas/Desktop/crazyflie-lib-python (from cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: pyqtgraph>=0.10 in /usr/local/lib/python3.6/dist-packages (from cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: pyzmq in /usr/local/lib/python3.6/dist-packages (from cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: qtm>=2.0.2 in /usr/local/lib/python3.6/dist-packages (from cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: quamash==0.6.1 in /usr/local/lib/python3.6/dist-packages (from cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: pyusb>=1.0.0b2 in /usr/local/lib/python3.6/dist-packages (from cflib>=0.1.7->cfclient===2019.01-18-g9fb3ab6)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from pyqtgraph>=0.10->cfclient===2019.01-18-g9fb3ab6)
Installing collected packages: cfclient
  Found existing installation: cfclient 2019.01-18-g9fb3ab6
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 360, in run
    prefix=options.prefix_path,
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 703, in uninstall
    '(at %s)' % (link_pointer, self.name, dist.location)
AssertionError: Egg-link /home/thomas/Desktop/indoor-collective-robotics-testbed/crazyflie-clients-python/src does not match installed location of cfclient (at /home/thomas/Desktop/crazyflie-clients-python/src)
➜  crazyflie-clients-python git:(master) 
Is there a way to uninstall the previous version before reinstalling? Or do I just have to delete all the files?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Buffer Error when make cload

Post by arnaud »

Hi,

You can run "pip3 uninstall cfclient" and "pip3 uninstall cflib" a couple of time to make sure you have uninstalled existing installation.
Post Reply