On MacOS ITM_ReceiveChar macro stops working

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

On MacOS ITM_ReceiveChar macro stops working

623 Views
denizcan
Contributor II

The following code captures only 2 characters, than it stops capturing on MacOS.. For instance, if user presses "abc" and presses enter, only ab is captured. Than ITM_ReceiveChar always returns -1..

int i = 0;

while (i < 100)

{

     int c = ITM_ReceiveChar();

     if (c == -1)

         continue;

     if (c == 'A')

         i++;

     if (c == 'S')

         i--;

}

The code works OK in Windows.. Additionaly, if the code starts transmitting characters on very first instance of the boot through ITM port 0, the ITM Console clears out the incomming data.. Adding 2 seconds of delay to the code fixes that problem but it is inconvenient..

Btw: Transmitting with enter, and echoing is a little discomforting. I implemented shell interface with history, with this way I cannot use the history by pressing "up" key etc..

Tags (3)
0 Kudos
1 Reply

548 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Deniz,

What's your MCU part number?

What emulator do you work with?

Can you please create both windows and MacOS demo project and upload here. Thus we can test.

Thanks.


Have a great day,
Jun Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos