Page 1 of 1

[SOLVED] Trouble with creating a custom deck

Posted: Tue Jul 04, 2017 11:17 am
by mrpie_
I have been trying to create custom deck on my Crazyflie 2.0 that will for now set pin IO1 to high. I have tried following these tutorials:
https://wiki.bitcraze.io/doc:crazyflie: ... deck:howto
https://wiki.bitcraze.io/doc:crazyflie: ... ration_api
But I cant seem to get even the most basic deck working. The drivers shows up in console upon connecting to the crazyflie python client but the initialization function and test function don't print to console like in the tutorial.
Screenshot_1.png
Below is my deck code:

Code: Select all

#define DEBUG_MODULE "TESTDECK"
#include <stdint.h>
#include <stdlib.h>
#include "stm32fxxx.h"

#include "log.h"
#include "debug.h"
#include "deck.h"

static float TEST = 1;

static void testInit(DeckInfo *info)
{
	DEBUG_PRINT("THIS IS A TEST PRINT!\n");
	TEST++;
	pinMode(DECK_GPIO_IO1, OUTPUT);
	digitalWrite(DECK_GPIO_IO1, HIGH);


}

static bool testTest(){
	DEBUG_PRINT("TEST PASSED\n");
	return true;
}

static const DeckDriver test_deck = {
  .name = "testmeow",
  .vid = 0,
  .pid = 0,


  .usedGpio = DECK_USING_IO_1,

  .init = testInit,
  .test = testTest,

};
DECK_DRIVER(test_deck);

//test logigng
LOG_GROUP_START(test)
LOG_ADD(LOG_FLOAT, TESTVARIABLE, &TEST)
LOG_GROUP_STOP(test)
My Makefile looks like this (only relevant code)

Code: Select all

# Decks

PROJ_OBJ_CF2 += bigquad.o
PROJ_OBJ_CF2 += rzr.o
PROJ_OBJ_CF2 += ledring12.o
PROJ_OBJ_CF2 += buzzdeck.o
PROJ_OBJ_CF2 += gtgps.o
PROJ_OBJ_CF2 += cppmdeck.o
PROJ_OBJ_CF2 += usddeck.o
PROJ_OBJ_CF2 += vl53l0x.o
PROJ_OBJ_CF2 += locodeck.o

PROJ_OBJ_CF2 += test2.o


My crazyflie firmware did not have a config.mk so I made a new file called config.mk and below is what I put in it. I have also tried with DEBUG=1 but that did not help.

Code: Select all

CFlAGS += -DDECK_FORCE=testmeow
I then run Make CLOUD followed by FLash using radio
Screenshot_1.png

So have I done anything wrong? Any pointers would be much appreciated :D

Re: Trouble with creating a custom deck

Posted: Wed Jul 05, 2017 9:21 am
by tobias
Would be great to know more about your custom deck :-)

I think the problem is that the FORCING of the deck doesn't work and I think it is because you accidentally used a "l" instead of "L" in CFLAGS

Code: Select all

CFlAGS += -DDECK_FORCE=testmeow

Re: Trouble with creating a custom deck

Posted: Fri Jul 07, 2017 4:32 am
by mrpie_
Oh wow... I can't believe that I missed that, I spent a fair few hours messing with this.

Thanks you so much!