Heightsensor VL6180

Firmware/software/electronics/mechanics
mwall002
Beginner
Posts: 20
Joined: Wed Jul 01, 2015 4:48 am

Re: Heightsensor VL6180

Post by mwall002 »

So, I think I have figured out what the problem is but I don't know how to fix it... A couple of weeks ago Xubuntu updated to 14.1 (which I wish I didn't do) and when I opened up Eclipse my projects were gone. To get the code loaded back in somehow I ended up in the Eclipse Workspace instead of the Projects folder and I have been there ever since. The weird thing is CLOAD and FLASH works in the Eclipse Workspace but now when I go back to the code in the Projects folder CLOAD doesn't work for any firmware. It gives me this error:

make: arm-none-eabi-gcc: Command not found
scripts/targets.mk:26: recipe for target 'version.o' failed

How do I fix this problem? Will this make any difference with how my firmware updates to the crazyflie (my problem above)?

Thanks!
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Heightsensor VL6180

Post by tobias »

I have tried updating it through both the client and eclipse and the results are the same.
What am I doing wrong? #frustrated
You might have hit a bug. Try deleting the files in the cache directory since the cfclient caches the log/param TOC so it will be faster connecting to. When you just change a name for the log variable it might not update the cache as it should. You will find the cache directory from the cfclient under the menu "settings->open config folder".
How do I fix this problem? Will this make any difference with how my firmware updates to the crazyflie (my problem above)?
It is the path to the arm toolchain that has gone missing. You can either add it to eclipse project settings under "C/C++ build->Environment" or create a config.mk file in the same directory as the makefile and add:

Code: Select all

CROSS_COMPILE = /home/bitcraze/bin/gcc-arm-none-eabi/bin/arm-none-eabi-
It might also be good to use the code in the projects folder. When you import a project don't select so it copies the files into the workspace (if I remember correctly)
mwall002
Beginner
Posts: 20
Joined: Wed Jul 01, 2015 4:48 am

Re: Heightsensor VL6180

Post by mwall002 »

Thanks Tobias. I'm back up and running thanks to you!

But I'm not making any progress with this sensor. Any advice on a starting point to see if it is even initializing?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Heightsensor VL6180

Post by tobias »

That's good news!
Any advice on a starting point to see if it is even initializing?
Well it is now things can become complected. I would start with just reading some register from the (like ID register) sensor and print it to the cfclient console using DEBUG_PRINT. This will test the I2C connection as a starting point. Having a SWD debugger helps a lot developing things such as this as you can step through the code, look at variables, etc.
mwall002
Beginner
Posts: 20
Joined: Wed Jul 01, 2015 4:48 am

Re: Heightsensor VL6180

Post by mwall002 »

Thanks Tobias. I am looking into purchasing a debugger setup. Obviously I need the crazy flie 2.0 debugger package and it looks like I won't have to worry about soldering on the nRF connecter for my project, correct?

Would something like this work for a debugger?

https://www.sparkfun.com/products/8278? ... AnzI8P8HAQ

Don't really want to spend several hundred dollars on a professional grade one. Thanks again!
mwall002
Beginner
Posts: 20
Joined: Wed Jul 01, 2015 4:48 am

Re: Heightsensor VL6180

Post by mwall002 »

Besides the above questions I have another question. I have noticed that the new .h and .c files I have created for the sensor are not generating .o file versions after cload. Is that why none of this code is working? They seem like they are not actually making it the the firmware.

If that is what's happening, how do I get them to be recognized by the rest of the program so .o files are created? Thanks!
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Heightsensor VL6180

Post by tobias »

To debug it you need a SWD compatile debugger. I don't think the link you sent supports that. I suggest to get a STLINK/V2 or a STM eval board with one on it, as described a bit here and here. You also need the debug adapter kit (or you can build your own cable. Debug connector type can be found under spare components).
f that is what's happening, how do I get them to be recognized by the rest of the program so .o files are created? Thanks!
Yes you need to add the new files to the makefile.
mwall002
Beginner
Posts: 20
Joined: Wed Jul 01, 2015 4:48 am

Re: Heightsensor VL6180

Post by mwall002 »

Hi Tobias, I have added the drivers to the make file and it is creating the .o files but still get no debug print on the console from the new files I have created.

I even started over by downloading all of the latest firmware, copied the eeprom driver files, named these copies of the .c and .h files vl6180x, added them to the make file and still get no debug print from these new files while the eeprom prints fine. I believe that none of the new files I create are actually making it to the crazy flie.

Is there something else I am missing that I need to do? Or is there some wrong setting in eclipse? I don't know what to do and have wasted too many hours trying to figure it out...but I'm not going to give up.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Heightsensor VL6180

Post by tobias »

Could you post your code you added to the makefile. I'm thinking you added it to CF1 config (PROJ_OBJ_CF1) when you should add it to PROJ_OBJ_CF2.
mwall002
Beginner
Posts: 20
Joined: Wed Jul 01, 2015 4:48 am

Re: Heightsensor VL6180

Post by mwall002 »

I believe I have it in the right place. I have tried it every way possible actually with no change.

Code: Select all

############### Source files configuration ################

# Init
PROJ_OBJ = main.o
PROJ_OBJ_CF1 = platform_cf1.o
PROJ_OBJ_CF2 = platform_cf2.o

# Drivers
PROJ_OBJ += exti.o nvic.o motors.o
PROJ_OBJ_CF1 += led_f103.o i2cdev_f103.o i2croutines.o adc_f103.o mpu6050.o hmc5883l.o ms5611.o nrf24l01.o eeprom.o 
PROJ_OBJ_CF2 += led_f405.o mpu6500.o i2cdev_f405.o ws2812.o lps25h.o ak8963.o eeprom.o maxsonar.o vl6180x.o
PROJ_OBJ_CF2 += uart_syslink.o swd.o uart1.o uart2.o
The only other thing I have noticed is when I expand the cf2.elf file it creates in Eclipse after CLOAD, the vl6180x driver files are not listed. I'm not sure if that matters or not since the eeprom files aren't there either and it still works.

Should I try modifying an existing driver set like maxsonar to see if that works? That's the only other thing I can think of to try
Post Reply