Page 1 of 2

Spi sensor connect problem

Posted: Wed Oct 14, 2020 9:06 am
by SH_Lee

Code: Select all

SYS: ----------------------------
SYS: Crazyflie Bolt is up and running!
SYS: Build 27:a90ca70b089f (2020.09 +27) MODIFIED
SYS: I am 0x20373347344D500E0027003C and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_CORE: 2 deck(s) found
DECK_CORE: Calling INIT on driver bcDWM1000 for deck 0
DWM: Failed to configure DW1000!
DECK_CORE: Calling INIT on driver bcFlow2 for deck 1
ZR2: Z-down sensor [OK]
PMW: Motion chip id: 0x49:0xB6
IMU: BMI088 Gyro SPI connection [OK].
IMU: BMI088 Accel SPI connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushless motor driver
EEPROM: I2C connection [OK].
IMU: BMI088 gyro self-test [OK]
DWM: Error while initializing DWM1000
DECK_CORE: Deck 0 test [FAIL].
DECK_CORE: Deck 1 test [OK].
If the flow_deck and uwb sensor are connected to the drone, the uwb sensor will not operate.
Is there anything I should be careful about or correct when using multiple spi sensor decks?
According to what I've looked for, there may be a problem with the timing of the spi sensor, but I don't have an accurate knowledge of it.
Others need expert knowledge before modifying the code in that it can be used without difficulty.
It doesn't matter if you connect two sensors one by one.
But if you combine them together, you'll have a problem.


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
As a result of further experiments, removing the vcom pin of the optical flow deck turns on uwb and outputs the following error:

Code: Select all

Error while initializing the PMW3901 sensor
Is this a problem with the whole body? Or is it a code problem?

Re: Spi sensor connect problem

Posted: Wed Oct 14, 2020 2:20 pm
by wydmynd
this has been corrected in a firmware release about 1 month ago. make sure you have the most recent version.

Re: Spi sensor connect problem

Posted: Wed Oct 14, 2020 2:48 pm
by SH_Lee
Of course. I used the firmware updated in September.
I wonder which part of the problem you tried to solve by updating.
I think it will be possible to adjust the same part to fit my environment.
Can you tell me the cause of the problem and the update part?

Re: Spi sensor connect problem

Posted: Wed Oct 14, 2020 3:34 pm
by wydmynd
i meant this - https://github.com/bitcraze/crazyflie-f ... issues/368
but perhaps your problem is different.

Re: Spi sensor connect problem

Posted: Wed Oct 14, 2020 5:04 pm
by SH_Lee
It was a very helpful article.
I am currently using Crazyfly-Bolt, radio dongle, flow v2, uwb sensor.
I am modifying the code based on the above article.
So far, we've been getting very stable results to modify the latency.
If there are no additional problems, I think it will be available without much change.
Thank you for your help. :D

Re: Spi sensor connect problem

Posted: Thu Oct 15, 2020 6:43 am
by kimberly
Hi!

https://github.com/bitcraze/crazyflie-f ... issues/368 has been closed and fixed already so you are not supposed to have any problems with it anymore if you are flying with the latest release like wydmynd already mentioned.

I'm not sure if this has anything to do with the Bolt, but have you also tried a different LPS positioning method, like TDOA2 or 3? Do you see the same problem there (when you remove the latency) ?

Re: Spi sensor connect problem

Posted: Thu Oct 15, 2020 1:28 pm
by SH_Lee
I tried to proceed with the experiment that you said.
Unfortunately, I tested it again today and it didn't work.
More precisely, it happens very often.
We are thinking about other ways because connection problems occur so often that we cannot trust to experiment with drones.
Based on the connection problem, I don't think the code is optimized overall.
There are too many codes to look at the full code, so we are currently looking for other ways to resolve them.
Do you have any additional advice?

Re: Spi sensor connect problem

Posted: Tue Oct 20, 2020 6:40 am
by kristoffer
On the latest firmware there should not be any SPI issues with the UWB deck.
What kind of problems do you experience, could you please describe the symptoms?

Re: Spi sensor connect problem

Posted: Wed Oct 21, 2020 2:26 pm
by SH_Lee
When both decks are connected and powered on, a failure appears in the console output of the spi connection sensor.
Of the two spi, the normal uwb connection is not good, and sometimes it is uwb but not flow_deck.
If the exact cause of this is a simple timing problem, random time extension seems necessary.
We are looking for various ways to solve this problem.

Re: Spi sensor connect problem

Posted: Thu Oct 22, 2020 9:24 am
by SH_Lee
This is my console output window.

Code: Select all

DECK_CORE: 2 deck(s) found
DECK_CORE: Calling INIT on driver bcDWM1000 for deck 0
DWM: Failed to configure DW1000!
DECK_CORE: Calling INIT on driver bcFlow2 for deck 1
ZR2: Z-down sensor [OK]
PMW: Motion chip id: 0x49:0xB6
I looked for this sentence."DWM: Failed to configure DW1000!"
This sentence was in the dwm1000Init function of locodec.c.

Code: Select all

static void dwm1000Init(DeckInfo *info)
{
   ...
   
  // Initialize the driver  
  dwInit(dwm, &dwOps);       // Init libdw

  int result = dwConfigure(dwm);
  if (result != 0) {
    isInit = false;
    DEBUG_PRINT("Failed to configure DW1000!\r\n");
    return;
    }
    
    ...
}
I think there is a problem with initializing dwm1000 here.

Code: Select all

...
  if (dwGetDeviceId(dev) != 0xdeca0130) {
    return DW_ERROR_WRONG_ID;
  }
...
Furthermore, I don't think the dwGetDecivedId(dev) in libdw1000.c file doesn't accept the right id.
when I add the code, we have received two values, and we can see that they do not match.

Code: Select all

if (dwGetDeviceId(dev) != 0xdeca0130) {
    DEBUG_PRINT("print dwGEtDeviceID(dev) = %lu\n",dwGetDeviceId(dev));
    DEBUG_PRINT("0xdeca0130 = %u\n",0xdeca0130);
    return DW_ERROR_WRONG_ID;
  }
  

Code: Select all

SYS: ----------------------------
SYS: Crazyflie Bolt is up and running!
SYS: Build 41:9be95bc71756 (2020.09 +41) MODIFIED
SYS: I am 0x20373347344D500E001D0027 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_CORE: 2 deck(s) found
DECK_CORE: Calling INIT on driver bcDWM1000 for deck 0
print dwGEtDeviceID(dev) = 3729326409                                                //dw1000 device ID
0xdeca0130 = 3737780528
DWM: Failed to configure DW1000!
DECK_CORE: Calling INIT on driver bcFlow2 for deck 1
ZR2: Z-down sensor [OK]
PMW: Motion chip id: 0x49:0xB6
IMU: BMI088 Gyro SPI connection [OK].
IMU: BMI088 Accel SPI connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushless motor driver
EEPROM: I2C connection [OK].
IMU: BMI088 gyro self-test [OK]
DWM: Error while initializing DWM1000
DECK_CORE: Deck 0 test [FAIL].
DECK_CORE: Deck 1 test [OK].
Still, it's not the deck's own problem in that there's no problem connecting only one deck. Is there any way to solve this?