Deck can't be detected.

Firmware/software/electronics/mechanics
Post Reply
Vegacheew
Beginner
Posts: 7
Joined: Mon Jun 17, 2019 5:17 pm

Deck can't be detected.

Post by Vegacheew » Tue Jun 18, 2019 6:45 pm

Good evening everyone!

I wrote a very basic driver for my deck I want to attach on top of the Crazyflie. It consists IR thermometer MLX90614 connected with I2C bus.

Code: Select all

/*
 * pyrometer.c
 *
 *  Created on: Jun 18, 2019
 *      Author: bitcraze
 */
#include "deck.h"
#include "debug.h"
#include "param.h"

#define DEBUG_MODULE "PD"

static bool isInit = false;

static void PyroDriverInit()
{
	DEBUG_PRINT("PyroDeck Driver initialized!\n");
	isInit = true;
}

static bool PyroDriverTest()
{
	DEBUG_PRINT("PyroDeck's Driver test passed!\n");
	return true;
}

static const DeckDriver PyroDriver = {
		.vid = 0xBC,
		.pid = 0x5A,
		.name = "MLX90614",
		.usedGpio = DECK_USING_SDA | DECK_USING_SCL,
		
		.init = PyroDriverInit,
		.test = PyroDriverTest,
};

DECK_DRIVER(PyroDriver);

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, PyroDeck, &isInit)
PARAM_GROUP_STOP(deck)
So basically I just want it to be seen in PC Crazyflie client, so I add it to deck parameters group in the end via params.h. It compiles well, I also force initialize it in config.mk with DEBUG = 1, but Crazyflie client log shows that the only deck detected is bcFlow2 (it is also onboard).

Code: Select all

SYS: Crazyflie 2.0 is up and running!
SYS: Build 69:00e0fcf022c4 (2019.02 +69) MODIFIED
SYS: I am 0x2035355237485008001C0044 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_DRIVERS: Found 16 drivers
DECK_DRIVERS: VID:PID 00:00 (bcRZR)
DECK_DRIVERS: VID:PID BC:01 (bcLedRing)
DECK_DRIVERS: VID:PID BC:04 (bcBuzzer)
DECK_DRIVERS: VID:PID BC:07 (bcGTGPS)
DECK_DRIVERS: VID:PID 00:00 (bcCPPM)
DECK_DRIVERS: VID:PID BC:08 (bcUSD)
DECK_DRIVERS: VID:PID BC:09 (bcZRanger)
DECK_DRIVERS: VID:PID BC:0E (bcZRanger2)
DECK_DRIVERS: VID:PID BC:06 (bcDWM1000)
DECK_DRIVERS: VID:PID BC:0A (bcFlow)
DECK_DRIVERS: VID:PID BC:0F (bcFlow2)
DECK_DRIVERS: VID:PID BC:0B (bcOA)
DECK_DRIVERS: VID:PID BC:0C (bcMultiranger)
DECK_DRIVERS: VID:PID BC:5A (MLX90614)
DECK_DRIVERS: VID:PID BC:FF (bcExpTest)
DECK_DRIVERS: VID:PID BC:FE (bcExpTestRR)
DECK_INFO: Found 1 deck memory.
DECK_INFO: Enumerating deck 0
DECK_INFO: Deck BC:0F bcFlow2 (Rev. A)
DECK_INFO: Used pin: 0000000C
DECK_INFO: Driver implements: [ init test ]
DECK_CORE: 1 deck(s) found
DECK_CORE: Calling INIT on driver bcFlow2 for deck 0
ZR2: Z-down sensor [OK]
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: 8864 bytes
STAB: Ready to fly.
Client also shows that deck was added in parameters, but its value is 0 (meaning it's not detected?). What else should I do so my deck could be detected?



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

Re: Deck can't be detected.

Post by arnaud » Wed Jun 19, 2019 8:03 am

Thanks for copy-pasting the console in debug, it gives a lot of useful informations :-).

From the console output it seems that there is no one-wire memory installed on your deck.

If you want your deck to be detected automatically you need to have a DS28E05 one-wire (OW) memory installed on your deck and programmed with the VID/PID you wrote in your deck driver (or VID/PID = 0/0 and the name that matches). If you have the memory soldered on your deck you can program it using the write-ow example: https://github.com/bitcraze/crazyflie-l ... py#L79-L86. Note that you will need to flash the crazyflie2-nrf-firmware without bluetooth support for the OW programming to work.

If you do not want to have a OW memory on your deck, you can force initialization of your driver by adding "CFLAGS += -DDECK_FORCE=MLX90614" to your config.mk. In that case the crazyflie will always initialize the deck driver.

Vegacheew
Beginner
Posts: 7
Joined: Mon Jun 17, 2019 5:17 pm

Re: Deck can't be detected.

Post by Vegacheew » Wed Jul 03, 2019 8:58 am

Hello!

I made a different driver with a different sensor. It's AMG8833 and it works well if attached to arduino. Its I2C address is 0x69, as shown in arduino IDE, but CF doesn't see it the same way. AMG8833 connected via I2C bus as shown (soldered to the left side of grid pins on CF: VCC - pin 1, SDA - pin 4, SCL - pin 5, GND - pin 10).So the only ways to make it work are soldering one-wire memory and force initializing driver in firmware. If so, how do I solder one-wire memory?
Attachments
AaxKwcuL8Rc.jpg

kimberly
Expert
Posts: 107
Joined: Fri Jul 06, 2018 11:13 am

Re: Deck can't be detected.

Post by kimberly » Mon Jul 22, 2019 9:46 am

Hi!

If you force initialize the driver in config.mk, you do not need the onewire memory. The memory is only if you want your deck to be detected automatically by the crazyflie, but that is unnecessary for custo made expansion decks.

Post Reply