Is it currently possible to use AI-deck and Loco positioning together on a drone? #563
-
|
I am interested in using AI-deck and loco positioning on my drone, but I am seeing a message on my Loco positioning device that says "INFO:cfclient.utils.input.inputreaders.pysdl2:Found 0 devices". I saw on the Craziflie website that they mention support for this feature will be available in a future software update. Can anyone confirm whether or not it is currently possible to use AI-deck and loco positioning together, and if so, what steps I need to take to get this working? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
The two decks have conflicting pins AI:TX1, RX1, NINA_SYSBOOT and Loco:IRQ, RST, CS. The Loco pins could be moved by the offered patching-pads but the board still conflicts with NINA_SYSBOOT and Loco:CS. The NINA_SYSBOOT on the other hand is only used during startup (for bootloading) so they might not conflict. I did a quick test by changing the AIdeck driver like so: Then Lodo deck boots and GAP8 but not NINA (ESP32) so something else needs to be done. Perhaps Loco deck manages to put ESP32 into bootloader mode. |
Beta Was this translation helpful? Give feedback.
-
Solved: AI-deck 1.1 + Loco deck fully coexisting (GAP8 + ESP32 WiFi + LPS positioning simultaneously)Setup: Crazyflie 2.1, AI-deck 1.1, Loco deck, crazyflie-firmware 1. Pin conflict map (AI-deck 1.1 datasheet Rev 2, §3)
2. Why Loco RST on IO4 kills the ESP32 (deterministic, not a race)
pinMode(CS_PIN, OUTPUT); // CS = IO1: STM32 output register defaults to 0
// → IO1 drives LOW; first SPI txn (raising CS) is later
digitalWrite(GPIO_PIN_RESET, 0); // 10 ms reset pulse
vTaskDelay(M2T(10));
digitalWrite(GPIO_PIN_RESET, 1); // release → ESP32 samples SYSBOOT (= IO1 = LOW) NOWIf RST is on IO4, the pulse resets GAP8+ESP32; the ESP32 leaves reset with SYSBOOT low → enters ROM serial bootloader → app never runs. Symptom: GAP8 LED blinks, ESP32 LED dead, no WiFi; remove the LPS deck and the ESP32 is fine. GAP8 survives because its boot straps are not on IO1. With RST on IO3 the Loco never resets the ESP32, and IO1 sharing is harmless (SYSBOOT only sampled at reset release). 3. Hardware rework (Loco deck only; AI-deck untouched)
Final: CS=IO1, IRQ=IO2, RST=IO3. Continuity checks, power off (IO3/IO4 are adjacent holes — a stray bridge here reproduces the IO4 failure exactly; it bit me): 4. Firmware changes (3 items)(a) Kconfig ( plus your WiFi setup ( (b) - .usedGpio = DECK_USING_IO_1 | DECK_USING_IO_4,
+ .usedGpio = DECK_USING_IO_4,
.usedPeriph = DECK_USING_UART2, // keep! UART2 carries CPX/WiFi; 0 kills the ESP32 linkSafe because the driver only toggles IO1/IO4 during deliberate ESP32 re-flashing over CPX ( (c) // Init pins
+ digitalWrite(CS_PIN, 1); // pre-load ODR: pin comes up driving HIGH, no low glitch
pinMode(CS_PIN, OUTPUT);
pinMode(GPIO_PIN_RESET, OUTPUT);
pinMode(GPIO_PIN_IRQ, INPUT);5. Build & flashmake menuconfig # options from 4(a)
make -j$(nproc) # → build/cf2.bin
make cload # or: make cload CLOAD_CMDS="-w radio://0/80/2M"6. Verify
7. Caveats
|
Beta Was this translation helpful? Give feedback.
The two decks have conflicting pins AI:TX1, RX1, NINA_SYSBOOT and Loco:IRQ, RST, CS. The Loco pins could be moved by the offered patching-pads but the board still conflicts with NINA_SYSBOOT and Loco:CS. The NINA_SYSBOOT on the other hand is only used during startup (for bootloading) so they might not conflict. I did a quick test by changing the AIdeck driver like so:
Then …