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.
2nd option worked for me. I got printf() message on Serial port monitor.
Thanks
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
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:
2. using _printf based on the Redlib implementation:
For this let the SDK_DEBUGCONSOLE set to 0 and remove CR_INTEGER_PRINTF
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
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().