printf() in qn908xcdk sample

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

printf() in qn908xcdk sample

1,275 Views
toru148
Contributor I

I try to add printf() in qn908xcdk_wireless_examples_bluetooth_otap_client_att_freertos.

I just copy some code from qn908xcdk_rtso_examples_freertos_hello.

But I always get compile error "undefined reference to `_printf'"

Do you know how to add printf() in qn908xcdk_wireless_examples_bluetooth_otap_client_att_freertos ?

I use MCUXpresso IDE v11.0.1, QN9080SIP development kit.

Labels (2)
4 Replies

1,033 Views
toru148
Contributor I

2nd option worked for me. I got printf() message on Serial port monitor.

Thanks

1,033 Views
ovidiu_usturoi
NXP Employee
NXP Employee

Hi toru148@gmail.com‌, 

If the issue is fixed, can you please close the ticket by using: 

- mark an answer as correct:

or

- Mark as assumed answered button.

Regards,

Ovidiu

0 Kudos

1,033 Views
ovidiu_usturoi
NXP Employee
NXP Employee

Hi toru148@gmail.com‌, 

For this linker issue are two options:

1. using SDK_DEBUGCONSOLE. For this we will have to enable this define from project options, like below:

pastedImage_1.png

2. using _printf based on the Redlib implementation:

For this let the SDK_DEBUGCONSOLE set to 0 and remove CR_INTEGER_PRINTF

pastedImage_2.png

Please also take a look at the SDK_DEBUGCONSOLE_UART define.

(here are also some details for a similar topic: https://community.nxp.com/thread/389140 )

Regards,

Ovidiu

0 Kudos

1,033 Views
Xiang_Li
NXP Employee
NXP Employee

How about debug console? See file fsl_debug_console.h/.c

Search function DbgConsole_Init() globally in SDK to see examples of how to use it. For example, check demo_apps\hello_world project, which does only a serial in/out.

Alternatively, you can check the project private_profile_client. And the usage of Serial_Print().

But in this case we need to define a print_buffer[], and use sprintf() if we want to print parameters via Serial_Print().

0 Kudos