AnsweredAssumed Answered

KW36 bluetooth : Semihost console compilation error

Question asked by Ziv Wang on Aug 12, 2019
Latest reply on Aug 13, 2019 by Estephania Martinez

Hi someone,

 

i have met a issue when using semihost console mode, the demo can not pass the compilation.

the details as below:

Demo code : 

   frdmkw36_wireless_examples_bluetooth_glucose_s_freertos 

settings for printf: 

   checked or unchecked “Redirect SDK “PRINTF” to C library “printf” , both have tried while importing the demo

Setting for  SDK_DEBUGCONSOLE:

 

Code changed:

   ported the BOARD_InitDebugConsole related code from hello work demo

 

Results:

1) Set to Semihost cosole mode, the demo cannot pass the compilation while PRINTF is called.

the error test is :  C:\Users\DELL\Documents\MCUXpressoIDE_11.0.0_2516\workspace\frdmkw36_wireless_examples_bluetooth_glucose_s_freertos\Debug/../source/glucose_sensor.c:241: undefined reference to `_printf'

thePRINTF is called here:

on this condition, no matter the setting of “printf ” lib

 

2) Setting to uart console mode

the compilation is ok, and the uart terminator is printed the expected strings.

 

summarize: if the  SDK_DEBUGCONSOLE = 0, 

the printf and related fucntions should defined from the IDE lib, should not have this compilation error.

But why this happen?

Outcomes