Topic

FAQ
Login Register
Print debug information
ZNS
Jul 01, 2021 13:36

/

A

/A

Hello! In the chapter 4 of SDK Developer Manual there is an instruction how to printf debug info on any GPIO. Here are my defines


(app_cfg.h)

#define UART_PRINTF_MODE 1

#define BAUDRATE 1000000


(board_custom.h included in app_cfg.h)

#if UART_PRINTF_MODE

      #define DEBUG_INFO_TX_PIN      GPIO_PB1//print

#endif


I've put "printf("some text")" in timer callback( which works), but no debug info coming out from GPIO_PB1 pin.

Also I have a warning on each printf "statement with no effect". 
Are there some more defines to use debug printf, or maybe project settings? Or may be not every pin can be a debug output?
P.S. i'm using TLSR8258, SDK V3.6.5.0



halakvyas Jul 23, 2021 02:38
0
/A

Try to include u_printf.h as shown in sample below,


#define UART_PRINT_DEBUG_ENABLE      1


#if (UART_PRINT_DEBUG_ENABLE)
//the baud rate should not bigger than 1M(system timer clock is constant 16M)
#define PRINT_BAUD_RATE                      1000000
#define DEBUG_INFO_TX_PIN                   GPIO_PB2
#define PULL_WAKEUP_SRC_PB2             PM_PIN_PULLUP_10K
#define PB2_OUTPUT_ENABLE                  1
#define PB2_DATA_OUT                            1 //must


#include "application/print/u_printf.h"
#endif

3 replies
TL_hk Jul 01, 2021 14:27
1
/A

There are no other steps, but it's recommended that clean and recompile the project if you modify the .h files.

halakvyas Jul 23, 2021 02:38
0
/A

Try to include u_printf.h as shown in sample below,


#define UART_PRINT_DEBUG_ENABLE      1


#if (UART_PRINT_DEBUG_ENABLE)
//the baud rate should not bigger than 1M(system timer clock is constant 16M)
#define PRINT_BAUD_RATE                      1000000
#define DEBUG_INFO_TX_PIN                   GPIO_PB2
#define PULL_WAKEUP_SRC_PB2             PM_PIN_PULLUP_10K
#define PB2_OUTPUT_ENABLE                  1
#define PB2_DATA_OUT                            1 //must


#include "application/print/u_printf.h"
#endif