[SOLVED]How can i get the crazyflie debug_print by the UART

Firmware/software/electronics/mechanics
Post Reply
baicker
Beginner
Posts: 20
Joined: Tue Dec 31, 2013 5:24 am

[SOLVED]How can i get the crazyflie debug_print by the UART

Post by baicker »

I have seen some debug_print define in some files

Makefile:# CFLAGS += -DDEBUG_PRINT_ON_UART # Redirect the console output to the UART
utils/interface/debug.h:#ifdef DEBUG_PRINT_ON_UART
utils/interface/debug.h: #error "Need to define ENABLE_UART to use DEBUG_PRINT_ON_UART"

could you tell me how can i get the debug_print by the stm32 uart, should i modify the code ? and how to connect the chip ?
Last edited by baicker on Thu Jan 16, 2014 2:05 pm, edited 1 time in total.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How can i get the crazyflie debug_print by the stm32 UAR

Post by tobias »

Are you planning to use it for debugging? We use a 3.3V FTDI cable and solder it to the expansion port as shown in the picture.

Expansion pin - FTDI cable color
3 - Yellow (STM32 TX)
5 - Orange (STM32 RX)
18 - Black (GND)

What we have planned for a while is to use a virtual comport driver and use the USB for debugging but we have just not had the time to implement it. If you are up for it ST has code for it.
Attachments
Crazyflie-FTDI_3.3V.png
baicker
Beginner
Posts: 20
Joined: Tue Dec 31, 2013 5:24 am

Re: How can i get the crazyflie debug_print by the stm32 UAR

Post by baicker »

tobias wrote:Are you planning to use it for debugging? We use a 3.3V FTDI cable and solder it to the expansion port as shown in the picture.

Expansion pin - FTDI cable color
3 - Yellow (STM32 TX)
5 - Orange (STM32 RX)
18 - Black (GND)

What we have planned for a while is to use a virtual comport driver and use the USB for debugging but we have just not had the time to implement it. If you are up for it ST has code for it.
thank you tobias, you are so warm-hearted

Do i have to remake the firmware with DEBUG=1 or other options?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How can i get the crazyflie debug_print by the stm32 UAR

Post by tobias »

It should be enough by setting

Code: Select all

CFLAGS += -DENABLE_UART          # To enable the uart
CFLAGS += -DDEBUG_PRINT_ON_UART  # Redirect the console output to the UART
DEBUG=1 is mainly to be used for JTAG debugging.
baicker
Beginner
Posts: 20
Joined: Tue Dec 31, 2013 5:24 am

Re: How can i get the crazyflie debug_print by the stm32 UAR

Post by baicker »

tobias wrote:It should be enough by setting

Code: Select all

CFLAGS += -DENABLE_UART          # To enable the uart
CFLAGS += -DDEBUG_PRINT_ON_UART  # Redirect the console output to the UART
DEBUG=1 is mainly to be used for JTAG debugging.
ok, thanks tobias. :P
Post Reply