I want to sheild the uart2's terminal function and use uart2 as simple data transfer.But there is something wrong.
As it is said,when you run Serial2.begin(115200),You will see how the Arduino system detaches the console from the serial port. It also sets up stuff such that the console is reattached when you end using the Serial2 and/or reboot.Then the problems come.
First , I find there is no file named telinit, then I replace it with file init, the probem seemed solved.
Second, I find there is no content in the files named inittab and inittab.restore.
finally,After I detaches the console from the serial port. It starts again.the phenomenon is like that:
Would you mind give some suggestions.
Thanks a lot.
PS：The hardware is Intel® Edison Board for Arduino*
I have not done used the Serial2 object for much, so really not sure how much I can help.
I have used it a couple of times for doing some limited debugging. That is when I had an Arduino App that I launch using WiFI to upload and for example on the mini board, I am using the USB port with the converter to use it in server mode. I don't have the normal USB serial port for debug information. So in that case I have enabled it using the Serial2 object, which has worked for me. Currently doing more stuff using Eclipse or building direct on Edison and as such do the debug using PuTTY windows instead of Serial2 object.
And yes if you reboot without the Arduino APP or do a Serial2.end(); it will again launch the debug window. When I was debugging earlier, I would run a different Arduino APP, that either cleared out running my app, or a real simple begin/end of Serial2 to get the system monitor back.
Sorry I am not much help
Before giving any suggesting I'd rather ask why do you need to mess up with init and inittab and how is that related to Arduino's Serial2 object in your context?
I'd suggest you to describe in more detail, step-by-step if possible, what your goal is and which steps have you performed so that you ended up with the above. Right now I'm afraid it's too generic of a description to me, to be able to suggest anything meaningful.
Hi, AlexT_Intel,sorry,I should describe the situation in more detail.
Hardware: Intel@ Edison Board for Arduino
Why: There are two UART provided by the Board, one is TTL ,and the other is used for terminal console.I want to use the terminal console port as simple UART function,that's to say ------ sheild the terminal function.
In the link
It tells how to sheild the terminal fuction, but it did not work. When I run Serial2.begin(115200)
You can read the code (Serial2.begin(115200)) in arduino-windows-1.0.4(TTYUART.cpp),and understand what I want to describe.
Okay, thanks for clarification, now I see what you're talking about.
It seems to me that what you see is a bug or not fully implemented functionality, because the TTYUART.cpp file for Edison is identical (except for two small and irrelevant to this problem pieces) to the one for Galileo and the trick used there to detach the console and then attach it back isn't going to work on Edison, because it doesn't use init-style OS initialization but a systemd one.
I have tried a very simple sketch of Serial2.begin(115200)/pause/Serial2.end() and I actually don't see anything like you posted in that other thread, probably you've already modified something or used KurtE's library,or something else along these lines. In my case just nothing happens, maybe just the serial console becomes laggy after the first try.
At the same time I'm not sure if this functionality of attaching Serial2 to this console is actually supported on Edison. I couldn't find any release notes on that as a proof, so I may be mistaken here, but my impression was that this specific feature was for Galileos only.
AKap - Serial1 should work on Arduino IDE 1.6.0, make sure you are selecting the Edison board before clicking on the Verify button. This could fail if another board is selected.