MCU-Link SWO ITM Console not flushing

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

MCU-Link SWO ITM Console not flushing

273 Views
briandavidson1
Contributor II

Hi!

After some fiddling with the debug settings the MCU-Link finally works. Poor OOB-experience, btw...

However, the SWO-ITM log doesn't behave as expected. When stepping through this example code:

 

    PRINTF("Hello World\r\n");

    /* Force the counter to be placed into memory. */
    volatile static int i = 0 ;
    /* Enter an infinite loop, just incrementing a counter. */
    while(1) {
        i++ ;
        PRINTF("i: %d\r\n", i);
        /* 'Dummy' NOP to allow source level single stepping of
            tight while() loop */
        __asm volatile ("nop");
    }

 

the first time SWO log shows up is at iteration 51:

 

Hello World
i: 1
i: 2
[...]
i: 50
i: 51

 

 

On the PE-Multilink the SWO ITM Console is updated on every line, which is expected, as there is a "\r\n" in every print command and this should flush the output.

Is there any way to make MCU-Link behave correctly?

Labels (1)
0 Kudos
3 Replies

247 Views
briandavidson1
Contributor II

No, the MCU keeps running fine. The SWO output is buffered in MCU-Link until approximately iteration 51 and only then the whole Console output is shown all at once.

With the PE Multilink the output of the ITM Console is updated on every iteration and each line shows up immediately.

To rephrase this: If I add a delay of 1s in betweeen, then it would take roughly one minute for the MCU-Link to show the output and all ~50 lines show up at the same time.

With the PE Multilink I'll see one line showing up each second, which is the desired bahaviour.

0 Kudos

234 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I see your issue. Maybe it is a bug of firmware of MCU-Link device.

BR

XiangJun Rong

0 Kudos

257 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Do you mean that the MCU stops at the i:51? If it is the case, can you try to declare the i as a global variable?

int i;

void main(void)

{

i=0;

while(1) {
        i++ ;
        PRINTF("i: %d\r\n", i);
        /* 'Dummy' NOP to allow source level single stepping of
            tight while() loop */
        __asm volatile ("nop");
    }

Pls have a try.

BR

XiangJun Rong

 

0 Kudos