Hi, I'm trying to read a line or a char in a terminal but it seems nothing is happening when im typing in the terminal. I'm using processor expert TERM component.
Here is a part of my code :
char readchannel;
Term1_SendStr("select DAC channel (0, 1, 2, 3) :\r\n");
Term1_ReadChar(&readchannel);
The "send" function works well but I dont get why I cant read anything...
Would you guys help me with this ?
Regards,
Martin
Hi David,
It does work now, thank you very much.
I noticed that it also works if I create a Processor Expert project with the microprocessor selected in the settings instead of the board itself. So the issue probably comes from KDS and project generation for the FRDM K64F.
Regards,
Martin
Hi Martin,
Yes I am getting characters back.
HELLO WORLD!!!
TERMINAL DEMO
HELLO WORLD!!!1
TERMINAL DEMO
HELLO WORLD!!!2
TERMINAL DEMO
HELLO WORLD!!!3
TERMINAL DEMO
HELLO WORLD!!!4
TERMINAL DEMO
HELLO WORLD!!!5
TERMINAL DEMO
HELLO WORLD!!!6
TERMINAL DEMO
HELLO WORLD!!!7
TERMINAL DEMO
HELLO WORLD!!!8
TERMINAL DEMO
HELLO WORLD!!!
The above output is when I type "0 1 2 3 4 5 6 7 8" in the terminal window.
Note as mentioned in source code that first character not echoed back but rest of them are.
Slightly updated main().
Regards,
David
Hi David,
It still doesn't work for me... Which terminal software are you using ?
Regards,
Martin
Hi Martin,
Please look at following link:
Then search for "Term1_ReadChar" on the page.
The 3rd entry has following:
Hi Shaul,
thanks for your kind words, appreciated
– Where/how do you see that speed limit of 1200 baud? I’m not aware of such a thing.
– ‘Device’ vs. ‘Board’: I think you mean selection at project creation time? Yes, I have seen this, and this is a bug in the wizard to my knowledge. There should be a 3.0.1 update (Help > Install new software and then select the KDS site) to fix this. I had no time to verify this, but this is what I was told.
– ReadChar(&ch): yes, it blocks until it reads a character. Use first Term1_KeyPressed() to find out if there is a character present, and only then call Term1_ReadChar().
– As for CR-LF: this is an option in Termite to define what shall happen if you press key in the Termite input field.
I hope this helps,
Erich
Regards,
David
Hi David,
Thank you very much for your quick answer.
I tried to use first KeyPressed() then call ReadChar() but it still doesn't work.
I saw there was some kind of bug with the FRDM K64F and KDS, could it come from there ?
Regards,
Martin
Hi Martin,
Yes I think something not right. Not certain if hardware or software for K64. The UART gets configured to use FIFO mode and I'm not sure the drivers are really set up to use them.
I have somewhat of a workaround for you to try.
I create a new KDS_3.0 PE project for frdm-k64f (attached). Once I had the Components configured I then made edits to some of the PE files and can compile without having PE update the source.
Summary of changes (search for "//DES" :
Before submitting a trouble ticket I want to test on other hardware and also get your feedback.
Regards,
David
Hi David,
When I debug your project KDS replaces the files you modified in 'Generated_Code' folder with the originals I guess.
I am new to KDS and PE so I don't really what is going on...
Martin
Hi Martin,
Yes it takes some time to get used to the tool.
I'm guessing that IMPORTing the project and then trying to compile might also re-build the PE source code. On my side after I generated the PE code, I could then edit and compile the project without the PE code being regenerated.
You might need to re-peat those steps of re-generating the code, compile, debug/test....then go back and make the edits to source, re-compile (without generating PE code), then debug/test.
Attached is my cheat sheet of modified code you can use to copy-n-paste.
Regards,
David
Hello David,
Indeed if I re-generate PE code then edit, compile and debug then go back the code remains and can be compiled without regenerating PE code. But I still can't read a char, Term1_ReadChar() is blocking. Does it work on your side ?
Regards,
Martin