Logging GAP8/ESP32

Discussions about the AI-deck
Post Reply
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Logging GAP8/ESP32

Post by whoenig »

We are using the new wifi streamer example (https://github.com/bitcraze/AIdeck_exam ... g_streamer) with the provided GAP8, ESP32, and STM32 firmware versions.

In the GAP8 firmware, in test.c, there are printf statements used. How can one see the printf logging? In particular, is this possible using the Olimex JTAG adapter or is some other adapter needed?

In the ESP32 firmware, logging also has been used, e.g., ESP_LOGI(...). How can one see those messages? What hardware (if not the Olimex) is required?
marcus
Bitcraze
Posts: 657
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Logging GAP8/ESP32

Post by marcus »

The easiest/quickest way to do this is to connect a USB-to-serial dongle to either the ESP32 UART or the GAP8 UART on the expansion connector (during development I've had two dongles, one for each).

For the ESP32 the only option right now is to get the UART on IO1 on the expansion connector, unfortunately we haven't had the time to re-implement the path ESP32->CF21->CF client console yet.

For the GAP8 there's more options. The quickest is to get the UART on UART1 RX on the expansion connector or to use the semi-hosting via JTAG. The semi-hosting can be enabled by setting

Code: Select all

io=host
instead of

Code: Select all

io=uart
in the Makefile (link to code). Another option would be to forward the GAP8 UART in the CF21 firmware to the console, currently we're just throwing the characters away (link to code).

The ESP is compiled with the maximum level of DEBUG and you can set the levels for each module in the code (link to code). Note that having a lot of printouts will effect the performance noticable (the uart is pretty slow).

The current idea is to implement a way for both the ESP32 and the GAP8 to print to the client console, but we haven't gotten there yet.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Logging GAP8/ESP32

Post by whoenig »

Thanks, Marcus! It would be nice if this can go to the documentation (or be pinned here:-). Also, it might make sense to list additional recommended products on the product page. It seems like for the AI deck for development one needs at least the Olimex and the USB-to-serial dongle (right now). Finally, for me it would be easier to order those things in the one-stop-shop.

Thanks again, especially for all the details.
rsantosc
Beginner
Posts: 4
Joined: Thu Mar 10, 2022 5:23 pm

Re: Logging GAP8/ESP32

Post by rsantosc »

Hello all,

I've also been trying to debug NINA and just noticed the latest commit to the examples: https://github.com/bitcraze/aideck-esp- ... c0e4caa7e3 in which console printing is removed

What was the reason for this? Incompatability with the new CPX routing?
marcus
Bitcraze
Posts: 657
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Logging GAP8/ESP32

Post by marcus »

Hi!

The change was made because we needed a clean commit for production. We're currently finalizing a new batch of AI-decks where we've replaced the old WiFi streamer example with the new code (for both ESP32 and GAP8). Having the UART output on IO1 would risk creating incompatibilities with other decks.

The goal is to do the logging via CPX (using the target CF and function LOG) which will print information on the Crazyflie console. But this functionality doesn't exist yet so I think being able to log via IO1 is still needed (we use it while developing). I'll revert back the change for now and then figure out a good way to have this configurable instead.
rsantosc
Beginner
Posts: 4
Joined: Thu Mar 10, 2022 5:23 pm

Re: Logging GAP8/ESP32

Post by rsantosc »

Thanks Marcus!

I agree that using CPX-based console logging is the optimal way for production, but being able to use the UART can still be useful for debugging/developing (at least for now). Maybe having this configurable as well as the logging levels as a Kconfig option would be a nice-to-have

I will try flashing the latest version and see if i can manage to debug the NINA and will let you know how it goes! :D
rsantosc
Beginner
Posts: 4
Joined: Thu Mar 10, 2022 5:23 pm

Re: Logging GAP8/ESP32

Post by rsantosc »

Works! Thank you
Post Reply