Why Trace_Printf doesNOT work?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Why Trace_Printf doesNOT work?

ソリューションへジャンプ
2,408件の閲覧回数
aresmarser
Contributor III

Hi Sir,

I am working on NHS3100 with LPCXpresso.

I imported the project archive release_mra2_10_1_nhs3100.zip and tested the example projects such as "app_example_dp_i2c" to study I2C driver usage.

But here I met the problem that Trace_Printf doesNOT work.

It looks like the function "Trace_Printf" blocking the routine running.

I tried to disable "Trace_Printf" by adding a "return" statement in the begin of the function body as below:

---------

void Trace_Printf(const char *format, ...)
{

  return;

// ...

}

---------

and after that, the phenomenon disappears.

Could you help to review and advice how I should do or config something to let the original project "app_example_dp_i2c" run normally?

Many thanks,

Arna

ラベル(1)
1 解決策
2,049件の閲覧回数
driesmoors
NXP Employee
NXP Employee

Hi,

1. Yes, correct.

2. Enabling will redirect the datapipe to the SWD debugger interface - provided you link in the semihosting functionality by using the Redlib (semihost) library. So, yes.

Best,
Dries.

元の投稿で解決策を見る

3 返答(返信)
2,049件の閲覧回数
aresmarser
Contributor III

Hi Dries Moors,

Thank you for your reply.

I read the function "Trace_Printf" again and debug by breakpoint.

It looks the default "#define TRACE_DATAPIPE_I2C0 1".

So the function call the below code snippet:

---

        #if TRACE_DATAPIPE_I2C0 == 1
    I2CIO_Tx((const uint8_t*)Trace_formattedString, stringSize);
        #endif

---

1. As my understand, this should require a I2C peripheral to printf the message?

2. So I should undefine "TRACE_DATAPIPE_I2C0" and define "TRACE_DATAPIPE_SEMIHOSTING" to value "1" if I have no I2C device for printf pipe?

Thanks,

Arna

0 件の賞賛
2,050件の閲覧回数
driesmoors
NXP Employee
NXP Employee

Hi,

1. Yes, correct.

2. Enabling will redirect the datapipe to the SWD debugger interface - provided you link in the semihosting functionality by using the Redlib (semihost) library. So, yes.

Best,
Dries.

2,049件の閲覧回数
driesmoors
NXP Employee
NXP Employee

Hi, Is this problem resolved at your side? Looking at the other posts, I assume it is? Keep in mind that semihosting in combination with the Deep Power Down and Power-off modes will not work: the moment you lose the SWD debug connection, any semihosting print will halt the core indefinitely.

0 件の賞賛