Tool/software: Linux
Hello,
I am using AM5728 PLSDK 04.00.00.04.
We changed the console path from tty02 to tty09.
I changed the console information as shown below.
(include/configs/am57xx_evm.h)
#define CONSOLEDEV "ttyO9"
#define CONFIG_SYS_NS16550_COM10 UART10_BASE /* UART10 */
#define CONFIG_SYS_NS16550_COM1 UART1_BASE /* Base EVM has UART0 */
#define CONFIG_SYS_NS16550_COM2 UART2_BASE /* UART2 */
#define CONFIG_SYS_NS16550_COM3 UART3_BASE /* UART3 */
#define CONFIG_BAUDRATE 115200
Kernel change
I changed stdout-path to &uart10 from am57xx-beagle-x15-common.dtsi
I removed uart3 part from dra7.dtsi.
I Add to tty09 from /etc/securetty.
This work was a success, and we can use the console terminal.
>>_____ _____ _ _
>>| _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
>>| | _| .'| . | . | | __| _| . | | | -_| _| _|
>>|__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
>> |___| |___|
>>Arago Project http://arago-project.org am57xx-evm ttyS9
>>Arago 2017.05 am57xx-evm ttyS9
>>am57xx-evm login:
We modified the changed console information to systemd service.
systemctl stop serial-getty@ttyS2.service => serial-getty@ttyS9.service
I tried executing the program in systemd.
>> root@am57xx-evm:~#systemctl start run.service
======================================================
run.service
[Unit]
Description=run service
[Service]
Type=simple
User=root
Group=root
ExecStart=/home/root/run.sh
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
--------------------------
run.sh
#!/bin/sh
systemctl stop serial-getty@ttyS9.service
/home/root/run_exe
======================================================
But, The program failed to start.
The error occurred without getting information about the console.
=========code===========
ret = tcgetattr(STDIN_FILENO, &m_tio_save);
if ( ret < 0 )
{
printf("DBG::ret= %d\n", ret);
assert(0);
}
The error number from tcgetattr() was -1, which was a permission issue.
If ttyS9 is not disable, systemd will work normally.
However, we must run our program from the console after the automatic start up.
For this reason, the console must be prevented.
Please help me with this error.
Small information may be acceptable.
Thank you.