Page 1 of 1

Forcing deck initialization

Posted: Sun Jun 09, 2019 3:57 pm
by roeiz
Dear Bitcraze community,

I was using an older VM version (ubuntu 14) and was forcing a deck initialization on the CF2. Everything worked perfectly fine, but the eclipse itself was giving me a headache due to a few bugs in the IDE.
To solve the eclipse issues, I was forced to download and use the newer bitcraze VM version, and have updated all projects.

After doing so, I tried using the bcSequence example (autonomously flying 8 figure) to make sure everything still works well. I have done everything exactly as written here:
viewtopic.php?f=6&t=2648&p=13352&hilit=demo#p13352

I can see the deck sequence.o being compiled, however, the CF2 will not perform the sequence. My thoughts are that the deck is compiled but not being forced to initialize.

I have added the following line to config.mk:

Code: Select all

CFLAGS += -DDECK_FORCE=bcSequence
and the following to makefile, where all the decks are:

Code: Select all

PROJ_OBJ += sequence.o
Was there any change in the firmware that changed the way decks are forced initialization?
If not, any idea what other possible reason can cause this behavior?

Thanks in advance,
Roei

Re: Forcing deck initialization

Posted: Mon Jun 10, 2019 11:33 am
by arnaud
There has been no change in the deck force define, so this should still work. I agree that the deck driver not starting is a likely cause for the sequence not starting.

The best would be to look in the log tab of the Crazyflie client when connecting to the Crazyflie, if a deck driver is forced it will be printed on the console.

Ont thing that changed over time, though it was a long time ago, is the place of the config.mk file: it used to be at the root of the project and it is now at tools/make/config.mk

Re: Forcing deck initialization

Posted: Mon Jun 10, 2019 12:21 pm
by roeiz
The best would be to look in the log tab of the Crazyflie client when connecting to the Crazyflie, if a deck driver is forced it will be printed on the console.
This is what I see in the client:

Code: Select all

SYS: ----------------------------
SYS: Crazyflie 2.0 is up and running!
SYS: Build 69:00e0fcf022c4 (2019.02 +69) MODIFIED
SYS: I am 0x373036383435511800ash!
CFGBLK: v1, verification [OK]
DECK_CORE: 1 deck(s) found
DECK_CORE: Calling INIT on driver bcFlow for deck 0
PMW: Motion chip id: 0x49:0xB6
MPU9250 I2C connection [OK].
AK8963 I2C connection [OK].
LPS25H I2C connection [OK].
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
EEPROM: I2C connection [OK].
AK8963: Self test [OK].
DECK_CORE: Deck 0 test [OK].
STAB: Wait for sensor calibration...
SYS: Free heap: 8480 bytes
STAB: Ready to fly.
Which as far as I understand it shows the deck driver isn't forced.

Regarding:
Ont thing that changed over time, though it was a long time ago, is the place of the config.mk file: it used to be at the root of the project and it is now at tools/make/config.mk
I can see the config.mk is located in tools/make/config.mk, should it affect my project in any way? I have added the required lines just as I wrote in above (original post)

I'm kinda out of ideas, will try and flash the old firmware to the CF2 and see if the deck is being forced then.
Any other ideas?

Thanks

EDIT: I've seen some stuff over the internet regarding decks won't be forced unless CF2 is in debug mode, could that be the case?

Re: Forcing deck initialization

Posted: Mon Jun 10, 2019 12:51 pm
by arnaud
Looking at the console, no deck is forced so this is the problem.

Is is not required to be in debug mode to force a deck.

To make sure your config.mk is actually used, you can try to write some invalide make in config.mk and verifying that the build does not work anymore. For example I wrote 'plop' in my config.mk and I get:

Code: Select all

$ make
tools/make/config.mk:8: *** missing separator.  Stop.
You should also make sure to 'make clean' after changing config.mk to make sure the required files are compiled with the new defines.