On MacOS ITM_ReceiveChar macro stops working

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

On MacOS ITM_ReceiveChar macro stops working

666件の閲覧回数
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..

タグ(3)
0 件の賞賛
1 返信

591件の閲覧回数
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 件の賞賛